From f1180ec11e0b33e528b4e505014a8388f450ba2e Mon Sep 17 00:00:00 2001 From: Chris Arceneaux Date: Wed, 28 Apr 2021 13:17:25 -0400 Subject: [PATCH 1/4] Testing openapi-generator Attempting to generate Go SDK with openapi-generator. Current implementation of Go SDK generated with go-swagger loses configuration for multiple models to be used. Signed-off-by: Chris Arceneaux --- client/automation/automation_client.go | 727 - .../export_credentials_parameters.go | 185 - .../export_credentials_responses.go | 219 - .../export_encryption_passwords_parameters.go | 185 - .../export_encryption_passwords_responses.go | 219 - client/automation/export_jobs_parameters.go | 185 - client/automation/export_jobs_responses.go | 219 - .../export_managed_servers_parameters.go | 185 - .../export_managed_servers_responses.go | 219 - .../automation/export_proxies_parameters.go | 185 - client/automation/export_proxies_responses.go | 219 - .../export_repositories_parameters.go | 185 - .../export_repositories_responses.go | 219 - .../get_all_automation_sessions_parameters.go | 621 - .../get_all_automation_sessions_responses.go | 181 - .../get_automation_session_logs_parameters.go | 188 - .../get_automation_session_logs_responses.go | 219 - .../get_automation_session_parameters.go | 188 - .../get_automation_session_responses.go | 219 - .../import_credentials_parameters.go | 185 - .../import_credentials_responses.go | 219 - .../import_encryption_passwords_parameters.go | 185 - .../import_encryption_passwords_responses.go | 219 - client/automation/import_jobs_parameters.go | 185 - client/automation/import_jobs_responses.go | 219 - .../import_managed_servers_parameters.go | 185 - .../import_managed_servers_responses.go | 219 - .../automation/import_proxies_parameters.go | 185 - client/automation/import_proxies_responses.go | 219 - .../import_repositories_parameters.go | 185 - .../import_repositories_responses.go | 219 - .../stop_automation_session_parameters.go | 188 - .../stop_automation_session_responses.go | 217 - .../backup_objects/backup_objects_client.go | 168 - .../get_all_backup_objects_parameters.go | 477 - .../get_all_backup_objects_responses.go | 219 - .../get_backup_object_parameters.go | 188 - .../get_backup_object_responses.go | 219 - ...backup_object_restore_points_parameters.go | 188 - ..._backup_object_restore_points_responses.go | 219 - client/backups/backups_client.go | 168 - client/backups/get_all_backups_parameters.go | 517 - client/backups/get_all_backups_responses.go | 181 - .../backups/get_backup_objects_parameters.go | 188 - .../backups/get_backup_objects_responses.go | 219 - client/backups/get_backup_parameters.go | 188 - client/backups/get_backup_responses.go | 219 - .../configuration_backup_client.go | 168 - .../get_config_backup_options_parameters.go | 164 - .../get_config_backup_options_responses.go | 219 - .../start_config_backup_parameters.go | 164 - .../start_config_backup_responses.go | 219 - ...update_config_backup_options_parameters.go | 185 - .../update_config_backup_options_responses.go | 257 - client/connection/connection_client.go | 82 - .../get_connection_certificate_parameters.go | 185 - .../get_connection_certificate_responses.go | 219 - .../change_password_for_creds_parameters.go | 209 - .../change_password_for_creds_responses.go | 255 - ...change_private_key_for_creds_parameters.go | 209 - .../change_private_key_for_creds_responses.go | 255 - ...ange_root_password_for_creds_parameters.go | 209 - ...hange_root_password_for_creds_responses.go | 255 - client/credentials/create_creds_parameters.go | 185 - client/credentials/create_creds_responses.go | 219 - client/credentials/credentials_client.go | 383 - client/credentials/delete_creds_parameters.go | 188 - client/credentials/delete_creds_responses.go | 217 - .../credentials/get_all_creds_parameters.go | 339 - client/credentials/get_all_creds_responses.go | 181 - client/credentials/get_creds_parameters.go | 188 - client/credentials/get_creds_responses.go | 219 - client/credentials/update_creds_parameters.go | 209 - client/credentials/update_creds_responses.go | 257 - .../create_encryption_password_parameters.go | 185 - .../create_encryption_password_responses.go | 219 - .../delete_encryption_password_parameters.go | 188 - .../delete_encryption_password_responses.go | 217 - client/encryption/encryption_client.go | 254 - ...get_all_encryption_passwords_parameters.go | 305 - .../get_all_encryption_passwords_responses.go | 181 - .../get_encryption_password_parameters.go | 188 - .../get_encryption_password_responses.go | 219 - .../update_encryption_password_parameters.go | 209 - .../update_encryption_password_responses.go | 257 - .../general_options/general_options_client.go | 125 - .../get_general_options_parameters.go | 164 - .../get_general_options_responses.go | 219 - .../update_general_options_parameters.go | 185 - .../update_general_options_responses.go | 257 - ...t_all_inventory_vmware_hosts_parameters.go | 339 - ...et_all_inventory_vmware_hosts_responses.go | 181 - .../get_vmware_host_object_parameters.go | 497 - .../get_vmware_host_object_responses.go | 219 - .../inventory_browser_client.go | 125 - client/jobs/create_job_parameters.go | 185 - client/jobs/create_job_responses.go | 219 - client/jobs/delete_job_parameters.go | 185 - client/jobs/delete_job_responses.go | 217 - client/jobs/disable_job_parameters.go | 185 - client/jobs/disable_job_responses.go | 255 - client/jobs/enable_job_parameters.go | 185 - client/jobs/enable_job_responses.go | 255 - client/jobs/get_all_jobs_parameters.go | 373 - client/jobs/get_all_jobs_responses.go | 181 - client/jobs/get_all_jobs_states_parameters.go | 687 - client/jobs/get_all_jobs_states_responses.go | 181 - client/jobs/get_job_parameters.go | 185 - client/jobs/get_job_responses.go | 219 - client/jobs/jobs_client.go | 469 - client/jobs/start_job_parameters.go | 206 - client/jobs/start_job_responses.go | 257 - client/jobs/stop_job_parameters.go | 206 - client/jobs/stop_job_responses.go | 257 - client/jobs/update_job_parameters.go | 206 - client/jobs/update_job_responses.go | 257 - .../create_authorization_code_parameters.go | 164 - .../create_authorization_code_responses.go | 181 - client/login/create_token_parameters.go | 364 - client/login/create_token_responses.go | 219 - client/login/login_client.go | 168 - client/login/logout_parameters.go | 164 - client/login/logout_responses.go | 179 - .../create_managed_server_parameters.go | 185 - .../create_managed_server_responses.go | 219 - .../delete_managed_server_parameters.go | 188 - .../delete_managed_server_responses.go | 219 - .../get_all_managed_servers_parameters.go | 407 - .../get_all_managed_servers_responses.go | 181 - .../get_managed_server_parameters.go | 188 - .../get_managed_server_responses.go | 219 - .../managed_servers/managed_servers_client.go | 254 - .../update_managed_server_parameters.go | 209 - .../update_managed_server_responses.go | 257 - ...et_all_object_restore_points_parameters.go | 553 - ...get_all_object_restore_points_responses.go | 181 - ...t_object_restore_point_disks_parameters.go | 188 - ...et_object_restore_point_disks_responses.go | 219 - .../get_object_restore_point_parameters.go | 188 - .../get_object_restore_point_responses.go | 219 - .../object_restore_points_client.go | 168 - client/proxies/create_proxy_parameters.go | 185 - client/proxies/create_proxy_responses.go | 219 - client/proxies/delete_proxy_parameters.go | 188 - client/proxies/delete_proxy_responses.go | 217 - client/proxies/get_all_proxies_parameters.go | 409 - client/proxies/get_all_proxies_responses.go | 181 - client/proxies/get_proxy_parameters.go | 188 - client/proxies/get_proxy_responses.go | 219 - client/proxies/proxies_client.go | 254 - client/proxies/update_proxy_parameters.go | 209 - client/proxies/update_proxy_responses.go | 257 - .../create_repository_parameters.go | 185 - .../create_repository_responses.go | 219 - .../delete_repository_parameters.go | 223 - .../delete_repository_responses.go | 217 - ..._out_extent_maintenance_mode_parameters.go | 209 - ...e_out_extent_maintenance_mode_responses.go | 219 - ..._out_extent_maintenance_mode_parameters.go | 209 - ...e_out_extent_maintenance_mode_responses.go | 219 - .../get_all_repositories_parameters.go | 490 - .../get_all_repositories_responses.go | 181 - .../get_all_repositories_states_parameters.go | 517 - .../get_all_repositories_states_responses.go | 181 - ...t_all_scale_out_repositories_parameters.go | 339 - ...et_all_scale_out_repositories_responses.go | 181 - .../repositories/get_repository_parameters.go | 188 - .../repositories/get_repository_responses.go | 219 - .../get_scale_out_repository_parameters.go | 188 - .../get_scale_out_repository_responses.go | 219 - client/repositories/repositories_client.go | 469 - .../update_repository_parameters.go | 209 - .../update_repository_responses.go | 257 - ...instant_recovery_mount_model_parameters.go | 188 - ..._instant_recovery_mount_model_responses.go | 219 - ...recovery_vmware_fcd_dismount_parameters.go | 188 - ..._recovery_vmware_fcd_dismount_responses.go | 257 - ..._recovery_vmware_fcd_migrate_parameters.go | 209 - ...t_recovery_vmware_fcd_migrate_responses.go | 257 - ...nt_recovery_vmware_fcd_mount_parameters.go | 185 - ...ant_recovery_vmware_fcd_mount_responses.go | 257 - client/restore/restore_client.go | 211 - .../get_server_certificate_parameters.go | 164 - .../get_server_certificate_responses.go | 181 - client/service/get_server_time_parameters.go | 164 - client/service/get_server_time_responses.go | 181 - client/service/service_client.go | 123 - .../services/get_all_services_parameters.go | 339 - client/services/get_all_services_responses.go | 181 - client/services/services_client.go | 82 - .../sessions/get_all_sessions_parameters.go | 621 - client/sessions/get_all_sessions_responses.go | 181 - .../sessions/get_session_logs_parameters.go | 188 - client/sessions/get_session_logs_responses.go | 219 - client/sessions/get_session_parameters.go | 188 - client/sessions/get_session_responses.go | 219 - client/sessions/sessions_client.go | 211 - client/sessions/stop_session_parameters.go | 188 - client/sessions/stop_session_responses.go | 217 - .../get_all_traffic_rules_parameters.go | 164 - .../get_all_traffic_rules_responses.go | 181 - client/traffic_rules/traffic_rules_client.go | 125 - .../update_traffic_rules_parameters.go | 185 - .../update_traffic_rules_responses.go | 219 - client/veeam_vbr_client.go | 207 - go.mod | 11 - go.sum | 308 - models/active_full_settings_model.go | 160 - models/advanced_smtp_options_model.go | 142 - ...advanced_storage_schedule_monthly_model.go | 207 - .../advanced_storage_schedule_weekly_model.go | 128 - .../archive_tier_advanced_settings_model.go | 53 - models/archive_tier_model.go | 141 - models/authorization_code_model.go | 71 - ...plication_aware_processing_import_model.go | 130 - ...ckup_application_aware_processing_model.go | 130 - ...ackup_application_settings_import_model.go | 360 - models/backup_application_settings_model.go | 360 - models/backup_f_s_exclusions_model.go | 110 - models/backup_health_check_settings_models.go | 160 - models/backup_indexing_settings_model.go | 187 - models/backup_job_advanced_settings_model.go | 485 - ...up_job_advanced_settings_v_sphere_model.go | 103 - models/backup_job_exclusions.go | 207 - models/backup_job_exclusions_spec.go | 207 - models/backup_job_exclusions_templates.go | 53 - ...ackup_job_guest_processing_import_model.go | 231 - models/backup_job_guest_processing_model.go | 231 - models/backup_job_import_proxies_model.go | 130 - models/backup_job_model.go | 340 - ...kup_job_retention_policy_settings_model.go | 124 - models/backup_job_spec.go | 340 - models/backup_job_storage_import_model.go | 275 - models/backup_job_storage_model.go | 253 - models/backup_job_virtual_machines_model.go | 157 - models/backup_job_virtual_machines_spec.go | 157 - models/backup_linux_script_model.go | 53 - ...ackup_log_shipping_servers_import_model.go | 74 - models/backup_log_shipping_servers_model.go | 95 - models/backup_model.go | 235 - models/backup_object_indexing_model.go | 110 - models/backup_object_model.go | 158 - models/backup_objects_filters.go | 173 - models/backup_objects_result.go | 159 - models/backup_oracle_settings_import_model.go | 261 - models/backup_oracle_settings_model.go | 239 - models/backup_placement_settings_model.go | 124 - models/backup_proxies_settings_model.go | 100 - models/backup_proxy_import_model.go | 127 - models/backup_repository_import_model.go | 74 - models/backup_schedule_model.go | 370 - models/backup_script_settings_model.go | 191 - models/backup_sql_settings_import_model.go | 193 - models/backup_sql_settings_model.go | 193 - models/backup_storage_setting_model.go | 185 - ...ackup_storage_settings_encryption_model.go | 94 - models/backup_window_day_hours_model.go | 127 - models/backup_window_setting_model.go | 115 - models/backup_windows_script_model.go | 53 - models/backups_filters.go | 192 - models/backups_result.go | 159 - models/capacity_tier_model.go | 217 - models/capacity_tier_override_policy_model.go | 53 - models/certificate_model.go | 217 - models/config_backup_encryption_model.go | 93 - models/config_backup_last_successful_model.go | 94 - models/config_backup_model.go | 291 - models/config_backup_notifications_model.go | 118 - models/config_backup_schedule_model.go | 160 - models/config_backup_smtp_settigs_model.go | 210 - models/connection_certificate_model.go | 103 - models/credentials_export_spec.go | 162 - models/credentials_filters.go | 108 - models/credentials_import_model.go | 74 - models/credentials_import_spec.go | 189 - models/credentials_import_spec_collection.go | 120 - ...credentials_linux_settings_import_model.go | 68 - models/credentials_model.go | 185 - models/credentials_password_change_spec.go | 71 - models/credentials_result.go | 159 - models/credentials_spec.go | 130 - models/delete_repository_filters.go | 50 - models/e_allowed_backups_type.go | 77 - models/e_application_settings_v_s_s.go | 77 - models/e_backup_exclusion_policy.go | 77 - models/e_backup_mode_type.go | 83 - .../e_backup_objects_filters_order_column.go | 80 - models/e_backup_oracle_logs_settings.go | 77 - models/e_backup_proxy_import_type.go | 71 - models/e_backup_proxy_transport_mode.go | 80 - models/e_backup_script_processing_mode.go | 77 - models/e_backups_filters_order_column.go | 83 - models/e_compression_level.go | 86 - models/e_config_backup_smtp_settings_type.go | 74 - models/e_credentials_filters_order_column.go | 74 - models/e_credentials_type.go | 74 - models/e_daily_kinds.go | 77 - models/e_day_number_in_month.go | 86 - models/e_day_of_week.go | 89 - models/e_disk_info_process_state.go | 80 - models/e_disk_info_type.go | 86 - models/e_email_notification_type.go | 75 - ...cryption_passwords_filters_order_column.go | 74 - models/e_guest_f_s_indexing_mode.go | 80 - models/e_guest_o_s_type.go | 74 - models/e_hierarchy_type.go | 83 - models/e_instant_recovery_mount_state.go | 80 - models/e_job_filters_order_column.go | 77 - models/e_job_states_filters_order_column.go | 95 - models/e_job_status.go | 77 - models/e_job_type.go | 71 - models/e_job_workload.go | 86 - models/e_login_grant_type.go | 83 - models/e_managed_server_type.go | 77 - .../e_managed_servers_filters_order_column.go | 77 - models/e_month.go | 104 - models/e_object_restore_point_operation.go | 71 - ...ect_restore_points_filters_order_column.go | 77 - models/e_periodically_kinds.go | 80 - models/e_placement_policy_type.go | 74 - models/e_platform.go | 110 - models/e_platform_type.go | 92 - models/e_proxies_filters_order_column.go | 77 - models/e_proxy_type.go | 71 - models/e_repository_extent_status_type.go | 83 - models/e_repository_filters_order_column.go | 83 - ..._repository_states_filters_order_column.go | 92 - models/e_repository_type.go | 101 - models/e_retain_log_backups_type.go | 74 - models/e_retention_policy_type.go | 74 - ...ale_out_repository_filters_order_column.go | 83 - models/e_script_periodicity_type.go | 74 - models/e_sennight_of_month.go | 86 - models/e_services_filters_order_column.go | 74 - models/e_session_result.go | 80 - models/e_session_state.go | 101 - models/e_session_type.go | 89 - models/e_sessions_filters_order_column.go | 86 - models/e_speed_unit.go | 77 - models/e_sql_logs_processing.go | 80 - models/e_storage_optimization.go | 83 - models/e_task_log_record_status.go | 80 - models/e_transaction_logs_settings.go | 80 - models/e_vi_host_type.go | 77 - models/e_vi_root_filters_order_column.go | 74 - models/e_vmware_disks_type_to_process.go | 77 - models/e_vmware_inventory_type.go | 119 - models/e_windows_host_component_type.go | 134 - models/email_custom_notification_type.go | 63 - models/email_notification_settings_model.go | 176 - models/empty_success_response.go | 11 - models/encryption_password_export_spec.go | 143 - models/encryption_password_import_spec.go | 91 - ...ryption_password_import_spec_collection.go | 118 - models/encryption_password_model.go | 116 - models/encryption_password_spec.go | 91 - models/encryption_passwords_filters.go | 105 - models/encryption_passwords_result.go | 159 - models/error.go | 151 - ..._centers_inventory_filters_order_column.go | 77 - ...aintenance_defragment_and_compact_model.go | 160 - models/full_backup_maintenance_model.go | 142 - ...ll_backup_maintenance_remove_data_model.go | 74 - models/g_f_s_policy_settings_model.go | 202 - models/g_f_s_policy_settings_monthly_model.go | 117 - models/g_f_s_policy_settings_weekly_model.go | 117 - models/g_f_s_policy_settings_yearly_model.go | 117 - ...neral_options_email_notifications_model.go | 285 - models/general_options_model.go | 142 - models/general_options_notifications_model.go | 190 - models/global_network_traffic_rules_model.go | 175 - models/guest_file_system_indexing_model.go | 130 - ...teraction_proxies_settings_import_model.go | 91 - ...uest_interaction_proxies_settings_model.go | 100 - models/guest_os_credentials_import_model.go | 160 - models/guest_os_credentials_model.go | 188 - ...os_credentials_per_machine_import_model.go | 187 - .../guest_os_credentials_per_machine_model.go | 143 - models/host_connection_spec.go | 149 - models/job_export_spec.go | 123 - models/job_import_spec.go | 334 - models/job_import_spec_collection.go | 120 - models/job_model.go | 180 - models/job_scripts_settings_model.go | 236 - models/job_spec.go | 141 - models/job_start_spec.go | 74 - models/job_state_model.go | 407 - models/job_states_filters.go | 347 - models/job_states_result.go | 159 - models/job_stop_spec.go | 71 - models/jobs_filters.go | 146 - models/jobs_result.go | 159 - models/linux_credentials_model.go | 183 - models/linux_credentials_spec.go | 194 - models/linux_host_import_spec.go | 244 - models/linux_host_model.go | 157 - models/linux_host_spec.go | 183 - models/linux_host_ssh_settings_model.go | 62 - .../linux_local_repository_settings_model.go | 119 - models/linux_local_storage_import_spec.go | 263 - models/linux_local_storage_model.go | 241 - models/linux_local_storage_spec.go | 241 - models/manage_server_export_spec.go | 159 - .../manage_server_import_spec_collection.go | 234 - models/managed_server_model.go | 185 - models/managed_server_spec.go | 163 - models/managed_servers_filters.go | 184 - models/managed_servers_result.go | 159 - models/mount_server_settings_import_spec.go | 152 - models/mount_server_settings_model.go | 157 - models/network_repository_settings_model.go | 106 - models/nfs_repository_share_settings_model.go | 118 - models/nfs_repository_share_settings_spec.go | 118 - models/nfs_storage_import_spec.go | 290 - models/nfs_storage_model.go | 263 - models/nfs_storage_spec.go | 263 - models/notification_settings_model.go | 145 - ...otification_vm_attribute_settings_model.go | 77 - models/object_restore_point_disk_model.go | 206 - models/object_restore_point_disks_result.go | 159 - models/object_restore_point_model.go | 261 - models/object_restore_points_filters.go | 247 - models/object_restore_points_result.go | 159 - models/pagination_result.go | 94 - models/performance_extent_model.go | 146 - ...erformance_tier_advanced_settings_model.go | 53 - models/performance_tier_model.go | 154 - models/placement_policy_model.go | 163 - models/preferred_network_model.go | 56 - models/preferred_networks_model.go | 130 - ...mary_storage_integration_settings_model.go | 80 - models/private_key_change_spec.go | 74 - models/proxies_filters.go | 167 - models/proxies_result.go | 159 - models/proxy_datastore_model.go | 103 - models/proxy_datastore_settings_model.go | 130 - models/proxy_export_spec.go | 159 - models/proxy_import_spec.go | 168 - models/proxy_import_spec_collection.go | 120 - models/proxy_model.go | 163 - models/proxy_server_settings_import_spec.go | 169 - models/proxy_server_settings_model.go | 172 - models/proxy_spec.go | 124 - models/repositories_filters.go | 173 - models/repositories_result.go | 159 - models/repository_advanced_settings_model.go | 59 - models/repository_export_spec.go | 159 - models/repository_import_spec_collection.go | 292 - models/repository_model.go | 166 - .../repository_share_gateway_import_spec.go | 53 - models/repository_share_gateway_model.go | 77 - models/repository_spec.go | 144 - models/repository_state_model.go | 240 - models/repository_states_filters.go | 176 - models/repository_states_result.go | 159 - models/scale_out_extent_maintenance_spec.go | 80 - models/scale_out_repositories_filters.go | 108 - models/scale_out_repositories_result.go | 159 - models/scale_out_repository_model.go | 302 - models/schedule_after_this_job_model.go | 74 - models/schedule_backup_window_model.go | 118 - models/schedule_daily_model.go | 169 - models/schedule_monthly_model.go | 210 - models/schedule_periodically_model.go | 159 - models/schedule_retry_model.go | 56 - models/script_command.go | 74 - models/server_time_model.go | 79 - models/services_filters.go | 108 - models/services_model.go | 88 - models/services_result.go | 159 - models/session_log_record_model.go | 146 - models/session_log_result.go | 115 - models/session_model.go | 363 - models/session_result_model.go | 113 - models/sessions_filters.go | 323 - models/sessions_result.go | 159 - models/smb_repository_share_settings_model.go | 140 - models/smb_repository_share_settings_spec.go | 162 - models/smb_storage_import_spec.go | 290 - models/smb_storage_model.go | 263 - models/smb_storage_spec.go | 263 - models/standard_credentials_model.go | 117 - models/standard_credentials_spec.go | 117 - models/synthetic_full_settings_model.go | 128 - models/token_login_spec.go | 139 - models/token_model.go | 166 - models/traffic_rule_model.go | 256 - models/v_center_inventory_filters.go | 190 - models/v_center_inventory_result.go | 159 - models/v_power_n_f_s_port_settings_model.go | 53 - ...e_changed_block_tracking_settings_model.go | 77 - models/vi_backup_object_model.go | 176 - models/vi_host_import_spec.go | 240 - models/vi_host_model.go | 179 - models/vi_host_spec.go | 129 - models/vi_proxy_model.go | 159 - models/vi_proxy_spec.go | 159 - models/vi_root_filters.go | 108 - models/vi_roots_result.go | 159 - models/vmb_api_filter_model.go | 127 - .../vmware_fcd_instant_recovery_disk_info.go | 122 - .../vmware_fcd_instant_recovery_disk_spec.go | 105 - models/vmware_fcd_instant_recovery_mount.go | 252 - models/vmware_fcd_instant_recovery_spec.go | 203 - models/vmware_fcd_quick_migration_spec.go | 111 - models/vmware_fcd_write_cache_spec.go | 160 - models/vmware_object_disk_model.go | 171 - models/vmware_object_model.go | 144 - models/vmware_object_size_model.go | 106 - models/windows_host_component_port_model.go | 124 - models/windows_host_import_spec.go | 225 - models/windows_host_model.go | 157 - models/windows_host_ports_model.go | 121 - models/windows_host_spec.go | 157 - ...windows_local_repository_settings_model.go | 109 - models/windows_local_storage_import_spec.go | 263 - models/windows_local_storage_model.go | 241 - models/windows_local_storage_spec.go | 241 - swagger.json | 13690 ++++++++++++++++ swagger.yml | 12313 -------------- .../github.com/PuerkitoBio/purell/.gitignore | 5 - .../github.com/PuerkitoBio/purell/.travis.yml | 12 - vendor/github.com/PuerkitoBio/purell/LICENSE | 12 - .../github.com/PuerkitoBio/purell/README.md | 188 - .../github.com/PuerkitoBio/purell/purell.go | 379 - .../github.com/PuerkitoBio/urlesc/.travis.yml | 15 - vendor/github.com/PuerkitoBio/urlesc/LICENSE | 27 - .../github.com/PuerkitoBio/urlesc/README.md | 16 - .../github.com/PuerkitoBio/urlesc/urlesc.go | 180 - .../asaskevich/govalidator/.gitignore | 15 - .../asaskevich/govalidator/.travis.yml | 12 - .../asaskevich/govalidator/CODE_OF_CONDUCT.md | 43 - .../asaskevich/govalidator/CONTRIBUTING.md | 63 - .../github.com/asaskevich/govalidator/LICENSE | 21 - .../asaskevich/govalidator/README.md | 619 - .../asaskevich/govalidator/arrays.go | 87 - .../asaskevich/govalidator/converter.go | 81 - .../github.com/asaskevich/govalidator/doc.go | 3 - .../asaskevich/govalidator/error.go | 47 - .../github.com/asaskevich/govalidator/go.mod | 3 - .../asaskevich/govalidator/numerics.go | 100 - .../asaskevich/govalidator/patterns.go | 107 - .../asaskevich/govalidator/types.go | 655 - .../asaskevich/govalidator/utils.go | 270 - .../asaskevich/govalidator/validator.go | 1627 -- .../asaskevich/govalidator/wercker.yml | 15 - .../go-openapi/analysis/.codecov.yml | 5 - .../github.com/go-openapi/analysis/.gitignore | 5 - .../go-openapi/analysis/.golangci.yml | 49 - .../go-openapi/analysis/.travis.yml | 17 - .../go-openapi/analysis/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/analysis/LICENSE | 202 - .../github.com/go-openapi/analysis/README.md | 32 - .../go-openapi/analysis/analyzer.go | 978 -- .../go-openapi/analysis/appveyor.yml | 32 - .../github.com/go-openapi/analysis/debug.go | 47 - vendor/github.com/go-openapi/analysis/doc.go | 43 - .../github.com/go-openapi/analysis/fixer.go | 76 - .../github.com/go-openapi/analysis/flatten.go | 1773 -- vendor/github.com/go-openapi/analysis/go.mod | 12 - vendor/github.com/go-openapi/analysis/go.sum | 344 - .../go-openapi/analysis/internal/post_go18.go | 29 - .../go-openapi/analysis/internal/pre_go18.go | 29 - .../github.com/go-openapi/analysis/mixin.go | 431 - .../github.com/go-openapi/analysis/schema.go | 234 - .../github.com/go-openapi/errors/.gitignore | 2 - .../go-openapi/errors/.golangci.yml | 43 - .../github.com/go-openapi/errors/.travis.yml | 30 - .../go-openapi/errors/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/errors/LICENSE | 202 - vendor/github.com/go-openapi/errors/README.md | 11 - vendor/github.com/go-openapi/errors/api.go | 181 - vendor/github.com/go-openapi/errors/auth.go | 22 - vendor/github.com/go-openapi/errors/doc.go | 28 - vendor/github.com/go-openapi/errors/go.mod | 12 - vendor/github.com/go-openapi/errors/go.sum | 26 - .../github.com/go-openapi/errors/headers.go | 98 - .../go-openapi/errors/middleware.go | 51 - .../github.com/go-openapi/errors/parsing.go | 78 - vendor/github.com/go-openapi/errors/schema.go | 598 - .../go-openapi/jsonpointer/.editorconfig | 26 - .../go-openapi/jsonpointer/.gitignore | 1 - .../go-openapi/jsonpointer/.travis.yml | 15 - .../go-openapi/jsonpointer/CODE_OF_CONDUCT.md | 74 - .../github.com/go-openapi/jsonpointer/LICENSE | 202 - .../go-openapi/jsonpointer/README.md | 15 - .../github.com/go-openapi/jsonpointer/go.mod | 9 - .../github.com/go-openapi/jsonpointer/go.sum | 24 - .../go-openapi/jsonpointer/pointer.go | 390 - .../go-openapi/jsonreference/.gitignore | 1 - .../go-openapi/jsonreference/.golangci.yml | 41 - .../go-openapi/jsonreference/.travis.yml | 24 - .../jsonreference/CODE_OF_CONDUCT.md | 74 - .../go-openapi/jsonreference/LICENSE | 202 - .../go-openapi/jsonreference/README.md | 15 - .../go-openapi/jsonreference/go.mod | 12 - .../go-openapi/jsonreference/go.sum | 38 - .../go-openapi/jsonreference/reference.go | 156 - .../github.com/go-openapi/loads/.editorconfig | 26 - vendor/github.com/go-openapi/loads/.gitignore | 4 - .../github.com/go-openapi/loads/.golangci.yml | 44 - .../github.com/go-openapi/loads/.travis.yml | 22 - .../go-openapi/loads/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/loads/LICENSE | 202 - vendor/github.com/go-openapi/loads/README.md | 6 - vendor/github.com/go-openapi/loads/doc.go | 21 - vendor/github.com/go-openapi/loads/go.mod | 17 - vendor/github.com/go-openapi/loads/go.sum | 343 - vendor/github.com/go-openapi/loads/loaders.go | 134 - vendor/github.com/go-openapi/loads/options.go | 61 - vendor/github.com/go-openapi/loads/spec.go | 266 - .../go-openapi/runtime/.editorconfig | 26 - .../go-openapi/runtime/.gitattributes | 1 - .../github.com/go-openapi/runtime/.gitignore | 5 - .../go-openapi/runtime/.golangci.yml | 43 - .../github.com/go-openapi/runtime/.travis.yml | 21 - .../go-openapi/runtime/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/runtime/LICENSE | 202 - .../github.com/go-openapi/runtime/README.md | 7 - .../go-openapi/runtime/bytestream.go | 155 - .../go-openapi/runtime/client/auth_info.go | 77 - .../go-openapi/runtime/client/keepalive.go | 53 - .../go-openapi/runtime/client/opentracing.go | 98 - .../go-openapi/runtime/client/request.go | 431 - .../go-openapi/runtime/client/response.go | 44 - .../go-openapi/runtime/client/runtime.go | 497 - .../go-openapi/runtime/client_auth_info.go | 30 - .../go-openapi/runtime/client_operation.go | 41 - .../go-openapi/runtime/client_request.go | 153 - .../go-openapi/runtime/client_response.go | 70 - .../go-openapi/runtime/constants.go | 47 - vendor/github.com/go-openapi/runtime/csv.go | 77 - .../github.com/go-openapi/runtime/discard.go | 9 - vendor/github.com/go-openapi/runtime/file.go | 33 - vendor/github.com/go-openapi/runtime/go.mod | 18 - vendor/github.com/go-openapi/runtime/go.sum | 270 - .../github.com/go-openapi/runtime/headers.go | 45 - .../go-openapi/runtime/interfaces.go | 112 - vendor/github.com/go-openapi/runtime/json.go | 38 - .../go-openapi/runtime/logger/logger.go | 20 - .../go-openapi/runtime/logger/standard.go | 22 - .../go-openapi/runtime/middleware/context.go | 622 - .../runtime/middleware/denco/LICENSE | 19 - .../runtime/middleware/denco/README.md | 180 - .../runtime/middleware/denco/router.go | 460 - .../runtime/middleware/denco/server.go | 106 - .../runtime/middleware/denco/util.go | 12 - .../go-openapi/runtime/middleware/doc.go | 62 - .../go-openapi/runtime/middleware/go18.go | 9 - .../runtime/middleware/header/header.go | 326 - .../runtime/middleware/negotiate.go | 98 - .../runtime/middleware/not_implemented.go | 67 - .../runtime/middleware/operation.go | 30 - .../runtime/middleware/parameter.go | 481 - .../go-openapi/runtime/middleware/pre_go18.go | 9 - .../go-openapi/runtime/middleware/rapidoc.go | 90 - .../go-openapi/runtime/middleware/redoc.go | 103 - .../go-openapi/runtime/middleware/request.go | 104 - .../go-openapi/runtime/middleware/router.go | 488 - .../go-openapi/runtime/middleware/security.go | 39 - .../go-openapi/runtime/middleware/spec.go | 48 - .../runtime/middleware/swaggerui.go | 162 - .../runtime/middleware/untyped/api.go | 286 - .../runtime/middleware/validation.go | 126 - .../github.com/go-openapi/runtime/request.go | 139 - .../runtime/security/authenticator.go | 276 - .../go-openapi/runtime/security/authorizer.go | 27 - .../github.com/go-openapi/runtime/statuses.go | 90 - vendor/github.com/go-openapi/runtime/text.go | 117 - .../github.com/go-openapi/runtime/values.go | 19 - vendor/github.com/go-openapi/runtime/xml.go | 36 - .../go-openapi/runtime/yamlpc/yaml.go | 40 - .../github.com/go-openapi/spec/.editorconfig | 26 - vendor/github.com/go-openapi/spec/.gitignore | 2 - .../github.com/go-openapi/spec/.golangci.yml | 42 - vendor/github.com/go-openapi/spec/.travis.yml | 31 - .../go-openapi/spec/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/spec/LICENSE | 202 - vendor/github.com/go-openapi/spec/README.md | 34 - .../github.com/go-openapi/spec/appveyor.yml | 32 - vendor/github.com/go-openapi/spec/bindata.go | 297 - vendor/github.com/go-openapi/spec/cache.go | 98 - .../go-openapi/spec/contact_info.go | 57 - vendor/github.com/go-openapi/spec/debug.go | 49 - vendor/github.com/go-openapi/spec/errors.go | 19 - vendor/github.com/go-openapi/spec/expander.go | 594 - .../go-openapi/spec/external_docs.go | 24 - vendor/github.com/go-openapi/spec/go.mod | 13 - vendor/github.com/go-openapi/spec/go.sum | 65 - vendor/github.com/go-openapi/spec/header.go | 203 - vendor/github.com/go-openapi/spec/info.go | 165 - vendor/github.com/go-openapi/spec/items.go | 234 - vendor/github.com/go-openapi/spec/license.go | 56 - .../github.com/go-openapi/spec/normalizer.go | 203 - .../go-openapi/spec/normalizer_nonwindows.go | 43 - .../go-openapi/spec/normalizer_windows.go | 154 - .../github.com/go-openapi/spec/operation.go | 397 - .../github.com/go-openapi/spec/parameter.go | 326 - .../github.com/go-openapi/spec/path_item.go | 87 - vendor/github.com/go-openapi/spec/paths.go | 97 - .../github.com/go-openapi/spec/properties.go | 91 - vendor/github.com/go-openapi/spec/ref.go | 193 - vendor/github.com/go-openapi/spec/resolver.go | 127 - vendor/github.com/go-openapi/spec/response.go | 152 - .../github.com/go-openapi/spec/responses.go | 127 - vendor/github.com/go-openapi/spec/schema.go | 646 - .../go-openapi/spec/schema_loader.go | 331 - .../go-openapi/spec/security_scheme.go | 170 - vendor/github.com/go-openapi/spec/spec.go | 78 - vendor/github.com/go-openapi/spec/swagger.go | 448 - vendor/github.com/go-openapi/spec/tag.go | 75 - .../github.com/go-openapi/spec/validations.go | 215 - .../github.com/go-openapi/spec/xml_object.go | 68 - .../go-openapi/strfmt/.editorconfig | 26 - .../github.com/go-openapi/strfmt/.gitignore | 2 - .../go-openapi/strfmt/.golangci.yml | 47 - .../github.com/go-openapi/strfmt/.travis.yml | 31 - .../go-openapi/strfmt/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/strfmt/LICENSE | 202 - vendor/github.com/go-openapi/strfmt/README.md | 88 - vendor/github.com/go-openapi/strfmt/bson.go | 165 - vendor/github.com/go-openapi/strfmt/date.go | 187 - .../github.com/go-openapi/strfmt/default.go | 2035 --- vendor/github.com/go-openapi/strfmt/doc.go | 18 - .../github.com/go-openapi/strfmt/duration.go | 211 - vendor/github.com/go-openapi/strfmt/format.go | 320 - vendor/github.com/go-openapi/strfmt/go.mod | 13 - vendor/github.com/go-openapi/strfmt/go.sum | 134 - vendor/github.com/go-openapi/strfmt/time.go | 281 - vendor/github.com/go-openapi/strfmt/ulid.go | 221 - .../github.com/go-openapi/swag/.editorconfig | 26 - vendor/github.com/go-openapi/swag/.gitignore | 4 - .../github.com/go-openapi/swag/.golangci.yml | 41 - vendor/github.com/go-openapi/swag/.travis.yml | 37 - .../go-openapi/swag/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/swag/LICENSE | 202 - vendor/github.com/go-openapi/swag/README.md | 21 - vendor/github.com/go-openapi/swag/convert.go | 208 - .../go-openapi/swag/convert_types.go | 730 - vendor/github.com/go-openapi/swag/doc.go | 32 - vendor/github.com/go-openapi/swag/go.mod | 18 - vendor/github.com/go-openapi/swag/go.sum | 29 - vendor/github.com/go-openapi/swag/json.go | 312 - vendor/github.com/go-openapi/swag/loading.go | 120 - .../github.com/go-openapi/swag/name_lexem.go | 87 - vendor/github.com/go-openapi/swag/net.go | 38 - vendor/github.com/go-openapi/swag/path.go | 59 - .../github.com/go-openapi/swag/post_go18.go | 23 - .../github.com/go-openapi/swag/post_go19.go | 67 - vendor/github.com/go-openapi/swag/pre_go18.go | 23 - vendor/github.com/go-openapi/swag/pre_go19.go | 69 - vendor/github.com/go-openapi/swag/split.go | 262 - vendor/github.com/go-openapi/swag/util.go | 385 - vendor/github.com/go-openapi/swag/yaml.go | 246 - .../go-openapi/validate/.editorconfig | 26 - .../github.com/go-openapi/validate/.gitignore | 5 - .../go-openapi/validate/.golangci.yml | 42 - .../go-openapi/validate/.travis.yml | 52 - .../go-openapi/validate/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/validate/LICENSE | 202 - .../github.com/go-openapi/validate/README.md | 38 - .../go-openapi/validate/appveyor.yml | 32 - .../github.com/go-openapi/validate/context.go | 56 - .../github.com/go-openapi/validate/debug.go | 47 - .../go-openapi/validate/default_validator.go | 281 - vendor/github.com/go-openapi/validate/doc.go | 85 - .../go-openapi/validate/example_validator.go | 270 - .../github.com/go-openapi/validate/formats.go | 69 - vendor/github.com/go-openapi/validate/go.mod | 17 - vendor/github.com/go-openapi/validate/go.sum | 333 - .../github.com/go-openapi/validate/helpers.go | 324 - .../go-openapi/validate/object_validator.go | 279 - .../github.com/go-openapi/validate/options.go | 43 - .../github.com/go-openapi/validate/result.go | 486 - vendor/github.com/go-openapi/validate/rexp.go | 71 - .../github.com/go-openapi/validate/schema.go | 260 - .../go-openapi/validate/schema_messages.go | 78 - .../go-openapi/validate/schema_option.go | 54 - .../go-openapi/validate/schema_props.go | 240 - .../go-openapi/validate/slice_validator.go | 105 - vendor/github.com/go-openapi/validate/spec.go | 795 - .../go-openapi/validate/spec_messages.go | 360 - vendor/github.com/go-openapi/validate/type.go | 178 - .../go-openapi/validate/update-fixtures.sh | 15 - .../go-openapi/validate/validator.go | 645 - .../github.com/go-openapi/validate/values.go | 446 - vendor/github.com/go-stack/stack/.travis.yml | 15 - vendor/github.com/go-stack/stack/LICENSE.md | 21 - vendor/github.com/go-stack/stack/README.md | 38 - vendor/github.com/go-stack/stack/go.mod | 1 - vendor/github.com/go-stack/stack/stack.go | 400 - vendor/github.com/josharian/intern/README.md | 5 - vendor/github.com/josharian/intern/go.mod | 3 - vendor/github.com/josharian/intern/intern.go | 44 - vendor/github.com/josharian/intern/license.md | 21 - vendor/github.com/mailru/easyjson/LICENSE | 7 - .../github.com/mailru/easyjson/buffer/pool.go | 278 - .../mailru/easyjson/jlexer/bytestostr.go | 24 - .../easyjson/jlexer/bytestostr_nounsafe.go | 13 - .../mailru/easyjson/jlexer/error.go | 15 - .../mailru/easyjson/jlexer/lexer.go | 1230 -- .../mailru/easyjson/jwriter/writer.go | 405 - .../mitchellh/mapstructure/CHANGELOG.md | 73 - .../github.com/mitchellh/mapstructure/LICENSE | 21 - .../mitchellh/mapstructure/README.md | 46 - .../mitchellh/mapstructure/decode_hooks.go | 256 - .../mitchellh/mapstructure/error.go | 50 - .../github.com/mitchellh/mapstructure/go.mod | 3 - .../mitchellh/mapstructure/mapstructure.go | 1462 -- vendor/github.com/oklog/ulid/.gitignore | 29 - vendor/github.com/oklog/ulid/.travis.yml | 16 - vendor/github.com/oklog/ulid/AUTHORS.md | 2 - vendor/github.com/oklog/ulid/CHANGELOG.md | 33 - vendor/github.com/oklog/ulid/CONTRIBUTING.md | 17 - vendor/github.com/oklog/ulid/Gopkg.lock | 15 - vendor/github.com/oklog/ulid/Gopkg.toml | 26 - vendor/github.com/oklog/ulid/LICENSE | 201 - vendor/github.com/oklog/ulid/README.md | 150 - vendor/github.com/oklog/ulid/ulid.go | 614 - .../opentracing/opentracing-go/.gitignore | 1 - .../opentracing/opentracing-go/.travis.yml | 20 - .../opentracing/opentracing-go/CHANGELOG.md | 63 - .../opentracing/opentracing-go/LICENSE | 201 - .../opentracing/opentracing-go/Makefile | 20 - .../opentracing/opentracing-go/README.md | 171 - .../opentracing/opentracing-go/ext.go | 24 - .../opentracing/opentracing-go/ext/field.go | 17 - .../opentracing/opentracing-go/ext/tags.go | 215 - .../opentracing-go/globaltracer.go | 42 - .../opentracing/opentracing-go/go.mod | 5 - .../opentracing/opentracing-go/go.sum | 7 - .../opentracing/opentracing-go/gocontext.go | 65 - .../opentracing/opentracing-go/log/field.go | 282 - .../opentracing/opentracing-go/log/util.go | 61 - .../opentracing/opentracing-go/noop.go | 64 - .../opentracing/opentracing-go/propagation.go | 176 - .../opentracing/opentracing-go/span.go | 189 - .../opentracing/opentracing-go/tracer.go | 304 - vendor/go.mongodb.org/mongo-driver/LICENSE | 201 - .../go.mongodb.org/mongo-driver/bson/bson.go | 50 - .../mongo-driver/bson/bson_1_8.go | 81 - .../bson/bsoncodec/array_codec.go | 50 - .../mongo-driver/bson/bsoncodec/bsoncodec.go | 216 - .../bson/bsoncodec/byte_slice_codec.go | 111 - .../bson/bsoncodec/cond_addr_codec.go | 63 - .../bson/bsoncodec/default_value_decoders.go | 1717 -- .../bson/bsoncodec/default_value_encoders.go | 773 - .../mongo-driver/bson/bsoncodec/doc.go | 84 - .../bson/bsoncodec/empty_interface_codec.go | 140 - .../mongo-driver/bson/bsoncodec/map_codec.go | 297 - .../mongo-driver/bson/bsoncodec/mode.go | 65 - .../bson/bsoncodec/pointer_codec.go | 109 - .../mongo-driver/bson/bsoncodec/proxy.go | 14 - .../mongo-driver/bson/bsoncodec/registry.go | 474 - .../bson/bsoncodec/slice_codec.go | 199 - .../bson/bsoncodec/string_codec.go | 119 - .../bson/bsoncodec/struct_codec.go | 671 - .../bson/bsoncodec/struct_tag_parser.go | 139 - .../mongo-driver/bson/bsoncodec/time_codec.go | 127 - .../mongo-driver/bson/bsoncodec/types.go | 82 - .../mongo-driver/bson/bsoncodec/uint_codec.go | 173 - .../bsonoptions/byte_slice_codec_options.go | 38 - .../empty_interface_codec_options.go | 38 - .../bson/bsonoptions/map_codec_options.go | 67 - .../bson/bsonoptions/slice_codec_options.go | 38 - .../bson/bsonoptions/string_codec_options.go | 41 - .../bson/bsonoptions/struct_codec_options.go | 87 - .../bson/bsonoptions/time_codec_options.go | 38 - .../bson/bsonoptions/uint_codec_options.go | 38 - .../mongo-driver/bson/bsonrw/copier.go | 445 - .../mongo-driver/bson/bsonrw/doc.go | 9 - .../bson/bsonrw/extjson_parser.go | 806 - .../bson/bsonrw/extjson_reader.go | 627 - .../bson/bsonrw/extjson_tables.go | 223 - .../bson/bsonrw/extjson_wrappers.go | 498 - .../bson/bsonrw/extjson_writer.go | 737 - .../mongo-driver/bson/bsonrw/json_scanner.go | 439 - .../mongo-driver/bson/bsonrw/mode.go | 108 - .../mongo-driver/bson/bsonrw/reader.go | 63 - .../mongo-driver/bson/bsonrw/value_reader.go | 877 - .../mongo-driver/bson/bsonrw/value_writer.go | 617 - .../mongo-driver/bson/bsonrw/writer.go | 102 - .../mongo-driver/bson/bsontype/bsontype.go | 95 - .../mongo-driver/bson/decoder.go | 118 - .../go.mongodb.org/mongo-driver/bson/doc.go | 136 - .../mongo-driver/bson/encoder.go | 99 - .../mongo-driver/bson/marshal.go | 223 - .../mongo-driver/bson/primitive/decimal.go | 425 - .../mongo-driver/bson/primitive/objectid.go | 184 - .../mongo-driver/bson/primitive/primitive.go | 217 - .../mongo-driver/bson/primitive_codecs.go | 111 - .../go.mongodb.org/mongo-driver/bson/raw.go | 92 - .../mongo-driver/bson/raw_element.go | 51 - .../mongo-driver/bson/raw_value.go | 309 - .../mongo-driver/bson/registry.go | 24 - .../go.mongodb.org/mongo-driver/bson/types.go | 85 - .../mongo-driver/bson/unmarshal.go | 101 - .../mongo-driver/x/bsonx/bsoncore/array.go | 164 - .../x/bsonx/bsoncore/bson_arraybuilder.go | 201 - .../x/bsonx/bsoncore/bson_documentbuilder.go | 189 - .../mongo-driver/x/bsonx/bsoncore/bsoncore.go | 862 - .../mongo-driver/x/bsonx/bsoncore/document.go | 409 - .../x/bsonx/bsoncore/document_sequence.go | 183 - .../mongo-driver/x/bsonx/bsoncore/element.go | 152 - .../mongo-driver/x/bsonx/bsoncore/tables.go | 223 - .../mongo-driver/x/bsonx/bsoncore/value.go | 1015 -- vendor/golang.org/x/net/AUTHORS | 3 - vendor/golang.org/x/net/CONTRIBUTORS | 3 - vendor/golang.org/x/net/LICENSE | 27 - vendor/golang.org/x/net/PATENTS | 22 - vendor/golang.org/x/net/idna/idna10.0.0.go | 734 - vendor/golang.org/x/net/idna/idna9.0.0.go | 682 - vendor/golang.org/x/net/idna/punycode.go | 203 - vendor/golang.org/x/net/idna/tables10.0.0.go | 4559 ----- vendor/golang.org/x/net/idna/tables11.0.0.go | 4653 ------ vendor/golang.org/x/net/idna/tables12.0.0.go | 4733 ------ vendor/golang.org/x/net/idna/tables13.0.0.go | 4839 ------ vendor/golang.org/x/net/idna/tables9.0.0.go | 4486 ----- vendor/golang.org/x/net/idna/trie.go | 72 - vendor/golang.org/x/net/idna/trieval.go | 119 - vendor/golang.org/x/text/AUTHORS | 3 - vendor/golang.org/x/text/CONTRIBUTORS | 3 - vendor/golang.org/x/text/LICENSE | 27 - vendor/golang.org/x/text/PATENTS | 22 - .../x/text/secure/bidirule/bidirule.go | 336 - .../x/text/secure/bidirule/bidirule10.0.0.go | 11 - .../x/text/secure/bidirule/bidirule9.0.0.go | 14 - .../golang.org/x/text/transform/transform.go | 709 - vendor/golang.org/x/text/unicode/bidi/bidi.go | 359 - .../golang.org/x/text/unicode/bidi/bracket.go | 335 - vendor/golang.org/x/text/unicode/bidi/core.go | 1071 -- vendor/golang.org/x/text/unicode/bidi/prop.go | 206 - .../x/text/unicode/bidi/tables10.0.0.go | 1815 -- .../x/text/unicode/bidi/tables11.0.0.go | 1887 --- .../x/text/unicode/bidi/tables12.0.0.go | 1923 --- .../x/text/unicode/bidi/tables13.0.0.go | 1955 --- .../x/text/unicode/bidi/tables9.0.0.go | 1781 -- .../golang.org/x/text/unicode/bidi/trieval.go | 60 - .../x/text/unicode/norm/composition.go | 512 - .../x/text/unicode/norm/forminfo.go | 278 - .../golang.org/x/text/unicode/norm/input.go | 109 - vendor/golang.org/x/text/unicode/norm/iter.go | 458 - .../x/text/unicode/norm/normalize.go | 609 - .../x/text/unicode/norm/readwriter.go | 125 - .../x/text/unicode/norm/tables10.0.0.go | 7657 --------- .../x/text/unicode/norm/tables11.0.0.go | 7693 --------- .../x/text/unicode/norm/tables12.0.0.go | 7710 --------- .../x/text/unicode/norm/tables13.0.0.go | 7760 --------- .../x/text/unicode/norm/tables9.0.0.go | 7637 --------- .../x/text/unicode/norm/transform.go | 88 - vendor/golang.org/x/text/unicode/norm/trie.go | 54 - vendor/golang.org/x/text/width/kind_string.go | 28 - .../golang.org/x/text/width/tables10.0.0.go | 1318 -- .../golang.org/x/text/width/tables11.0.0.go | 1330 -- .../golang.org/x/text/width/tables12.0.0.go | 1350 -- .../golang.org/x/text/width/tables13.0.0.go | 1351 -- vendor/golang.org/x/text/width/tables9.0.0.go | 1286 -- vendor/golang.org/x/text/width/transform.go | 239 - vendor/golang.org/x/text/width/trieval.go | 30 - vendor/golang.org/x/text/width/width.go | 206 - vendor/gopkg.in/yaml.v2/.travis.yml | 17 - vendor/gopkg.in/yaml.v2/LICENSE | 201 - vendor/gopkg.in/yaml.v2/LICENSE.libyaml | 31 - vendor/gopkg.in/yaml.v2/NOTICE | 13 - vendor/gopkg.in/yaml.v2/README.md | 133 - vendor/gopkg.in/yaml.v2/apic.go | 744 - vendor/gopkg.in/yaml.v2/decode.go | 815 - vendor/gopkg.in/yaml.v2/emitterc.go | 1685 -- vendor/gopkg.in/yaml.v2/encode.go | 390 - vendor/gopkg.in/yaml.v2/go.mod | 5 - vendor/gopkg.in/yaml.v2/parserc.go | 1095 -- vendor/gopkg.in/yaml.v2/readerc.go | 412 - vendor/gopkg.in/yaml.v2/resolve.go | 258 - vendor/gopkg.in/yaml.v2/scannerc.go | 2711 --- vendor/gopkg.in/yaml.v2/sorter.go | 113 - vendor/gopkg.in/yaml.v2/writerc.go | 26 - vendor/gopkg.in/yaml.v2/yaml.go | 478 - vendor/gopkg.in/yaml.v2/yamlh.go | 739 - vendor/gopkg.in/yaml.v2/yamlprivateh.go | 173 - vendor/modules.txt | 74 - 980 files changed, 13690 insertions(+), 265027 deletions(-) delete mode 100644 client/automation/automation_client.go delete mode 100644 client/automation/export_credentials_parameters.go delete mode 100644 client/automation/export_credentials_responses.go delete mode 100644 client/automation/export_encryption_passwords_parameters.go delete mode 100644 client/automation/export_encryption_passwords_responses.go delete mode 100644 client/automation/export_jobs_parameters.go delete mode 100644 client/automation/export_jobs_responses.go delete mode 100644 client/automation/export_managed_servers_parameters.go delete mode 100644 client/automation/export_managed_servers_responses.go delete mode 100644 client/automation/export_proxies_parameters.go delete mode 100644 client/automation/export_proxies_responses.go delete mode 100644 client/automation/export_repositories_parameters.go delete mode 100644 client/automation/export_repositories_responses.go delete mode 100644 client/automation/get_all_automation_sessions_parameters.go delete mode 100644 client/automation/get_all_automation_sessions_responses.go delete mode 100644 client/automation/get_automation_session_logs_parameters.go delete mode 100644 client/automation/get_automation_session_logs_responses.go delete mode 100644 client/automation/get_automation_session_parameters.go delete mode 100644 client/automation/get_automation_session_responses.go delete mode 100644 client/automation/import_credentials_parameters.go delete mode 100644 client/automation/import_credentials_responses.go delete mode 100644 client/automation/import_encryption_passwords_parameters.go delete mode 100644 client/automation/import_encryption_passwords_responses.go delete mode 100644 client/automation/import_jobs_parameters.go delete mode 100644 client/automation/import_jobs_responses.go delete mode 100644 client/automation/import_managed_servers_parameters.go delete mode 100644 client/automation/import_managed_servers_responses.go delete mode 100644 client/automation/import_proxies_parameters.go delete mode 100644 client/automation/import_proxies_responses.go delete mode 100644 client/automation/import_repositories_parameters.go delete mode 100644 client/automation/import_repositories_responses.go delete mode 100644 client/automation/stop_automation_session_parameters.go delete mode 100644 client/automation/stop_automation_session_responses.go delete mode 100644 client/backup_objects/backup_objects_client.go delete mode 100644 client/backup_objects/get_all_backup_objects_parameters.go delete mode 100644 client/backup_objects/get_all_backup_objects_responses.go delete mode 100644 client/backup_objects/get_backup_object_parameters.go delete mode 100644 client/backup_objects/get_backup_object_responses.go delete mode 100644 client/backup_objects/get_backup_object_restore_points_parameters.go delete mode 100644 client/backup_objects/get_backup_object_restore_points_responses.go delete mode 100644 client/backups/backups_client.go delete mode 100644 client/backups/get_all_backups_parameters.go delete mode 100644 client/backups/get_all_backups_responses.go delete mode 100644 client/backups/get_backup_objects_parameters.go delete mode 100644 client/backups/get_backup_objects_responses.go delete mode 100644 client/backups/get_backup_parameters.go delete mode 100644 client/backups/get_backup_responses.go delete mode 100644 client/configuration_backup/configuration_backup_client.go delete mode 100644 client/configuration_backup/get_config_backup_options_parameters.go delete mode 100644 client/configuration_backup/get_config_backup_options_responses.go delete mode 100644 client/configuration_backup/start_config_backup_parameters.go delete mode 100644 client/configuration_backup/start_config_backup_responses.go delete mode 100644 client/configuration_backup/update_config_backup_options_parameters.go delete mode 100644 client/configuration_backup/update_config_backup_options_responses.go delete mode 100644 client/connection/connection_client.go delete mode 100644 client/connection/get_connection_certificate_parameters.go delete mode 100644 client/connection/get_connection_certificate_responses.go delete mode 100644 client/credentials/change_password_for_creds_parameters.go delete mode 100644 client/credentials/change_password_for_creds_responses.go delete mode 100644 client/credentials/change_private_key_for_creds_parameters.go delete mode 100644 client/credentials/change_private_key_for_creds_responses.go delete mode 100644 client/credentials/change_root_password_for_creds_parameters.go delete mode 100644 client/credentials/change_root_password_for_creds_responses.go delete mode 100644 client/credentials/create_creds_parameters.go delete mode 100644 client/credentials/create_creds_responses.go delete mode 100644 client/credentials/credentials_client.go delete mode 100644 client/credentials/delete_creds_parameters.go delete mode 100644 client/credentials/delete_creds_responses.go delete mode 100644 client/credentials/get_all_creds_parameters.go delete mode 100644 client/credentials/get_all_creds_responses.go delete mode 100644 client/credentials/get_creds_parameters.go delete mode 100644 client/credentials/get_creds_responses.go delete mode 100644 client/credentials/update_creds_parameters.go delete mode 100644 client/credentials/update_creds_responses.go delete mode 100644 client/encryption/create_encryption_password_parameters.go delete mode 100644 client/encryption/create_encryption_password_responses.go delete mode 100644 client/encryption/delete_encryption_password_parameters.go delete mode 100644 client/encryption/delete_encryption_password_responses.go delete mode 100644 client/encryption/encryption_client.go delete mode 100644 client/encryption/get_all_encryption_passwords_parameters.go delete mode 100644 client/encryption/get_all_encryption_passwords_responses.go delete mode 100644 client/encryption/get_encryption_password_parameters.go delete mode 100644 client/encryption/get_encryption_password_responses.go delete mode 100644 client/encryption/update_encryption_password_parameters.go delete mode 100644 client/encryption/update_encryption_password_responses.go delete mode 100644 client/general_options/general_options_client.go delete mode 100644 client/general_options/get_general_options_parameters.go delete mode 100644 client/general_options/get_general_options_responses.go delete mode 100644 client/general_options/update_general_options_parameters.go delete mode 100644 client/general_options/update_general_options_responses.go delete mode 100644 client/inventory_browser/get_all_inventory_vmware_hosts_parameters.go delete mode 100644 client/inventory_browser/get_all_inventory_vmware_hosts_responses.go delete mode 100644 client/inventory_browser/get_vmware_host_object_parameters.go delete mode 100644 client/inventory_browser/get_vmware_host_object_responses.go delete mode 100644 client/inventory_browser/inventory_browser_client.go delete mode 100644 client/jobs/create_job_parameters.go delete mode 100644 client/jobs/create_job_responses.go delete mode 100644 client/jobs/delete_job_parameters.go delete mode 100644 client/jobs/delete_job_responses.go delete mode 100644 client/jobs/disable_job_parameters.go delete mode 100644 client/jobs/disable_job_responses.go delete mode 100644 client/jobs/enable_job_parameters.go delete mode 100644 client/jobs/enable_job_responses.go delete mode 100644 client/jobs/get_all_jobs_parameters.go delete mode 100644 client/jobs/get_all_jobs_responses.go delete mode 100644 client/jobs/get_all_jobs_states_parameters.go delete mode 100644 client/jobs/get_all_jobs_states_responses.go delete mode 100644 client/jobs/get_job_parameters.go delete mode 100644 client/jobs/get_job_responses.go delete mode 100644 client/jobs/jobs_client.go delete mode 100644 client/jobs/start_job_parameters.go delete mode 100644 client/jobs/start_job_responses.go delete mode 100644 client/jobs/stop_job_parameters.go delete mode 100644 client/jobs/stop_job_responses.go delete mode 100644 client/jobs/update_job_parameters.go delete mode 100644 client/jobs/update_job_responses.go delete mode 100644 client/login/create_authorization_code_parameters.go delete mode 100644 client/login/create_authorization_code_responses.go delete mode 100644 client/login/create_token_parameters.go delete mode 100644 client/login/create_token_responses.go delete mode 100644 client/login/login_client.go delete mode 100644 client/login/logout_parameters.go delete mode 100644 client/login/logout_responses.go delete mode 100644 client/managed_servers/create_managed_server_parameters.go delete mode 100644 client/managed_servers/create_managed_server_responses.go delete mode 100644 client/managed_servers/delete_managed_server_parameters.go delete mode 100644 client/managed_servers/delete_managed_server_responses.go delete mode 100644 client/managed_servers/get_all_managed_servers_parameters.go delete mode 100644 client/managed_servers/get_all_managed_servers_responses.go delete mode 100644 client/managed_servers/get_managed_server_parameters.go delete mode 100644 client/managed_servers/get_managed_server_responses.go delete mode 100644 client/managed_servers/managed_servers_client.go delete mode 100644 client/managed_servers/update_managed_server_parameters.go delete mode 100644 client/managed_servers/update_managed_server_responses.go delete mode 100644 client/object_restore_points/get_all_object_restore_points_parameters.go delete mode 100644 client/object_restore_points/get_all_object_restore_points_responses.go delete mode 100644 client/object_restore_points/get_object_restore_point_disks_parameters.go delete mode 100644 client/object_restore_points/get_object_restore_point_disks_responses.go delete mode 100644 client/object_restore_points/get_object_restore_point_parameters.go delete mode 100644 client/object_restore_points/get_object_restore_point_responses.go delete mode 100644 client/object_restore_points/object_restore_points_client.go delete mode 100644 client/proxies/create_proxy_parameters.go delete mode 100644 client/proxies/create_proxy_responses.go delete mode 100644 client/proxies/delete_proxy_parameters.go delete mode 100644 client/proxies/delete_proxy_responses.go delete mode 100644 client/proxies/get_all_proxies_parameters.go delete mode 100644 client/proxies/get_all_proxies_responses.go delete mode 100644 client/proxies/get_proxy_parameters.go delete mode 100644 client/proxies/get_proxy_responses.go delete mode 100644 client/proxies/proxies_client.go delete mode 100644 client/proxies/update_proxy_parameters.go delete mode 100644 client/proxies/update_proxy_responses.go delete mode 100644 client/repositories/create_repository_parameters.go delete mode 100644 client/repositories/create_repository_responses.go delete mode 100644 client/repositories/delete_repository_parameters.go delete mode 100644 client/repositories/delete_repository_responses.go delete mode 100644 client/repositories/disable_scale_out_extent_maintenance_mode_parameters.go delete mode 100644 client/repositories/disable_scale_out_extent_maintenance_mode_responses.go delete mode 100644 client/repositories/enable_scale_out_extent_maintenance_mode_parameters.go delete mode 100644 client/repositories/enable_scale_out_extent_maintenance_mode_responses.go delete mode 100644 client/repositories/get_all_repositories_parameters.go delete mode 100644 client/repositories/get_all_repositories_responses.go delete mode 100644 client/repositories/get_all_repositories_states_parameters.go delete mode 100644 client/repositories/get_all_repositories_states_responses.go delete mode 100644 client/repositories/get_all_scale_out_repositories_parameters.go delete mode 100644 client/repositories/get_all_scale_out_repositories_responses.go delete mode 100644 client/repositories/get_repository_parameters.go delete mode 100644 client/repositories/get_repository_responses.go delete mode 100644 client/repositories/get_scale_out_repository_parameters.go delete mode 100644 client/repositories/get_scale_out_repository_responses.go delete mode 100644 client/repositories/repositories_client.go delete mode 100644 client/repositories/update_repository_parameters.go delete mode 100644 client/repositories/update_repository_responses.go delete mode 100644 client/restore/get_vmware_fcd_instant_recovery_mount_model_parameters.go delete mode 100644 client/restore/get_vmware_fcd_instant_recovery_mount_model_responses.go delete mode 100644 client/restore/instant_recovery_vmware_fcd_dismount_parameters.go delete mode 100644 client/restore/instant_recovery_vmware_fcd_dismount_responses.go delete mode 100644 client/restore/instant_recovery_vmware_fcd_migrate_parameters.go delete mode 100644 client/restore/instant_recovery_vmware_fcd_migrate_responses.go delete mode 100644 client/restore/instant_recovery_vmware_fcd_mount_parameters.go delete mode 100644 client/restore/instant_recovery_vmware_fcd_mount_responses.go delete mode 100644 client/restore/restore_client.go delete mode 100644 client/service/get_server_certificate_parameters.go delete mode 100644 client/service/get_server_certificate_responses.go delete mode 100644 client/service/get_server_time_parameters.go delete mode 100644 client/service/get_server_time_responses.go delete mode 100644 client/service/service_client.go delete mode 100644 client/services/get_all_services_parameters.go delete mode 100644 client/services/get_all_services_responses.go delete mode 100644 client/services/services_client.go delete mode 100644 client/sessions/get_all_sessions_parameters.go delete mode 100644 client/sessions/get_all_sessions_responses.go delete mode 100644 client/sessions/get_session_logs_parameters.go delete mode 100644 client/sessions/get_session_logs_responses.go delete mode 100644 client/sessions/get_session_parameters.go delete mode 100644 client/sessions/get_session_responses.go delete mode 100644 client/sessions/sessions_client.go delete mode 100644 client/sessions/stop_session_parameters.go delete mode 100644 client/sessions/stop_session_responses.go delete mode 100644 client/traffic_rules/get_all_traffic_rules_parameters.go delete mode 100644 client/traffic_rules/get_all_traffic_rules_responses.go delete mode 100644 client/traffic_rules/traffic_rules_client.go delete mode 100644 client/traffic_rules/update_traffic_rules_parameters.go delete mode 100644 client/traffic_rules/update_traffic_rules_responses.go delete mode 100644 client/veeam_vbr_client.go delete mode 100644 go.mod delete mode 100644 go.sum delete mode 100644 models/active_full_settings_model.go delete mode 100644 models/advanced_smtp_options_model.go delete mode 100644 models/advanced_storage_schedule_monthly_model.go delete mode 100644 models/advanced_storage_schedule_weekly_model.go delete mode 100644 models/archive_tier_advanced_settings_model.go delete mode 100644 models/archive_tier_model.go delete mode 100644 models/authorization_code_model.go delete mode 100644 models/backup_application_aware_processing_import_model.go delete mode 100644 models/backup_application_aware_processing_model.go delete mode 100644 models/backup_application_settings_import_model.go delete mode 100644 models/backup_application_settings_model.go delete mode 100644 models/backup_f_s_exclusions_model.go delete mode 100644 models/backup_health_check_settings_models.go delete mode 100644 models/backup_indexing_settings_model.go delete mode 100644 models/backup_job_advanced_settings_model.go delete mode 100644 models/backup_job_advanced_settings_v_sphere_model.go delete mode 100644 models/backup_job_exclusions.go delete mode 100644 models/backup_job_exclusions_spec.go delete mode 100644 models/backup_job_exclusions_templates.go delete mode 100644 models/backup_job_guest_processing_import_model.go delete mode 100644 models/backup_job_guest_processing_model.go delete mode 100644 models/backup_job_import_proxies_model.go delete mode 100644 models/backup_job_model.go delete mode 100644 models/backup_job_retention_policy_settings_model.go delete mode 100644 models/backup_job_spec.go delete mode 100644 models/backup_job_storage_import_model.go delete mode 100644 models/backup_job_storage_model.go delete mode 100644 models/backup_job_virtual_machines_model.go delete mode 100644 models/backup_job_virtual_machines_spec.go delete mode 100644 models/backup_linux_script_model.go delete mode 100644 models/backup_log_shipping_servers_import_model.go delete mode 100644 models/backup_log_shipping_servers_model.go delete mode 100644 models/backup_model.go delete mode 100644 models/backup_object_indexing_model.go delete mode 100644 models/backup_object_model.go delete mode 100644 models/backup_objects_filters.go delete mode 100644 models/backup_objects_result.go delete mode 100644 models/backup_oracle_settings_import_model.go delete mode 100644 models/backup_oracle_settings_model.go delete mode 100644 models/backup_placement_settings_model.go delete mode 100644 models/backup_proxies_settings_model.go delete mode 100644 models/backup_proxy_import_model.go delete mode 100644 models/backup_repository_import_model.go delete mode 100644 models/backup_schedule_model.go delete mode 100644 models/backup_script_settings_model.go delete mode 100644 models/backup_sql_settings_import_model.go delete mode 100644 models/backup_sql_settings_model.go delete mode 100644 models/backup_storage_setting_model.go delete mode 100644 models/backup_storage_settings_encryption_model.go delete mode 100644 models/backup_window_day_hours_model.go delete mode 100644 models/backup_window_setting_model.go delete mode 100644 models/backup_windows_script_model.go delete mode 100644 models/backups_filters.go delete mode 100644 models/backups_result.go delete mode 100644 models/capacity_tier_model.go delete mode 100644 models/capacity_tier_override_policy_model.go delete mode 100644 models/certificate_model.go delete mode 100644 models/config_backup_encryption_model.go delete mode 100644 models/config_backup_last_successful_model.go delete mode 100644 models/config_backup_model.go delete mode 100644 models/config_backup_notifications_model.go delete mode 100644 models/config_backup_schedule_model.go delete mode 100644 models/config_backup_smtp_settigs_model.go delete mode 100644 models/connection_certificate_model.go delete mode 100644 models/credentials_export_spec.go delete mode 100644 models/credentials_filters.go delete mode 100644 models/credentials_import_model.go delete mode 100644 models/credentials_import_spec.go delete mode 100644 models/credentials_import_spec_collection.go delete mode 100644 models/credentials_linux_settings_import_model.go delete mode 100644 models/credentials_model.go delete mode 100644 models/credentials_password_change_spec.go delete mode 100644 models/credentials_result.go delete mode 100644 models/credentials_spec.go delete mode 100644 models/delete_repository_filters.go delete mode 100644 models/e_allowed_backups_type.go delete mode 100644 models/e_application_settings_v_s_s.go delete mode 100644 models/e_backup_exclusion_policy.go delete mode 100644 models/e_backup_mode_type.go delete mode 100644 models/e_backup_objects_filters_order_column.go delete mode 100644 models/e_backup_oracle_logs_settings.go delete mode 100644 models/e_backup_proxy_import_type.go delete mode 100644 models/e_backup_proxy_transport_mode.go delete mode 100644 models/e_backup_script_processing_mode.go delete mode 100644 models/e_backups_filters_order_column.go delete mode 100644 models/e_compression_level.go delete mode 100644 models/e_config_backup_smtp_settings_type.go delete mode 100644 models/e_credentials_filters_order_column.go delete mode 100644 models/e_credentials_type.go delete mode 100644 models/e_daily_kinds.go delete mode 100644 models/e_day_number_in_month.go delete mode 100644 models/e_day_of_week.go delete mode 100644 models/e_disk_info_process_state.go delete mode 100644 models/e_disk_info_type.go delete mode 100644 models/e_email_notification_type.go delete mode 100644 models/e_encryption_passwords_filters_order_column.go delete mode 100644 models/e_guest_f_s_indexing_mode.go delete mode 100644 models/e_guest_o_s_type.go delete mode 100644 models/e_hierarchy_type.go delete mode 100644 models/e_instant_recovery_mount_state.go delete mode 100644 models/e_job_filters_order_column.go delete mode 100644 models/e_job_states_filters_order_column.go delete mode 100644 models/e_job_status.go delete mode 100644 models/e_job_type.go delete mode 100644 models/e_job_workload.go delete mode 100644 models/e_login_grant_type.go delete mode 100644 models/e_managed_server_type.go delete mode 100644 models/e_managed_servers_filters_order_column.go delete mode 100644 models/e_month.go delete mode 100644 models/e_object_restore_point_operation.go delete mode 100644 models/e_object_restore_points_filters_order_column.go delete mode 100644 models/e_periodically_kinds.go delete mode 100644 models/e_placement_policy_type.go delete mode 100644 models/e_platform.go delete mode 100644 models/e_platform_type.go delete mode 100644 models/e_proxies_filters_order_column.go delete mode 100644 models/e_proxy_type.go delete mode 100644 models/e_repository_extent_status_type.go delete mode 100644 models/e_repository_filters_order_column.go delete mode 100644 models/e_repository_states_filters_order_column.go delete mode 100644 models/e_repository_type.go delete mode 100644 models/e_retain_log_backups_type.go delete mode 100644 models/e_retention_policy_type.go delete mode 100644 models/e_scale_out_repository_filters_order_column.go delete mode 100644 models/e_script_periodicity_type.go delete mode 100644 models/e_sennight_of_month.go delete mode 100644 models/e_services_filters_order_column.go delete mode 100644 models/e_session_result.go delete mode 100644 models/e_session_state.go delete mode 100644 models/e_session_type.go delete mode 100644 models/e_sessions_filters_order_column.go delete mode 100644 models/e_speed_unit.go delete mode 100644 models/e_sql_logs_processing.go delete mode 100644 models/e_storage_optimization.go delete mode 100644 models/e_task_log_record_status.go delete mode 100644 models/e_transaction_logs_settings.go delete mode 100644 models/e_vi_host_type.go delete mode 100644 models/e_vi_root_filters_order_column.go delete mode 100644 models/e_vmware_disks_type_to_process.go delete mode 100644 models/e_vmware_inventory_type.go delete mode 100644 models/e_windows_host_component_type.go delete mode 100644 models/email_custom_notification_type.go delete mode 100644 models/email_notification_settings_model.go delete mode 100644 models/empty_success_response.go delete mode 100644 models/encryption_password_export_spec.go delete mode 100644 models/encryption_password_import_spec.go delete mode 100644 models/encryption_password_import_spec_collection.go delete mode 100644 models/encryption_password_model.go delete mode 100644 models/encryption_password_spec.go delete mode 100644 models/encryption_passwords_filters.go delete mode 100644 models/encryption_passwords_result.go delete mode 100644 models/error.go delete mode 100644 models/ev_centers_inventory_filters_order_column.go delete mode 100644 models/full_backup_maintenance_defragment_and_compact_model.go delete mode 100644 models/full_backup_maintenance_model.go delete mode 100644 models/full_backup_maintenance_remove_data_model.go delete mode 100644 models/g_f_s_policy_settings_model.go delete mode 100644 models/g_f_s_policy_settings_monthly_model.go delete mode 100644 models/g_f_s_policy_settings_weekly_model.go delete mode 100644 models/g_f_s_policy_settings_yearly_model.go delete mode 100644 models/general_options_email_notifications_model.go delete mode 100644 models/general_options_model.go delete mode 100644 models/general_options_notifications_model.go delete mode 100644 models/global_network_traffic_rules_model.go delete mode 100644 models/guest_file_system_indexing_model.go delete mode 100644 models/guest_interaction_proxies_settings_import_model.go delete mode 100644 models/guest_interaction_proxies_settings_model.go delete mode 100644 models/guest_os_credentials_import_model.go delete mode 100644 models/guest_os_credentials_model.go delete mode 100644 models/guest_os_credentials_per_machine_import_model.go delete mode 100644 models/guest_os_credentials_per_machine_model.go delete mode 100644 models/host_connection_spec.go delete mode 100644 models/job_export_spec.go delete mode 100644 models/job_import_spec.go delete mode 100644 models/job_import_spec_collection.go delete mode 100644 models/job_model.go delete mode 100644 models/job_scripts_settings_model.go delete mode 100644 models/job_spec.go delete mode 100644 models/job_start_spec.go delete mode 100644 models/job_state_model.go delete mode 100644 models/job_states_filters.go delete mode 100644 models/job_states_result.go delete mode 100644 models/job_stop_spec.go delete mode 100644 models/jobs_filters.go delete mode 100644 models/jobs_result.go delete mode 100644 models/linux_credentials_model.go delete mode 100644 models/linux_credentials_spec.go delete mode 100644 models/linux_host_import_spec.go delete mode 100644 models/linux_host_model.go delete mode 100644 models/linux_host_spec.go delete mode 100644 models/linux_host_ssh_settings_model.go delete mode 100644 models/linux_local_repository_settings_model.go delete mode 100644 models/linux_local_storage_import_spec.go delete mode 100644 models/linux_local_storage_model.go delete mode 100644 models/linux_local_storage_spec.go delete mode 100644 models/manage_server_export_spec.go delete mode 100644 models/manage_server_import_spec_collection.go delete mode 100644 models/managed_server_model.go delete mode 100644 models/managed_server_spec.go delete mode 100644 models/managed_servers_filters.go delete mode 100644 models/managed_servers_result.go delete mode 100644 models/mount_server_settings_import_spec.go delete mode 100644 models/mount_server_settings_model.go delete mode 100644 models/network_repository_settings_model.go delete mode 100644 models/nfs_repository_share_settings_model.go delete mode 100644 models/nfs_repository_share_settings_spec.go delete mode 100644 models/nfs_storage_import_spec.go delete mode 100644 models/nfs_storage_model.go delete mode 100644 models/nfs_storage_spec.go delete mode 100644 models/notification_settings_model.go delete mode 100644 models/notification_vm_attribute_settings_model.go delete mode 100644 models/object_restore_point_disk_model.go delete mode 100644 models/object_restore_point_disks_result.go delete mode 100644 models/object_restore_point_model.go delete mode 100644 models/object_restore_points_filters.go delete mode 100644 models/object_restore_points_result.go delete mode 100644 models/pagination_result.go delete mode 100644 models/performance_extent_model.go delete mode 100644 models/performance_tier_advanced_settings_model.go delete mode 100644 models/performance_tier_model.go delete mode 100644 models/placement_policy_model.go delete mode 100644 models/preferred_network_model.go delete mode 100644 models/preferred_networks_model.go delete mode 100644 models/primary_storage_integration_settings_model.go delete mode 100644 models/private_key_change_spec.go delete mode 100644 models/proxies_filters.go delete mode 100644 models/proxies_result.go delete mode 100644 models/proxy_datastore_model.go delete mode 100644 models/proxy_datastore_settings_model.go delete mode 100644 models/proxy_export_spec.go delete mode 100644 models/proxy_import_spec.go delete mode 100644 models/proxy_import_spec_collection.go delete mode 100644 models/proxy_model.go delete mode 100644 models/proxy_server_settings_import_spec.go delete mode 100644 models/proxy_server_settings_model.go delete mode 100644 models/proxy_spec.go delete mode 100644 models/repositories_filters.go delete mode 100644 models/repositories_result.go delete mode 100644 models/repository_advanced_settings_model.go delete mode 100644 models/repository_export_spec.go delete mode 100644 models/repository_import_spec_collection.go delete mode 100644 models/repository_model.go delete mode 100644 models/repository_share_gateway_import_spec.go delete mode 100644 models/repository_share_gateway_model.go delete mode 100644 models/repository_spec.go delete mode 100644 models/repository_state_model.go delete mode 100644 models/repository_states_filters.go delete mode 100644 models/repository_states_result.go delete mode 100644 models/scale_out_extent_maintenance_spec.go delete mode 100644 models/scale_out_repositories_filters.go delete mode 100644 models/scale_out_repositories_result.go delete mode 100644 models/scale_out_repository_model.go delete mode 100644 models/schedule_after_this_job_model.go delete mode 100644 models/schedule_backup_window_model.go delete mode 100644 models/schedule_daily_model.go delete mode 100644 models/schedule_monthly_model.go delete mode 100644 models/schedule_periodically_model.go delete mode 100644 models/schedule_retry_model.go delete mode 100644 models/script_command.go delete mode 100644 models/server_time_model.go delete mode 100644 models/services_filters.go delete mode 100644 models/services_model.go delete mode 100644 models/services_result.go delete mode 100644 models/session_log_record_model.go delete mode 100644 models/session_log_result.go delete mode 100644 models/session_model.go delete mode 100644 models/session_result_model.go delete mode 100644 models/sessions_filters.go delete mode 100644 models/sessions_result.go delete mode 100644 models/smb_repository_share_settings_model.go delete mode 100644 models/smb_repository_share_settings_spec.go delete mode 100644 models/smb_storage_import_spec.go delete mode 100644 models/smb_storage_model.go delete mode 100644 models/smb_storage_spec.go delete mode 100644 models/standard_credentials_model.go delete mode 100644 models/standard_credentials_spec.go delete mode 100644 models/synthetic_full_settings_model.go delete mode 100644 models/token_login_spec.go delete mode 100644 models/token_model.go delete mode 100644 models/traffic_rule_model.go delete mode 100644 models/v_center_inventory_filters.go delete mode 100644 models/v_center_inventory_result.go delete mode 100644 models/v_power_n_f_s_port_settings_model.go delete mode 100644 models/v_sphere_changed_block_tracking_settings_model.go delete mode 100644 models/vi_backup_object_model.go delete mode 100644 models/vi_host_import_spec.go delete mode 100644 models/vi_host_model.go delete mode 100644 models/vi_host_spec.go delete mode 100644 models/vi_proxy_model.go delete mode 100644 models/vi_proxy_spec.go delete mode 100644 models/vi_root_filters.go delete mode 100644 models/vi_roots_result.go delete mode 100644 models/vmb_api_filter_model.go delete mode 100644 models/vmware_fcd_instant_recovery_disk_info.go delete mode 100644 models/vmware_fcd_instant_recovery_disk_spec.go delete mode 100644 models/vmware_fcd_instant_recovery_mount.go delete mode 100644 models/vmware_fcd_instant_recovery_spec.go delete mode 100644 models/vmware_fcd_quick_migration_spec.go delete mode 100644 models/vmware_fcd_write_cache_spec.go delete mode 100644 models/vmware_object_disk_model.go delete mode 100644 models/vmware_object_model.go delete mode 100644 models/vmware_object_size_model.go delete mode 100644 models/windows_host_component_port_model.go delete mode 100644 models/windows_host_import_spec.go delete mode 100644 models/windows_host_model.go delete mode 100644 models/windows_host_ports_model.go delete mode 100644 models/windows_host_spec.go delete mode 100644 models/windows_local_repository_settings_model.go delete mode 100644 models/windows_local_storage_import_spec.go delete mode 100644 models/windows_local_storage_model.go delete mode 100644 models/windows_local_storage_spec.go create mode 100644 swagger.json delete mode 100644 swagger.yml delete mode 100644 vendor/github.com/PuerkitoBio/purell/.gitignore delete mode 100644 vendor/github.com/PuerkitoBio/purell/.travis.yml delete mode 100644 vendor/github.com/PuerkitoBio/purell/LICENSE delete mode 100644 vendor/github.com/PuerkitoBio/purell/README.md delete mode 100644 vendor/github.com/PuerkitoBio/purell/purell.go delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/.travis.yml delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/LICENSE delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/README.md delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/urlesc.go delete mode 100644 vendor/github.com/asaskevich/govalidator/.gitignore delete mode 100644 vendor/github.com/asaskevich/govalidator/.travis.yml delete mode 100644 vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md delete mode 100644 vendor/github.com/asaskevich/govalidator/LICENSE delete mode 100644 vendor/github.com/asaskevich/govalidator/README.md delete mode 100644 vendor/github.com/asaskevich/govalidator/arrays.go delete mode 100644 vendor/github.com/asaskevich/govalidator/converter.go delete mode 100644 vendor/github.com/asaskevich/govalidator/doc.go delete mode 100644 vendor/github.com/asaskevich/govalidator/error.go delete mode 100644 vendor/github.com/asaskevich/govalidator/go.mod delete mode 100644 vendor/github.com/asaskevich/govalidator/numerics.go delete mode 100644 vendor/github.com/asaskevich/govalidator/patterns.go delete mode 100644 vendor/github.com/asaskevich/govalidator/types.go delete mode 100644 vendor/github.com/asaskevich/govalidator/utils.go delete mode 100644 vendor/github.com/asaskevich/govalidator/validator.go delete mode 100644 vendor/github.com/asaskevich/govalidator/wercker.yml delete mode 100644 vendor/github.com/go-openapi/analysis/.codecov.yml delete mode 100644 vendor/github.com/go-openapi/analysis/.gitignore delete mode 100644 vendor/github.com/go-openapi/analysis/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/analysis/.travis.yml delete mode 100644 vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/analysis/LICENSE delete mode 100644 vendor/github.com/go-openapi/analysis/README.md delete mode 100644 vendor/github.com/go-openapi/analysis/analyzer.go delete mode 100644 vendor/github.com/go-openapi/analysis/appveyor.yml delete mode 100644 vendor/github.com/go-openapi/analysis/debug.go delete mode 100644 vendor/github.com/go-openapi/analysis/doc.go delete mode 100644 vendor/github.com/go-openapi/analysis/fixer.go delete mode 100644 vendor/github.com/go-openapi/analysis/flatten.go delete mode 100644 vendor/github.com/go-openapi/analysis/go.mod delete mode 100644 vendor/github.com/go-openapi/analysis/go.sum delete mode 100644 vendor/github.com/go-openapi/analysis/internal/post_go18.go delete mode 100644 vendor/github.com/go-openapi/analysis/internal/pre_go18.go delete mode 100644 vendor/github.com/go-openapi/analysis/mixin.go delete mode 100644 vendor/github.com/go-openapi/analysis/schema.go delete mode 100644 vendor/github.com/go-openapi/errors/.gitignore delete mode 100644 vendor/github.com/go-openapi/errors/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/errors/.travis.yml delete mode 100644 vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/errors/LICENSE delete mode 100644 vendor/github.com/go-openapi/errors/README.md delete mode 100644 vendor/github.com/go-openapi/errors/api.go delete mode 100644 vendor/github.com/go-openapi/errors/auth.go delete mode 100644 vendor/github.com/go-openapi/errors/doc.go delete mode 100644 vendor/github.com/go-openapi/errors/go.mod delete mode 100644 vendor/github.com/go-openapi/errors/go.sum delete mode 100644 vendor/github.com/go-openapi/errors/headers.go delete mode 100644 vendor/github.com/go-openapi/errors/middleware.go delete mode 100644 vendor/github.com/go-openapi/errors/parsing.go delete mode 100644 vendor/github.com/go-openapi/errors/schema.go delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.editorconfig delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.gitignore delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.travis.yml delete mode 100644 vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/LICENSE delete mode 100644 vendor/github.com/go-openapi/jsonpointer/README.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/go.mod delete mode 100644 vendor/github.com/go-openapi/jsonpointer/go.sum delete mode 100644 vendor/github.com/go-openapi/jsonpointer/pointer.go delete mode 100644 vendor/github.com/go-openapi/jsonreference/.gitignore delete mode 100644 vendor/github.com/go-openapi/jsonreference/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/jsonreference/.travis.yml delete mode 100644 vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/LICENSE delete mode 100644 vendor/github.com/go-openapi/jsonreference/README.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/go.mod delete mode 100644 vendor/github.com/go-openapi/jsonreference/go.sum delete mode 100644 vendor/github.com/go-openapi/jsonreference/reference.go delete mode 100644 vendor/github.com/go-openapi/loads/.editorconfig delete mode 100644 vendor/github.com/go-openapi/loads/.gitignore delete mode 100644 vendor/github.com/go-openapi/loads/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/loads/.travis.yml delete mode 100644 vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/loads/LICENSE delete mode 100644 vendor/github.com/go-openapi/loads/README.md delete mode 100644 vendor/github.com/go-openapi/loads/doc.go delete mode 100644 vendor/github.com/go-openapi/loads/go.mod delete mode 100644 vendor/github.com/go-openapi/loads/go.sum delete mode 100644 vendor/github.com/go-openapi/loads/loaders.go delete mode 100644 vendor/github.com/go-openapi/loads/options.go delete mode 100644 vendor/github.com/go-openapi/loads/spec.go delete mode 100644 vendor/github.com/go-openapi/runtime/.editorconfig delete mode 100644 vendor/github.com/go-openapi/runtime/.gitattributes delete mode 100644 vendor/github.com/go-openapi/runtime/.gitignore delete mode 100644 vendor/github.com/go-openapi/runtime/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/runtime/.travis.yml delete mode 100644 vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/runtime/LICENSE delete mode 100644 vendor/github.com/go-openapi/runtime/README.md delete mode 100644 vendor/github.com/go-openapi/runtime/bytestream.go delete mode 100644 vendor/github.com/go-openapi/runtime/client/auth_info.go delete mode 100644 vendor/github.com/go-openapi/runtime/client/keepalive.go delete mode 100644 vendor/github.com/go-openapi/runtime/client/opentracing.go delete mode 100644 vendor/github.com/go-openapi/runtime/client/request.go delete mode 100644 vendor/github.com/go-openapi/runtime/client/response.go delete mode 100644 vendor/github.com/go-openapi/runtime/client/runtime.go delete mode 100644 vendor/github.com/go-openapi/runtime/client_auth_info.go delete mode 100644 vendor/github.com/go-openapi/runtime/client_operation.go delete mode 100644 vendor/github.com/go-openapi/runtime/client_request.go delete mode 100644 vendor/github.com/go-openapi/runtime/client_response.go delete mode 100644 vendor/github.com/go-openapi/runtime/constants.go delete mode 100644 vendor/github.com/go-openapi/runtime/csv.go delete mode 100644 vendor/github.com/go-openapi/runtime/discard.go delete mode 100644 vendor/github.com/go-openapi/runtime/file.go delete mode 100644 vendor/github.com/go-openapi/runtime/go.mod delete mode 100644 vendor/github.com/go-openapi/runtime/go.sum delete mode 100644 vendor/github.com/go-openapi/runtime/headers.go delete mode 100644 vendor/github.com/go-openapi/runtime/interfaces.go delete mode 100644 vendor/github.com/go-openapi/runtime/json.go delete mode 100644 vendor/github.com/go-openapi/runtime/logger/logger.go delete mode 100644 vendor/github.com/go-openapi/runtime/logger/standard.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/context.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/README.md delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/router.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/server.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/util.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/doc.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/go18.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/header/header.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/negotiate.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/not_implemented.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/operation.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/parameter.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/pre_go18.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/rapidoc.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/redoc.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/request.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/router.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/security.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/spec.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/swaggerui.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/untyped/api.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/validation.go delete mode 100644 vendor/github.com/go-openapi/runtime/request.go delete mode 100644 vendor/github.com/go-openapi/runtime/security/authenticator.go delete mode 100644 vendor/github.com/go-openapi/runtime/security/authorizer.go delete mode 100644 vendor/github.com/go-openapi/runtime/statuses.go delete mode 100644 vendor/github.com/go-openapi/runtime/text.go delete mode 100644 vendor/github.com/go-openapi/runtime/values.go delete mode 100644 vendor/github.com/go-openapi/runtime/xml.go delete mode 100644 vendor/github.com/go-openapi/runtime/yamlpc/yaml.go delete mode 100644 vendor/github.com/go-openapi/spec/.editorconfig delete mode 100644 vendor/github.com/go-openapi/spec/.gitignore delete mode 100644 vendor/github.com/go-openapi/spec/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/spec/.travis.yml delete mode 100644 vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/spec/LICENSE delete mode 100644 vendor/github.com/go-openapi/spec/README.md delete mode 100644 vendor/github.com/go-openapi/spec/appveyor.yml delete mode 100644 vendor/github.com/go-openapi/spec/bindata.go delete mode 100644 vendor/github.com/go-openapi/spec/cache.go delete mode 100644 vendor/github.com/go-openapi/spec/contact_info.go delete mode 100644 vendor/github.com/go-openapi/spec/debug.go delete mode 100644 vendor/github.com/go-openapi/spec/errors.go delete mode 100644 vendor/github.com/go-openapi/spec/expander.go delete mode 100644 vendor/github.com/go-openapi/spec/external_docs.go delete mode 100644 vendor/github.com/go-openapi/spec/go.mod delete mode 100644 vendor/github.com/go-openapi/spec/go.sum delete mode 100644 vendor/github.com/go-openapi/spec/header.go delete mode 100644 vendor/github.com/go-openapi/spec/info.go delete mode 100644 vendor/github.com/go-openapi/spec/items.go delete mode 100644 vendor/github.com/go-openapi/spec/license.go delete mode 100644 vendor/github.com/go-openapi/spec/normalizer.go delete mode 100644 vendor/github.com/go-openapi/spec/normalizer_nonwindows.go delete mode 100644 vendor/github.com/go-openapi/spec/normalizer_windows.go delete mode 100644 vendor/github.com/go-openapi/spec/operation.go delete mode 100644 vendor/github.com/go-openapi/spec/parameter.go delete mode 100644 vendor/github.com/go-openapi/spec/path_item.go delete mode 100644 vendor/github.com/go-openapi/spec/paths.go delete mode 100644 vendor/github.com/go-openapi/spec/properties.go delete mode 100644 vendor/github.com/go-openapi/spec/ref.go delete mode 100644 vendor/github.com/go-openapi/spec/resolver.go delete mode 100644 vendor/github.com/go-openapi/spec/response.go delete mode 100644 vendor/github.com/go-openapi/spec/responses.go delete mode 100644 vendor/github.com/go-openapi/spec/schema.go delete mode 100644 vendor/github.com/go-openapi/spec/schema_loader.go delete mode 100644 vendor/github.com/go-openapi/spec/security_scheme.go delete mode 100644 vendor/github.com/go-openapi/spec/spec.go delete mode 100644 vendor/github.com/go-openapi/spec/swagger.go delete mode 100644 vendor/github.com/go-openapi/spec/tag.go delete mode 100644 vendor/github.com/go-openapi/spec/validations.go delete mode 100644 vendor/github.com/go-openapi/spec/xml_object.go delete mode 100644 vendor/github.com/go-openapi/strfmt/.editorconfig delete mode 100644 vendor/github.com/go-openapi/strfmt/.gitignore delete mode 100644 vendor/github.com/go-openapi/strfmt/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/strfmt/.travis.yml delete mode 100644 vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/strfmt/LICENSE delete mode 100644 vendor/github.com/go-openapi/strfmt/README.md delete mode 100644 vendor/github.com/go-openapi/strfmt/bson.go delete mode 100644 vendor/github.com/go-openapi/strfmt/date.go delete mode 100644 vendor/github.com/go-openapi/strfmt/default.go delete mode 100644 vendor/github.com/go-openapi/strfmt/doc.go delete mode 100644 vendor/github.com/go-openapi/strfmt/duration.go delete mode 100644 vendor/github.com/go-openapi/strfmt/format.go delete mode 100644 vendor/github.com/go-openapi/strfmt/go.mod delete mode 100644 vendor/github.com/go-openapi/strfmt/go.sum delete mode 100644 vendor/github.com/go-openapi/strfmt/time.go delete mode 100644 vendor/github.com/go-openapi/strfmt/ulid.go delete mode 100644 vendor/github.com/go-openapi/swag/.editorconfig delete mode 100644 vendor/github.com/go-openapi/swag/.gitignore delete mode 100644 vendor/github.com/go-openapi/swag/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/swag/.travis.yml delete mode 100644 vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/swag/LICENSE delete mode 100644 vendor/github.com/go-openapi/swag/README.md delete mode 100644 vendor/github.com/go-openapi/swag/convert.go delete mode 100644 vendor/github.com/go-openapi/swag/convert_types.go delete mode 100644 vendor/github.com/go-openapi/swag/doc.go delete mode 100644 vendor/github.com/go-openapi/swag/go.mod delete mode 100644 vendor/github.com/go-openapi/swag/go.sum delete mode 100644 vendor/github.com/go-openapi/swag/json.go delete mode 100644 vendor/github.com/go-openapi/swag/loading.go delete mode 100644 vendor/github.com/go-openapi/swag/name_lexem.go delete mode 100644 vendor/github.com/go-openapi/swag/net.go delete mode 100644 vendor/github.com/go-openapi/swag/path.go delete mode 100644 vendor/github.com/go-openapi/swag/post_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/post_go19.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go19.go delete mode 100644 vendor/github.com/go-openapi/swag/split.go delete mode 100644 vendor/github.com/go-openapi/swag/util.go delete mode 100644 vendor/github.com/go-openapi/swag/yaml.go delete mode 100644 vendor/github.com/go-openapi/validate/.editorconfig delete mode 100644 vendor/github.com/go-openapi/validate/.gitignore delete mode 100644 vendor/github.com/go-openapi/validate/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/validate/.travis.yml delete mode 100644 vendor/github.com/go-openapi/validate/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/validate/LICENSE delete mode 100644 vendor/github.com/go-openapi/validate/README.md delete mode 100644 vendor/github.com/go-openapi/validate/appveyor.yml delete mode 100644 vendor/github.com/go-openapi/validate/context.go delete mode 100644 vendor/github.com/go-openapi/validate/debug.go delete mode 100644 vendor/github.com/go-openapi/validate/default_validator.go delete mode 100644 vendor/github.com/go-openapi/validate/doc.go delete mode 100644 vendor/github.com/go-openapi/validate/example_validator.go delete mode 100644 vendor/github.com/go-openapi/validate/formats.go delete mode 100644 vendor/github.com/go-openapi/validate/go.mod delete mode 100644 vendor/github.com/go-openapi/validate/go.sum delete mode 100644 vendor/github.com/go-openapi/validate/helpers.go delete mode 100644 vendor/github.com/go-openapi/validate/object_validator.go delete mode 100644 vendor/github.com/go-openapi/validate/options.go delete mode 100644 vendor/github.com/go-openapi/validate/result.go delete mode 100644 vendor/github.com/go-openapi/validate/rexp.go delete mode 100644 vendor/github.com/go-openapi/validate/schema.go delete mode 100644 vendor/github.com/go-openapi/validate/schema_messages.go delete mode 100644 vendor/github.com/go-openapi/validate/schema_option.go delete mode 100644 vendor/github.com/go-openapi/validate/schema_props.go delete mode 100644 vendor/github.com/go-openapi/validate/slice_validator.go delete mode 100644 vendor/github.com/go-openapi/validate/spec.go delete mode 100644 vendor/github.com/go-openapi/validate/spec_messages.go delete mode 100644 vendor/github.com/go-openapi/validate/type.go delete mode 100644 vendor/github.com/go-openapi/validate/update-fixtures.sh delete mode 100644 vendor/github.com/go-openapi/validate/validator.go delete mode 100644 vendor/github.com/go-openapi/validate/values.go delete mode 100644 vendor/github.com/go-stack/stack/.travis.yml delete mode 100644 vendor/github.com/go-stack/stack/LICENSE.md delete mode 100644 vendor/github.com/go-stack/stack/README.md delete mode 100644 vendor/github.com/go-stack/stack/go.mod delete mode 100644 vendor/github.com/go-stack/stack/stack.go delete mode 100644 vendor/github.com/josharian/intern/README.md delete mode 100644 vendor/github.com/josharian/intern/go.mod delete mode 100644 vendor/github.com/josharian/intern/intern.go delete mode 100644 vendor/github.com/josharian/intern/license.md delete mode 100644 vendor/github.com/mailru/easyjson/LICENSE delete mode 100644 vendor/github.com/mailru/easyjson/buffer/pool.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/error.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/lexer.go delete mode 100644 vendor/github.com/mailru/easyjson/jwriter/writer.go delete mode 100644 vendor/github.com/mitchellh/mapstructure/CHANGELOG.md delete mode 100644 vendor/github.com/mitchellh/mapstructure/LICENSE delete mode 100644 vendor/github.com/mitchellh/mapstructure/README.md delete mode 100644 vendor/github.com/mitchellh/mapstructure/decode_hooks.go delete mode 100644 vendor/github.com/mitchellh/mapstructure/error.go delete mode 100644 vendor/github.com/mitchellh/mapstructure/go.mod delete mode 100644 vendor/github.com/mitchellh/mapstructure/mapstructure.go delete mode 100644 vendor/github.com/oklog/ulid/.gitignore delete mode 100644 vendor/github.com/oklog/ulid/.travis.yml delete mode 100644 vendor/github.com/oklog/ulid/AUTHORS.md delete mode 100644 vendor/github.com/oklog/ulid/CHANGELOG.md delete mode 100644 vendor/github.com/oklog/ulid/CONTRIBUTING.md delete mode 100644 vendor/github.com/oklog/ulid/Gopkg.lock delete mode 100644 vendor/github.com/oklog/ulid/Gopkg.toml delete mode 100644 vendor/github.com/oklog/ulid/LICENSE delete mode 100644 vendor/github.com/oklog/ulid/README.md delete mode 100644 vendor/github.com/oklog/ulid/ulid.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/.gitignore delete mode 100644 vendor/github.com/opentracing/opentracing-go/.travis.yml delete mode 100644 vendor/github.com/opentracing/opentracing-go/CHANGELOG.md delete mode 100644 vendor/github.com/opentracing/opentracing-go/LICENSE delete mode 100644 vendor/github.com/opentracing/opentracing-go/Makefile delete mode 100644 vendor/github.com/opentracing/opentracing-go/README.md delete mode 100644 vendor/github.com/opentracing/opentracing-go/ext.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/ext/field.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/ext/tags.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/globaltracer.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/go.mod delete mode 100644 vendor/github.com/opentracing/opentracing-go/go.sum delete mode 100644 vendor/github.com/opentracing/opentracing-go/gocontext.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/log/field.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/log/util.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/noop.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/propagation.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/span.go delete mode 100644 vendor/github.com/opentracing/opentracing-go/tracer.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/LICENSE delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bson.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bson_1_8.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/cond_addr_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/mode.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/proxy.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/doc.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_tables.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/mode.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/reader.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/decoder.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/doc.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/encoder.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/marshal.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/raw.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/raw_element.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/raw_value.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/registry.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/types.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/array.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_arraybuilder.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document_sequence.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/tables.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go delete mode 100644 vendor/golang.org/x/net/AUTHORS delete mode 100644 vendor/golang.org/x/net/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/net/LICENSE delete mode 100644 vendor/golang.org/x/net/PATENTS delete mode 100644 vendor/golang.org/x/net/idna/idna10.0.0.go delete mode 100644 vendor/golang.org/x/net/idna/idna9.0.0.go delete mode 100644 vendor/golang.org/x/net/idna/punycode.go delete mode 100644 vendor/golang.org/x/net/idna/tables10.0.0.go delete mode 100644 vendor/golang.org/x/net/idna/tables11.0.0.go delete mode 100644 vendor/golang.org/x/net/idna/tables12.0.0.go delete mode 100644 vendor/golang.org/x/net/idna/tables13.0.0.go delete mode 100644 vendor/golang.org/x/net/idna/tables9.0.0.go delete mode 100644 vendor/golang.org/x/net/idna/trie.go delete mode 100644 vendor/golang.org/x/net/idna/trieval.go delete mode 100644 vendor/golang.org/x/text/AUTHORS delete mode 100644 vendor/golang.org/x/text/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/text/LICENSE delete mode 100644 vendor/golang.org/x/text/PATENTS delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go delete mode 100644 vendor/golang.org/x/text/transform/transform.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/bidi.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/bracket.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/core.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/prop.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/trieval.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/composition.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/forminfo.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/input.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/iter.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/normalize.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/readwriter.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables12.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables13.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables9.0.0.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/transform.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/trie.go delete mode 100644 vendor/golang.org/x/text/width/kind_string.go delete mode 100644 vendor/golang.org/x/text/width/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables12.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables13.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables9.0.0.go delete mode 100644 vendor/golang.org/x/text/width/transform.go delete mode 100644 vendor/golang.org/x/text/width/trieval.go delete mode 100644 vendor/golang.org/x/text/width/width.go delete mode 100644 vendor/gopkg.in/yaml.v2/.travis.yml delete mode 100644 vendor/gopkg.in/yaml.v2/LICENSE delete mode 100644 vendor/gopkg.in/yaml.v2/LICENSE.libyaml delete mode 100644 vendor/gopkg.in/yaml.v2/NOTICE delete mode 100644 vendor/gopkg.in/yaml.v2/README.md delete mode 100644 vendor/gopkg.in/yaml.v2/apic.go delete mode 100644 vendor/gopkg.in/yaml.v2/decode.go delete mode 100644 vendor/gopkg.in/yaml.v2/emitterc.go delete mode 100644 vendor/gopkg.in/yaml.v2/encode.go delete mode 100644 vendor/gopkg.in/yaml.v2/go.mod delete mode 100644 vendor/gopkg.in/yaml.v2/parserc.go delete mode 100644 vendor/gopkg.in/yaml.v2/readerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/resolve.go delete mode 100644 vendor/gopkg.in/yaml.v2/scannerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/sorter.go delete mode 100644 vendor/gopkg.in/yaml.v2/writerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/yaml.go delete mode 100644 vendor/gopkg.in/yaml.v2/yamlh.go delete mode 100644 vendor/gopkg.in/yaml.v2/yamlprivateh.go delete mode 100644 vendor/modules.txt diff --git a/client/automation/automation_client.go b/client/automation/automation_client.go deleted file mode 100644 index ea76e4c..0000000 --- a/client/automation/automation_client.go +++ /dev/null @@ -1,727 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new automation API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for automation API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ExportCredentials(params *ExportCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportCredentialsOK, error) - - ExportEncryptionPasswords(params *ExportEncryptionPasswordsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportEncryptionPasswordsOK, error) - - ExportJobs(params *ExportJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportJobsOK, error) - - ExportManagedServers(params *ExportManagedServersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportManagedServersOK, error) - - ExportProxies(params *ExportProxiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportProxiesOK, error) - - ExportRepositories(params *ExportRepositoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportRepositoriesOK, error) - - GetAllAutomationSessions(params *GetAllAutomationSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllAutomationSessionsOK, error) - - GetAutomationSession(params *GetAutomationSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAutomationSessionOK, error) - - GetAutomationSessionLogs(params *GetAutomationSessionLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAutomationSessionLogsOK, error) - - ImportCredentials(params *ImportCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportCredentialsCreated, error) - - ImportEncryptionPasswords(params *ImportEncryptionPasswordsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportEncryptionPasswordsCreated, error) - - ImportJobs(params *ImportJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportJobsCreated, error) - - ImportManagedServers(params *ImportManagedServersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportManagedServersCreated, error) - - ImportProxies(params *ImportProxiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportProxiesCreated, error) - - ImportRepositories(params *ImportRepositoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportRepositoriesCreated, error) - - StopAutomationSession(params *StopAutomationSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopAutomationSessionOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - ExportCredentials exports credentials - - The HTTP POST request to the `/api/v1/automation/credentials/export` path allows you to export credentials from Veeam Backup & Replication. -*/ -func (a *Client) ExportCredentials(params *ExportCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportCredentialsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExportCredentialsParams() - } - op := &runtime.ClientOperation{ - ID: "ExportCredentials", - Method: "POST", - PathPattern: "/api/v1/automation/credentials/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ExportCredentialsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExportCredentialsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ExportCredentials: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExportEncryptionPasswords exports encryption passwords - - The HTTP POST request to the `/api/v1/automation/encryptionPasswords/export` path allows you to export encryption passwords from Veeam Backup & Replication. -*/ -func (a *Client) ExportEncryptionPasswords(params *ExportEncryptionPasswordsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportEncryptionPasswordsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExportEncryptionPasswordsParams() - } - op := &runtime.ClientOperation{ - ID: "ExportEncryptionPasswords", - Method: "POST", - PathPattern: "/api/v1/automation/encryptionPasswords/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ExportEncryptionPasswordsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExportEncryptionPasswordsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ExportEncryptionPasswords: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExportJobs exports jobs - - The HTTP POST request to the `/api/v1/automation/jobs/export` path allows you to export jobs from Veeam Backup & Replication. -*/ -func (a *Client) ExportJobs(params *ExportJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportJobsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExportJobsParams() - } - op := &runtime.ClientOperation{ - ID: "ExportJobs", - Method: "POST", - PathPattern: "/api/v1/automation/jobs/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ExportJobsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExportJobsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ExportJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExportManagedServers exports servers - - The HTTP POST request to the `/api/v1/automation/managedServers/export` path allows you to export managed servers from Veeam Backup & Replication. -*/ -func (a *Client) ExportManagedServers(params *ExportManagedServersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportManagedServersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExportManagedServersParams() - } - op := &runtime.ClientOperation{ - ID: "ExportManagedServers", - Method: "POST", - PathPattern: "/api/v1/automation/managedServers/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ExportManagedServersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExportManagedServersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ExportManagedServers: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExportProxies exports proxies - - The HTTP POST request to the `/api/v1/automation/proxies/export` path allows you to export backup proxies from Veeam Backup & Replication. -*/ -func (a *Client) ExportProxies(params *ExportProxiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportProxiesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExportProxiesParams() - } - op := &runtime.ClientOperation{ - ID: "ExportProxies", - Method: "POST", - PathPattern: "/api/v1/automation/proxies/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ExportProxiesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExportProxiesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ExportProxies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExportRepositories exports repositories - - The HTTP POST request to the `/api/v1/automation/repositories/export` path allows you to export backup repositories from Veeam Backup & Replication. -*/ -func (a *Client) ExportRepositories(params *ExportRepositoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportRepositoriesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExportRepositoriesParams() - } - op := &runtime.ClientOperation{ - ID: "ExportRepositories", - Method: "POST", - PathPattern: "/api/v1/automation/repositories/export", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ExportRepositoriesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExportRepositoriesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ExportRepositories: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllAutomationSessions gets all automation sessions - - The HTTP GET request to the `/api/v1/automation/sessions` path allows you to get an array of all automation sessions performed on the backup server. -*/ -func (a *Client) GetAllAutomationSessions(params *GetAllAutomationSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllAutomationSessionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllAutomationSessionsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllAutomationSessions", - Method: "GET", - PathPattern: "/api/v1/automation/sessions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllAutomationSessionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllAutomationSessionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllAutomationSessions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAutomationSession gets automation session - - The HTTP GET request to the `/api/v1/automation/sessions/{id}` path allows you to get an automation session that has the specified `id`. -*/ -func (a *Client) GetAutomationSession(params *GetAutomationSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAutomationSessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAutomationSessionParams() - } - op := &runtime.ClientOperation{ - ID: "GetAutomationSession", - Method: "GET", - PathPattern: "/api/v1/automation/sessions/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAutomationSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAutomationSessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAutomationSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAutomationSessionLogs gets automation session logs - - The HTTP GET request to the `/api/v1/automation/sessions/{id}/logs` path allows you to get an array of log records of an automation session that has the specified `id`. -*/ -func (a *Client) GetAutomationSessionLogs(params *GetAutomationSessionLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAutomationSessionLogsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAutomationSessionLogsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAutomationSessionLogs", - Method: "GET", - PathPattern: "/api/v1/automation/sessions/{id}/logs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAutomationSessionLogsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAutomationSessionLogsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAutomationSessionLogs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ImportCredentials imports credentials - - The HTTP POST request to the `/api/v1/automation/credentials/import` path allows you to import credentials to Veeam Backup & Replication. -*/ -func (a *Client) ImportCredentials(params *ImportCredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportCredentialsCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewImportCredentialsParams() - } - op := &runtime.ClientOperation{ - ID: "ImportCredentials", - Method: "POST", - PathPattern: "/api/v1/automation/credentials/import", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ImportCredentialsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ImportCredentialsCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ImportCredentials: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ImportEncryptionPasswords imports encryption passwords - - The HTTP POST request to the `/api/v1/automation/encryptionPasswords/import` path allows you to import encryption passwords to Veeam Backup & Replication. -*/ -func (a *Client) ImportEncryptionPasswords(params *ImportEncryptionPasswordsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportEncryptionPasswordsCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewImportEncryptionPasswordsParams() - } - op := &runtime.ClientOperation{ - ID: "ImportEncryptionPasswords", - Method: "POST", - PathPattern: "/api/v1/automation/encryptionPasswords/import", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ImportEncryptionPasswordsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ImportEncryptionPasswordsCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ImportEncryptionPasswords: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ImportJobs imports jobs - - The HTTP POST request to the `/api/v1/automation/jobs/import` path allows you to import jobs to Veeam Backup & Replication. -*/ -func (a *Client) ImportJobs(params *ImportJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportJobsCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewImportJobsParams() - } - op := &runtime.ClientOperation{ - ID: "ImportJobs", - Method: "POST", - PathPattern: "/api/v1/automation/jobs/import", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ImportJobsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ImportJobsCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ImportJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ImportManagedServers imports servers - - The HTTP POST request to the `/api/v1/automation/managedServers/import` path allows you to import managed servers to Veeam Backup & Replication. -*/ -func (a *Client) ImportManagedServers(params *ImportManagedServersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportManagedServersCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewImportManagedServersParams() - } - op := &runtime.ClientOperation{ - ID: "ImportManagedServers", - Method: "POST", - PathPattern: "/api/v1/automation/managedServers/import", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ImportManagedServersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ImportManagedServersCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ImportManagedServers: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ImportProxies imports proxies - - The HTTP POST request to the `/api/v1/automation/proxies/import` path allows you to import backup proxies to Veeam Backup & Replication. -*/ -func (a *Client) ImportProxies(params *ImportProxiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportProxiesCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewImportProxiesParams() - } - op := &runtime.ClientOperation{ - ID: "ImportProxies", - Method: "POST", - PathPattern: "/api/v1/automation/proxies/import", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ImportProxiesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ImportProxiesCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ImportProxies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ImportRepositories imports repositories - - The HTTP POST request to the `/api/v1/automation/repositories/import` path allows you to import backup repositories to Veeam Backup & Replication. -*/ -func (a *Client) ImportRepositories(params *ImportRepositoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportRepositoriesCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewImportRepositoriesParams() - } - op := &runtime.ClientOperation{ - ID: "ImportRepositories", - Method: "POST", - PathPattern: "/api/v1/automation/repositories/import", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ImportRepositoriesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ImportRepositoriesCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ImportRepositories: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - StopAutomationSession stops automation session - - The HTTP POST request to the `/api/v1/automation/sessions/{id}/stop` path allows you to stop an automation session that has the specified `id`. -*/ -func (a *Client) StopAutomationSession(params *StopAutomationSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopAutomationSessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewStopAutomationSessionParams() - } - op := &runtime.ClientOperation{ - ID: "StopAutomationSession", - Method: "POST", - PathPattern: "/api/v1/automation/sessions/{id}/stop", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &StopAutomationSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*StopAutomationSessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for StopAutomationSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/automation/export_credentials_parameters.go b/client/automation/export_credentials_parameters.go deleted file mode 100644 index 9c8eb19..0000000 --- a/client/automation/export_credentials_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewExportCredentialsParams creates a new ExportCredentialsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExportCredentialsParams() *ExportCredentialsParams { - return &ExportCredentialsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExportCredentialsParamsWithTimeout creates a new ExportCredentialsParams object -// with the ability to set a timeout on a request. -func NewExportCredentialsParamsWithTimeout(timeout time.Duration) *ExportCredentialsParams { - return &ExportCredentialsParams{ - timeout: timeout, - } -} - -// NewExportCredentialsParamsWithContext creates a new ExportCredentialsParams object -// with the ability to set a context for a request. -func NewExportCredentialsParamsWithContext(ctx context.Context) *ExportCredentialsParams { - return &ExportCredentialsParams{ - Context: ctx, - } -} - -// NewExportCredentialsParamsWithHTTPClient creates a new ExportCredentialsParams object -// with the ability to set a custom HTTPClient for a request. -func NewExportCredentialsParamsWithHTTPClient(client *http.Client) *ExportCredentialsParams { - return &ExportCredentialsParams{ - HTTPClient: client, - } -} - -/* ExportCredentialsParams contains all the parameters to send to the API endpoint - for the export credentials operation. - - Typically these are written to a http.Request. -*/ -type ExportCredentialsParams struct { - - // Body. - Body *models.CredentialsExportSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the export credentials params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportCredentialsParams) WithDefaults() *ExportCredentialsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the export credentials params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportCredentialsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ExportCredentialsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the export credentials params -func (o *ExportCredentialsParams) WithTimeout(timeout time.Duration) *ExportCredentialsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the export credentials params -func (o *ExportCredentialsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the export credentials params -func (o *ExportCredentialsParams) WithContext(ctx context.Context) *ExportCredentialsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the export credentials params -func (o *ExportCredentialsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the export credentials params -func (o *ExportCredentialsParams) WithHTTPClient(client *http.Client) *ExportCredentialsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the export credentials params -func (o *ExportCredentialsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the export credentials params -func (o *ExportCredentialsParams) WithBody(body *models.CredentialsExportSpec) *ExportCredentialsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the export credentials params -func (o *ExportCredentialsParams) SetBody(body *models.CredentialsExportSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the export credentials params -func (o *ExportCredentialsParams) WithXAPIVersion(xAPIVersion string) *ExportCredentialsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the export credentials params -func (o *ExportCredentialsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ExportCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/export_credentials_responses.go b/client/automation/export_credentials_responses.go deleted file mode 100644 index d11ff7d..0000000 --- a/client/automation/export_credentials_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ExportCredentialsReader is a Reader for the ExportCredentials structure. -type ExportCredentialsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExportCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExportCredentialsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewExportCredentialsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewExportCredentialsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewExportCredentialsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewExportCredentialsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExportCredentialsOK creates a ExportCredentialsOK with default headers values -func NewExportCredentialsOK() *ExportCredentialsOK { - return &ExportCredentialsOK{} -} - -/* ExportCredentialsOK describes a response with status code 200, with default header values. - -OK -*/ -type ExportCredentialsOK struct { - Payload *models.CredentialsImportSpecCollection -} - -func (o *ExportCredentialsOK) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/export][%d] exportCredentialsOK %+v", 200, o.Payload) -} -func (o *ExportCredentialsOK) GetPayload() *models.CredentialsImportSpecCollection { - return o.Payload -} - -func (o *ExportCredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CredentialsImportSpecCollection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportCredentialsBadRequest creates a ExportCredentialsBadRequest with default headers values -func NewExportCredentialsBadRequest() *ExportCredentialsBadRequest { - return &ExportCredentialsBadRequest{} -} - -/* ExportCredentialsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ExportCredentialsBadRequest struct { - Payload *models.Error -} - -func (o *ExportCredentialsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/export][%d] exportCredentialsBadRequest %+v", 400, o.Payload) -} -func (o *ExportCredentialsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportCredentialsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportCredentialsUnauthorized creates a ExportCredentialsUnauthorized with default headers values -func NewExportCredentialsUnauthorized() *ExportCredentialsUnauthorized { - return &ExportCredentialsUnauthorized{} -} - -/* ExportCredentialsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ExportCredentialsUnauthorized struct { - Payload *models.Error -} - -func (o *ExportCredentialsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/export][%d] exportCredentialsUnauthorized %+v", 401, o.Payload) -} -func (o *ExportCredentialsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportCredentialsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportCredentialsForbidden creates a ExportCredentialsForbidden with default headers values -func NewExportCredentialsForbidden() *ExportCredentialsForbidden { - return &ExportCredentialsForbidden{} -} - -/* ExportCredentialsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ExportCredentialsForbidden struct { - Payload *models.Error -} - -func (o *ExportCredentialsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/export][%d] exportCredentialsForbidden %+v", 403, o.Payload) -} -func (o *ExportCredentialsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportCredentialsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportCredentialsInternalServerError creates a ExportCredentialsInternalServerError with default headers values -func NewExportCredentialsInternalServerError() *ExportCredentialsInternalServerError { - return &ExportCredentialsInternalServerError{} -} - -/* ExportCredentialsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ExportCredentialsInternalServerError struct { - Payload *models.Error -} - -func (o *ExportCredentialsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/export][%d] exportCredentialsInternalServerError %+v", 500, o.Payload) -} -func (o *ExportCredentialsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportCredentialsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/export_encryption_passwords_parameters.go b/client/automation/export_encryption_passwords_parameters.go deleted file mode 100644 index d829e83..0000000 --- a/client/automation/export_encryption_passwords_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewExportEncryptionPasswordsParams creates a new ExportEncryptionPasswordsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExportEncryptionPasswordsParams() *ExportEncryptionPasswordsParams { - return &ExportEncryptionPasswordsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExportEncryptionPasswordsParamsWithTimeout creates a new ExportEncryptionPasswordsParams object -// with the ability to set a timeout on a request. -func NewExportEncryptionPasswordsParamsWithTimeout(timeout time.Duration) *ExportEncryptionPasswordsParams { - return &ExportEncryptionPasswordsParams{ - timeout: timeout, - } -} - -// NewExportEncryptionPasswordsParamsWithContext creates a new ExportEncryptionPasswordsParams object -// with the ability to set a context for a request. -func NewExportEncryptionPasswordsParamsWithContext(ctx context.Context) *ExportEncryptionPasswordsParams { - return &ExportEncryptionPasswordsParams{ - Context: ctx, - } -} - -// NewExportEncryptionPasswordsParamsWithHTTPClient creates a new ExportEncryptionPasswordsParams object -// with the ability to set a custom HTTPClient for a request. -func NewExportEncryptionPasswordsParamsWithHTTPClient(client *http.Client) *ExportEncryptionPasswordsParams { - return &ExportEncryptionPasswordsParams{ - HTTPClient: client, - } -} - -/* ExportEncryptionPasswordsParams contains all the parameters to send to the API endpoint - for the export encryption passwords operation. - - Typically these are written to a http.Request. -*/ -type ExportEncryptionPasswordsParams struct { - - // Body. - Body *models.EncryptionPasswordExportSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the export encryption passwords params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportEncryptionPasswordsParams) WithDefaults() *ExportEncryptionPasswordsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the export encryption passwords params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportEncryptionPasswordsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ExportEncryptionPasswordsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) WithTimeout(timeout time.Duration) *ExportEncryptionPasswordsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) WithContext(ctx context.Context) *ExportEncryptionPasswordsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) WithHTTPClient(client *http.Client) *ExportEncryptionPasswordsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) WithBody(body *models.EncryptionPasswordExportSpec) *ExportEncryptionPasswordsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) SetBody(body *models.EncryptionPasswordExportSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) WithXAPIVersion(xAPIVersion string) *ExportEncryptionPasswordsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the export encryption passwords params -func (o *ExportEncryptionPasswordsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ExportEncryptionPasswordsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/export_encryption_passwords_responses.go b/client/automation/export_encryption_passwords_responses.go deleted file mode 100644 index ac2d796..0000000 --- a/client/automation/export_encryption_passwords_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ExportEncryptionPasswordsReader is a Reader for the ExportEncryptionPasswords structure. -type ExportEncryptionPasswordsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExportEncryptionPasswordsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExportEncryptionPasswordsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewExportEncryptionPasswordsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewExportEncryptionPasswordsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewExportEncryptionPasswordsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewExportEncryptionPasswordsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExportEncryptionPasswordsOK creates a ExportEncryptionPasswordsOK with default headers values -func NewExportEncryptionPasswordsOK() *ExportEncryptionPasswordsOK { - return &ExportEncryptionPasswordsOK{} -} - -/* ExportEncryptionPasswordsOK describes a response with status code 200, with default header values. - -OK -*/ -type ExportEncryptionPasswordsOK struct { - Payload *models.EncryptionPasswordImportSpecCollection -} - -func (o *ExportEncryptionPasswordsOK) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/export][%d] exportEncryptionPasswordsOK %+v", 200, o.Payload) -} -func (o *ExportEncryptionPasswordsOK) GetPayload() *models.EncryptionPasswordImportSpecCollection { - return o.Payload -} - -func (o *ExportEncryptionPasswordsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.EncryptionPasswordImportSpecCollection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportEncryptionPasswordsBadRequest creates a ExportEncryptionPasswordsBadRequest with default headers values -func NewExportEncryptionPasswordsBadRequest() *ExportEncryptionPasswordsBadRequest { - return &ExportEncryptionPasswordsBadRequest{} -} - -/* ExportEncryptionPasswordsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ExportEncryptionPasswordsBadRequest struct { - Payload *models.Error -} - -func (o *ExportEncryptionPasswordsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/export][%d] exportEncryptionPasswordsBadRequest %+v", 400, o.Payload) -} -func (o *ExportEncryptionPasswordsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportEncryptionPasswordsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportEncryptionPasswordsUnauthorized creates a ExportEncryptionPasswordsUnauthorized with default headers values -func NewExportEncryptionPasswordsUnauthorized() *ExportEncryptionPasswordsUnauthorized { - return &ExportEncryptionPasswordsUnauthorized{} -} - -/* ExportEncryptionPasswordsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ExportEncryptionPasswordsUnauthorized struct { - Payload *models.Error -} - -func (o *ExportEncryptionPasswordsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/export][%d] exportEncryptionPasswordsUnauthorized %+v", 401, o.Payload) -} -func (o *ExportEncryptionPasswordsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportEncryptionPasswordsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportEncryptionPasswordsForbidden creates a ExportEncryptionPasswordsForbidden with default headers values -func NewExportEncryptionPasswordsForbidden() *ExportEncryptionPasswordsForbidden { - return &ExportEncryptionPasswordsForbidden{} -} - -/* ExportEncryptionPasswordsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ExportEncryptionPasswordsForbidden struct { - Payload *models.Error -} - -func (o *ExportEncryptionPasswordsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/export][%d] exportEncryptionPasswordsForbidden %+v", 403, o.Payload) -} -func (o *ExportEncryptionPasswordsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportEncryptionPasswordsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportEncryptionPasswordsInternalServerError creates a ExportEncryptionPasswordsInternalServerError with default headers values -func NewExportEncryptionPasswordsInternalServerError() *ExportEncryptionPasswordsInternalServerError { - return &ExportEncryptionPasswordsInternalServerError{} -} - -/* ExportEncryptionPasswordsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ExportEncryptionPasswordsInternalServerError struct { - Payload *models.Error -} - -func (o *ExportEncryptionPasswordsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/export][%d] exportEncryptionPasswordsInternalServerError %+v", 500, o.Payload) -} -func (o *ExportEncryptionPasswordsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportEncryptionPasswordsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/export_jobs_parameters.go b/client/automation/export_jobs_parameters.go deleted file mode 100644 index fa3107c..0000000 --- a/client/automation/export_jobs_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewExportJobsParams creates a new ExportJobsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExportJobsParams() *ExportJobsParams { - return &ExportJobsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExportJobsParamsWithTimeout creates a new ExportJobsParams object -// with the ability to set a timeout on a request. -func NewExportJobsParamsWithTimeout(timeout time.Duration) *ExportJobsParams { - return &ExportJobsParams{ - timeout: timeout, - } -} - -// NewExportJobsParamsWithContext creates a new ExportJobsParams object -// with the ability to set a context for a request. -func NewExportJobsParamsWithContext(ctx context.Context) *ExportJobsParams { - return &ExportJobsParams{ - Context: ctx, - } -} - -// NewExportJobsParamsWithHTTPClient creates a new ExportJobsParams object -// with the ability to set a custom HTTPClient for a request. -func NewExportJobsParamsWithHTTPClient(client *http.Client) *ExportJobsParams { - return &ExportJobsParams{ - HTTPClient: client, - } -} - -/* ExportJobsParams contains all the parameters to send to the API endpoint - for the export jobs operation. - - Typically these are written to a http.Request. -*/ -type ExportJobsParams struct { - - // Body. - Body *models.JobExportSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the export jobs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportJobsParams) WithDefaults() *ExportJobsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the export jobs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportJobsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ExportJobsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the export jobs params -func (o *ExportJobsParams) WithTimeout(timeout time.Duration) *ExportJobsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the export jobs params -func (o *ExportJobsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the export jobs params -func (o *ExportJobsParams) WithContext(ctx context.Context) *ExportJobsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the export jobs params -func (o *ExportJobsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the export jobs params -func (o *ExportJobsParams) WithHTTPClient(client *http.Client) *ExportJobsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the export jobs params -func (o *ExportJobsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the export jobs params -func (o *ExportJobsParams) WithBody(body *models.JobExportSpec) *ExportJobsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the export jobs params -func (o *ExportJobsParams) SetBody(body *models.JobExportSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the export jobs params -func (o *ExportJobsParams) WithXAPIVersion(xAPIVersion string) *ExportJobsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the export jobs params -func (o *ExportJobsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ExportJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/export_jobs_responses.go b/client/automation/export_jobs_responses.go deleted file mode 100644 index c92b1c8..0000000 --- a/client/automation/export_jobs_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ExportJobsReader is a Reader for the ExportJobs structure. -type ExportJobsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExportJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExportJobsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewExportJobsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewExportJobsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewExportJobsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewExportJobsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExportJobsOK creates a ExportJobsOK with default headers values -func NewExportJobsOK() *ExportJobsOK { - return &ExportJobsOK{} -} - -/* ExportJobsOK describes a response with status code 200, with default header values. - -OK -*/ -type ExportJobsOK struct { - Payload *models.JobImportSpecCollection -} - -func (o *ExportJobsOK) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/export][%d] exportJobsOK %+v", 200, o.Payload) -} -func (o *ExportJobsOK) GetPayload() *models.JobImportSpecCollection { - return o.Payload -} - -func (o *ExportJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobImportSpecCollection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportJobsBadRequest creates a ExportJobsBadRequest with default headers values -func NewExportJobsBadRequest() *ExportJobsBadRequest { - return &ExportJobsBadRequest{} -} - -/* ExportJobsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ExportJobsBadRequest struct { - Payload *models.Error -} - -func (o *ExportJobsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/export][%d] exportJobsBadRequest %+v", 400, o.Payload) -} -func (o *ExportJobsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportJobsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportJobsUnauthorized creates a ExportJobsUnauthorized with default headers values -func NewExportJobsUnauthorized() *ExportJobsUnauthorized { - return &ExportJobsUnauthorized{} -} - -/* ExportJobsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ExportJobsUnauthorized struct { - Payload *models.Error -} - -func (o *ExportJobsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/export][%d] exportJobsUnauthorized %+v", 401, o.Payload) -} -func (o *ExportJobsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportJobsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportJobsForbidden creates a ExportJobsForbidden with default headers values -func NewExportJobsForbidden() *ExportJobsForbidden { - return &ExportJobsForbidden{} -} - -/* ExportJobsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ExportJobsForbidden struct { - Payload *models.Error -} - -func (o *ExportJobsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/export][%d] exportJobsForbidden %+v", 403, o.Payload) -} -func (o *ExportJobsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportJobsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportJobsInternalServerError creates a ExportJobsInternalServerError with default headers values -func NewExportJobsInternalServerError() *ExportJobsInternalServerError { - return &ExportJobsInternalServerError{} -} - -/* ExportJobsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ExportJobsInternalServerError struct { - Payload *models.Error -} - -func (o *ExportJobsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/export][%d] exportJobsInternalServerError %+v", 500, o.Payload) -} -func (o *ExportJobsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportJobsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/export_managed_servers_parameters.go b/client/automation/export_managed_servers_parameters.go deleted file mode 100644 index 36d23fa..0000000 --- a/client/automation/export_managed_servers_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewExportManagedServersParams creates a new ExportManagedServersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExportManagedServersParams() *ExportManagedServersParams { - return &ExportManagedServersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExportManagedServersParamsWithTimeout creates a new ExportManagedServersParams object -// with the ability to set a timeout on a request. -func NewExportManagedServersParamsWithTimeout(timeout time.Duration) *ExportManagedServersParams { - return &ExportManagedServersParams{ - timeout: timeout, - } -} - -// NewExportManagedServersParamsWithContext creates a new ExportManagedServersParams object -// with the ability to set a context for a request. -func NewExportManagedServersParamsWithContext(ctx context.Context) *ExportManagedServersParams { - return &ExportManagedServersParams{ - Context: ctx, - } -} - -// NewExportManagedServersParamsWithHTTPClient creates a new ExportManagedServersParams object -// with the ability to set a custom HTTPClient for a request. -func NewExportManagedServersParamsWithHTTPClient(client *http.Client) *ExportManagedServersParams { - return &ExportManagedServersParams{ - HTTPClient: client, - } -} - -/* ExportManagedServersParams contains all the parameters to send to the API endpoint - for the export managed servers operation. - - Typically these are written to a http.Request. -*/ -type ExportManagedServersParams struct { - - // Body. - Body *models.ManageServerExportSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the export managed servers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportManagedServersParams) WithDefaults() *ExportManagedServersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the export managed servers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportManagedServersParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ExportManagedServersParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the export managed servers params -func (o *ExportManagedServersParams) WithTimeout(timeout time.Duration) *ExportManagedServersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the export managed servers params -func (o *ExportManagedServersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the export managed servers params -func (o *ExportManagedServersParams) WithContext(ctx context.Context) *ExportManagedServersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the export managed servers params -func (o *ExportManagedServersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the export managed servers params -func (o *ExportManagedServersParams) WithHTTPClient(client *http.Client) *ExportManagedServersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the export managed servers params -func (o *ExportManagedServersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the export managed servers params -func (o *ExportManagedServersParams) WithBody(body *models.ManageServerExportSpec) *ExportManagedServersParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the export managed servers params -func (o *ExportManagedServersParams) SetBody(body *models.ManageServerExportSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the export managed servers params -func (o *ExportManagedServersParams) WithXAPIVersion(xAPIVersion string) *ExportManagedServersParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the export managed servers params -func (o *ExportManagedServersParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ExportManagedServersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/export_managed_servers_responses.go b/client/automation/export_managed_servers_responses.go deleted file mode 100644 index 4c531c4..0000000 --- a/client/automation/export_managed_servers_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ExportManagedServersReader is a Reader for the ExportManagedServers structure. -type ExportManagedServersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExportManagedServersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExportManagedServersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewExportManagedServersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewExportManagedServersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewExportManagedServersForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewExportManagedServersInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExportManagedServersOK creates a ExportManagedServersOK with default headers values -func NewExportManagedServersOK() *ExportManagedServersOK { - return &ExportManagedServersOK{} -} - -/* ExportManagedServersOK describes a response with status code 200, with default header values. - -OK -*/ -type ExportManagedServersOK struct { - Payload *models.ManageServerImportSpecCollection -} - -func (o *ExportManagedServersOK) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/export][%d] exportManagedServersOK %+v", 200, o.Payload) -} -func (o *ExportManagedServersOK) GetPayload() *models.ManageServerImportSpecCollection { - return o.Payload -} - -func (o *ExportManagedServersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ManageServerImportSpecCollection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportManagedServersBadRequest creates a ExportManagedServersBadRequest with default headers values -func NewExportManagedServersBadRequest() *ExportManagedServersBadRequest { - return &ExportManagedServersBadRequest{} -} - -/* ExportManagedServersBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ExportManagedServersBadRequest struct { - Payload *models.Error -} - -func (o *ExportManagedServersBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/export][%d] exportManagedServersBadRequest %+v", 400, o.Payload) -} -func (o *ExportManagedServersBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportManagedServersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportManagedServersUnauthorized creates a ExportManagedServersUnauthorized with default headers values -func NewExportManagedServersUnauthorized() *ExportManagedServersUnauthorized { - return &ExportManagedServersUnauthorized{} -} - -/* ExportManagedServersUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ExportManagedServersUnauthorized struct { - Payload *models.Error -} - -func (o *ExportManagedServersUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/export][%d] exportManagedServersUnauthorized %+v", 401, o.Payload) -} -func (o *ExportManagedServersUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportManagedServersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportManagedServersForbidden creates a ExportManagedServersForbidden with default headers values -func NewExportManagedServersForbidden() *ExportManagedServersForbidden { - return &ExportManagedServersForbidden{} -} - -/* ExportManagedServersForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ExportManagedServersForbidden struct { - Payload *models.Error -} - -func (o *ExportManagedServersForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/export][%d] exportManagedServersForbidden %+v", 403, o.Payload) -} -func (o *ExportManagedServersForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportManagedServersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportManagedServersInternalServerError creates a ExportManagedServersInternalServerError with default headers values -func NewExportManagedServersInternalServerError() *ExportManagedServersInternalServerError { - return &ExportManagedServersInternalServerError{} -} - -/* ExportManagedServersInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ExportManagedServersInternalServerError struct { - Payload *models.Error -} - -func (o *ExportManagedServersInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/export][%d] exportManagedServersInternalServerError %+v", 500, o.Payload) -} -func (o *ExportManagedServersInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportManagedServersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/export_proxies_parameters.go b/client/automation/export_proxies_parameters.go deleted file mode 100644 index 2a7f0b2..0000000 --- a/client/automation/export_proxies_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewExportProxiesParams creates a new ExportProxiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExportProxiesParams() *ExportProxiesParams { - return &ExportProxiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExportProxiesParamsWithTimeout creates a new ExportProxiesParams object -// with the ability to set a timeout on a request. -func NewExportProxiesParamsWithTimeout(timeout time.Duration) *ExportProxiesParams { - return &ExportProxiesParams{ - timeout: timeout, - } -} - -// NewExportProxiesParamsWithContext creates a new ExportProxiesParams object -// with the ability to set a context for a request. -func NewExportProxiesParamsWithContext(ctx context.Context) *ExportProxiesParams { - return &ExportProxiesParams{ - Context: ctx, - } -} - -// NewExportProxiesParamsWithHTTPClient creates a new ExportProxiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewExportProxiesParamsWithHTTPClient(client *http.Client) *ExportProxiesParams { - return &ExportProxiesParams{ - HTTPClient: client, - } -} - -/* ExportProxiesParams contains all the parameters to send to the API endpoint - for the export proxies operation. - - Typically these are written to a http.Request. -*/ -type ExportProxiesParams struct { - - // Body. - Body *models.ProxyExportSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the export proxies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportProxiesParams) WithDefaults() *ExportProxiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the export proxies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportProxiesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ExportProxiesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the export proxies params -func (o *ExportProxiesParams) WithTimeout(timeout time.Duration) *ExportProxiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the export proxies params -func (o *ExportProxiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the export proxies params -func (o *ExportProxiesParams) WithContext(ctx context.Context) *ExportProxiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the export proxies params -func (o *ExportProxiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the export proxies params -func (o *ExportProxiesParams) WithHTTPClient(client *http.Client) *ExportProxiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the export proxies params -func (o *ExportProxiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the export proxies params -func (o *ExportProxiesParams) WithBody(body *models.ProxyExportSpec) *ExportProxiesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the export proxies params -func (o *ExportProxiesParams) SetBody(body *models.ProxyExportSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the export proxies params -func (o *ExportProxiesParams) WithXAPIVersion(xAPIVersion string) *ExportProxiesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the export proxies params -func (o *ExportProxiesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ExportProxiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/export_proxies_responses.go b/client/automation/export_proxies_responses.go deleted file mode 100644 index c4f3c63..0000000 --- a/client/automation/export_proxies_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ExportProxiesReader is a Reader for the ExportProxies structure. -type ExportProxiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExportProxiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExportProxiesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewExportProxiesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewExportProxiesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewExportProxiesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewExportProxiesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExportProxiesOK creates a ExportProxiesOK with default headers values -func NewExportProxiesOK() *ExportProxiesOK { - return &ExportProxiesOK{} -} - -/* ExportProxiesOK describes a response with status code 200, with default header values. - -OK -*/ -type ExportProxiesOK struct { - Payload *models.ProxyImportSpecCollection -} - -func (o *ExportProxiesOK) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/export][%d] exportProxiesOK %+v", 200, o.Payload) -} -func (o *ExportProxiesOK) GetPayload() *models.ProxyImportSpecCollection { - return o.Payload -} - -func (o *ExportProxiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ProxyImportSpecCollection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportProxiesBadRequest creates a ExportProxiesBadRequest with default headers values -func NewExportProxiesBadRequest() *ExportProxiesBadRequest { - return &ExportProxiesBadRequest{} -} - -/* ExportProxiesBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ExportProxiesBadRequest struct { - Payload *models.Error -} - -func (o *ExportProxiesBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/export][%d] exportProxiesBadRequest %+v", 400, o.Payload) -} -func (o *ExportProxiesBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportProxiesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportProxiesUnauthorized creates a ExportProxiesUnauthorized with default headers values -func NewExportProxiesUnauthorized() *ExportProxiesUnauthorized { - return &ExportProxiesUnauthorized{} -} - -/* ExportProxiesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ExportProxiesUnauthorized struct { - Payload *models.Error -} - -func (o *ExportProxiesUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/export][%d] exportProxiesUnauthorized %+v", 401, o.Payload) -} -func (o *ExportProxiesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportProxiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportProxiesForbidden creates a ExportProxiesForbidden with default headers values -func NewExportProxiesForbidden() *ExportProxiesForbidden { - return &ExportProxiesForbidden{} -} - -/* ExportProxiesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ExportProxiesForbidden struct { - Payload *models.Error -} - -func (o *ExportProxiesForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/export][%d] exportProxiesForbidden %+v", 403, o.Payload) -} -func (o *ExportProxiesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportProxiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportProxiesInternalServerError creates a ExportProxiesInternalServerError with default headers values -func NewExportProxiesInternalServerError() *ExportProxiesInternalServerError { - return &ExportProxiesInternalServerError{} -} - -/* ExportProxiesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ExportProxiesInternalServerError struct { - Payload *models.Error -} - -func (o *ExportProxiesInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/export][%d] exportProxiesInternalServerError %+v", 500, o.Payload) -} -func (o *ExportProxiesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportProxiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/export_repositories_parameters.go b/client/automation/export_repositories_parameters.go deleted file mode 100644 index fa5ae0a..0000000 --- a/client/automation/export_repositories_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewExportRepositoriesParams creates a new ExportRepositoriesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExportRepositoriesParams() *ExportRepositoriesParams { - return &ExportRepositoriesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExportRepositoriesParamsWithTimeout creates a new ExportRepositoriesParams object -// with the ability to set a timeout on a request. -func NewExportRepositoriesParamsWithTimeout(timeout time.Duration) *ExportRepositoriesParams { - return &ExportRepositoriesParams{ - timeout: timeout, - } -} - -// NewExportRepositoriesParamsWithContext creates a new ExportRepositoriesParams object -// with the ability to set a context for a request. -func NewExportRepositoriesParamsWithContext(ctx context.Context) *ExportRepositoriesParams { - return &ExportRepositoriesParams{ - Context: ctx, - } -} - -// NewExportRepositoriesParamsWithHTTPClient creates a new ExportRepositoriesParams object -// with the ability to set a custom HTTPClient for a request. -func NewExportRepositoriesParamsWithHTTPClient(client *http.Client) *ExportRepositoriesParams { - return &ExportRepositoriesParams{ - HTTPClient: client, - } -} - -/* ExportRepositoriesParams contains all the parameters to send to the API endpoint - for the export repositories operation. - - Typically these are written to a http.Request. -*/ -type ExportRepositoriesParams struct { - - // Body. - Body *models.RepositoryExportSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the export repositories params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportRepositoriesParams) WithDefaults() *ExportRepositoriesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the export repositories params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExportRepositoriesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ExportRepositoriesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the export repositories params -func (o *ExportRepositoriesParams) WithTimeout(timeout time.Duration) *ExportRepositoriesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the export repositories params -func (o *ExportRepositoriesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the export repositories params -func (o *ExportRepositoriesParams) WithContext(ctx context.Context) *ExportRepositoriesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the export repositories params -func (o *ExportRepositoriesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the export repositories params -func (o *ExportRepositoriesParams) WithHTTPClient(client *http.Client) *ExportRepositoriesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the export repositories params -func (o *ExportRepositoriesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the export repositories params -func (o *ExportRepositoriesParams) WithBody(body *models.RepositoryExportSpec) *ExportRepositoriesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the export repositories params -func (o *ExportRepositoriesParams) SetBody(body *models.RepositoryExportSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the export repositories params -func (o *ExportRepositoriesParams) WithXAPIVersion(xAPIVersion string) *ExportRepositoriesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the export repositories params -func (o *ExportRepositoriesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ExportRepositoriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/export_repositories_responses.go b/client/automation/export_repositories_responses.go deleted file mode 100644 index 17fe4fb..0000000 --- a/client/automation/export_repositories_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ExportRepositoriesReader is a Reader for the ExportRepositories structure. -type ExportRepositoriesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExportRepositoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExportRepositoriesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewExportRepositoriesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewExportRepositoriesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewExportRepositoriesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewExportRepositoriesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExportRepositoriesOK creates a ExportRepositoriesOK with default headers values -func NewExportRepositoriesOK() *ExportRepositoriesOK { - return &ExportRepositoriesOK{} -} - -/* ExportRepositoriesOK describes a response with status code 200, with default header values. - -OK -*/ -type ExportRepositoriesOK struct { - Payload *models.RepositoryImportSpecCollection -} - -func (o *ExportRepositoriesOK) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/export][%d] exportRepositoriesOK %+v", 200, o.Payload) -} -func (o *ExportRepositoriesOK) GetPayload() *models.RepositoryImportSpecCollection { - return o.Payload -} - -func (o *ExportRepositoriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.RepositoryImportSpecCollection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportRepositoriesBadRequest creates a ExportRepositoriesBadRequest with default headers values -func NewExportRepositoriesBadRequest() *ExportRepositoriesBadRequest { - return &ExportRepositoriesBadRequest{} -} - -/* ExportRepositoriesBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ExportRepositoriesBadRequest struct { - Payload *models.Error -} - -func (o *ExportRepositoriesBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/export][%d] exportRepositoriesBadRequest %+v", 400, o.Payload) -} -func (o *ExportRepositoriesBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportRepositoriesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportRepositoriesUnauthorized creates a ExportRepositoriesUnauthorized with default headers values -func NewExportRepositoriesUnauthorized() *ExportRepositoriesUnauthorized { - return &ExportRepositoriesUnauthorized{} -} - -/* ExportRepositoriesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ExportRepositoriesUnauthorized struct { - Payload *models.Error -} - -func (o *ExportRepositoriesUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/export][%d] exportRepositoriesUnauthorized %+v", 401, o.Payload) -} -func (o *ExportRepositoriesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportRepositoriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportRepositoriesForbidden creates a ExportRepositoriesForbidden with default headers values -func NewExportRepositoriesForbidden() *ExportRepositoriesForbidden { - return &ExportRepositoriesForbidden{} -} - -/* ExportRepositoriesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ExportRepositoriesForbidden struct { - Payload *models.Error -} - -func (o *ExportRepositoriesForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/export][%d] exportRepositoriesForbidden %+v", 403, o.Payload) -} -func (o *ExportRepositoriesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportRepositoriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExportRepositoriesInternalServerError creates a ExportRepositoriesInternalServerError with default headers values -func NewExportRepositoriesInternalServerError() *ExportRepositoriesInternalServerError { - return &ExportRepositoriesInternalServerError{} -} - -/* ExportRepositoriesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ExportRepositoriesInternalServerError struct { - Payload *models.Error -} - -func (o *ExportRepositoriesInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/export][%d] exportRepositoriesInternalServerError %+v", 500, o.Payload) -} -func (o *ExportRepositoriesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ExportRepositoriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/get_all_automation_sessions_parameters.go b/client/automation/get_all_automation_sessions_parameters.go deleted file mode 100644 index c2d8934..0000000 --- a/client/automation/get_all_automation_sessions_parameters.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllAutomationSessionsParams creates a new GetAllAutomationSessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllAutomationSessionsParams() *GetAllAutomationSessionsParams { - return &GetAllAutomationSessionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllAutomationSessionsParamsWithTimeout creates a new GetAllAutomationSessionsParams object -// with the ability to set a timeout on a request. -func NewGetAllAutomationSessionsParamsWithTimeout(timeout time.Duration) *GetAllAutomationSessionsParams { - return &GetAllAutomationSessionsParams{ - timeout: timeout, - } -} - -// NewGetAllAutomationSessionsParamsWithContext creates a new GetAllAutomationSessionsParams object -// with the ability to set a context for a request. -func NewGetAllAutomationSessionsParamsWithContext(ctx context.Context) *GetAllAutomationSessionsParams { - return &GetAllAutomationSessionsParams{ - Context: ctx, - } -} - -// NewGetAllAutomationSessionsParamsWithHTTPClient creates a new GetAllAutomationSessionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllAutomationSessionsParamsWithHTTPClient(client *http.Client) *GetAllAutomationSessionsParams { - return &GetAllAutomationSessionsParams{ - HTTPClient: client, - } -} - -/* GetAllAutomationSessionsParams contains all the parameters to send to the API endpoint - for the get all automation sessions operation. - - Typically these are written to a http.Request. -*/ -type GetAllAutomationSessionsParams struct { - - /* CreatedAfterFilter. - - Returns sessions that are created after the specified date and time. - - Format: date-time - */ - CreatedAfterFilter *strfmt.DateTime - - /* CreatedBeforeFilter. - - Returns sessions that are created before the specified date and time. - - Format: date-time - */ - CreatedBeforeFilter *strfmt.DateTime - - /* EndedAfterFilter. - - Returns sessions that are finished after the specified date and time. - - Format: date-time - */ - EndedAfterFilter *strfmt.DateTime - - /* EndedBeforeFilter. - - Returns sessions that are finished before the specified date and time. - - Format: date-time - */ - EndedBeforeFilter *strfmt.DateTime - - /* JobIDFilter. - - Filters sessions by job ID. - - Format: uuid - */ - JobIDFilter *strfmt.UUID - - /* Limit. - - Maximum number of sessions to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters sessions by the `nameFilter` pattern. The pattern can match any session parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts sessions in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts sessions by one of the session parameters. - */ - OrderColumn *string - - /* ResultFilter. - - Filters sessions by session result. - */ - ResultFilter *string - - /* Skip. - - Number of sessions to skip. - - Format: int32 - */ - Skip *int32 - - /* StateFilter. - - Filters sessions by session state. - */ - StateFilter *string - - /* TypeFilter. - - Filters sessions by session type. - */ - TypeFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all automation sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllAutomationSessionsParams) WithDefaults() *GetAllAutomationSessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all automation sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllAutomationSessionsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllAutomationSessionsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithTimeout(timeout time.Duration) *GetAllAutomationSessionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithContext(ctx context.Context) *GetAllAutomationSessionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithHTTPClient(client *http.Client) *GetAllAutomationSessionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCreatedAfterFilter adds the createdAfterFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithCreatedAfterFilter(createdAfterFilter *strfmt.DateTime) *GetAllAutomationSessionsParams { - o.SetCreatedAfterFilter(createdAfterFilter) - return o -} - -// SetCreatedAfterFilter adds the createdAfterFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetCreatedAfterFilter(createdAfterFilter *strfmt.DateTime) { - o.CreatedAfterFilter = createdAfterFilter -} - -// WithCreatedBeforeFilter adds the createdBeforeFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithCreatedBeforeFilter(createdBeforeFilter *strfmt.DateTime) *GetAllAutomationSessionsParams { - o.SetCreatedBeforeFilter(createdBeforeFilter) - return o -} - -// SetCreatedBeforeFilter adds the createdBeforeFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetCreatedBeforeFilter(createdBeforeFilter *strfmt.DateTime) { - o.CreatedBeforeFilter = createdBeforeFilter -} - -// WithEndedAfterFilter adds the endedAfterFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithEndedAfterFilter(endedAfterFilter *strfmt.DateTime) *GetAllAutomationSessionsParams { - o.SetEndedAfterFilter(endedAfterFilter) - return o -} - -// SetEndedAfterFilter adds the endedAfterFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetEndedAfterFilter(endedAfterFilter *strfmt.DateTime) { - o.EndedAfterFilter = endedAfterFilter -} - -// WithEndedBeforeFilter adds the endedBeforeFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithEndedBeforeFilter(endedBeforeFilter *strfmt.DateTime) *GetAllAutomationSessionsParams { - o.SetEndedBeforeFilter(endedBeforeFilter) - return o -} - -// SetEndedBeforeFilter adds the endedBeforeFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetEndedBeforeFilter(endedBeforeFilter *strfmt.DateTime) { - o.EndedBeforeFilter = endedBeforeFilter -} - -// WithJobIDFilter adds the jobIDFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithJobIDFilter(jobIDFilter *strfmt.UUID) *GetAllAutomationSessionsParams { - o.SetJobIDFilter(jobIDFilter) - return o -} - -// SetJobIDFilter adds the jobIdFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetJobIDFilter(jobIDFilter *strfmt.UUID) { - o.JobIDFilter = jobIDFilter -} - -// WithLimit adds the limit to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithLimit(limit *int32) *GetAllAutomationSessionsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithNameFilter(nameFilter *string) *GetAllAutomationSessionsParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithOrderAsc(orderAsc *bool) *GetAllAutomationSessionsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithOrderColumn(orderColumn *string) *GetAllAutomationSessionsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithResultFilter adds the resultFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithResultFilter(resultFilter *string) *GetAllAutomationSessionsParams { - o.SetResultFilter(resultFilter) - return o -} - -// SetResultFilter adds the resultFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetResultFilter(resultFilter *string) { - o.ResultFilter = resultFilter -} - -// WithSkip adds the skip to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithSkip(skip *int32) *GetAllAutomationSessionsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithStateFilter adds the stateFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithStateFilter(stateFilter *string) *GetAllAutomationSessionsParams { - o.SetStateFilter(stateFilter) - return o -} - -// SetStateFilter adds the stateFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetStateFilter(stateFilter *string) { - o.StateFilter = stateFilter -} - -// WithTypeFilter adds the typeFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithTypeFilter(typeFilter *string) *GetAllAutomationSessionsParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) WithXAPIVersion(xAPIVersion string) *GetAllAutomationSessionsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all automation sessions params -func (o *GetAllAutomationSessionsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllAutomationSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.CreatedAfterFilter != nil { - - // query param createdAfterFilter - var qrCreatedAfterFilter strfmt.DateTime - - if o.CreatedAfterFilter != nil { - qrCreatedAfterFilter = *o.CreatedAfterFilter - } - qCreatedAfterFilter := qrCreatedAfterFilter.String() - if qCreatedAfterFilter != "" { - - if err := r.SetQueryParam("createdAfterFilter", qCreatedAfterFilter); err != nil { - return err - } - } - } - - if o.CreatedBeforeFilter != nil { - - // query param createdBeforeFilter - var qrCreatedBeforeFilter strfmt.DateTime - - if o.CreatedBeforeFilter != nil { - qrCreatedBeforeFilter = *o.CreatedBeforeFilter - } - qCreatedBeforeFilter := qrCreatedBeforeFilter.String() - if qCreatedBeforeFilter != "" { - - if err := r.SetQueryParam("createdBeforeFilter", qCreatedBeforeFilter); err != nil { - return err - } - } - } - - if o.EndedAfterFilter != nil { - - // query param endedAfterFilter - var qrEndedAfterFilter strfmt.DateTime - - if o.EndedAfterFilter != nil { - qrEndedAfterFilter = *o.EndedAfterFilter - } - qEndedAfterFilter := qrEndedAfterFilter.String() - if qEndedAfterFilter != "" { - - if err := r.SetQueryParam("endedAfterFilter", qEndedAfterFilter); err != nil { - return err - } - } - } - - if o.EndedBeforeFilter != nil { - - // query param endedBeforeFilter - var qrEndedBeforeFilter strfmt.DateTime - - if o.EndedBeforeFilter != nil { - qrEndedBeforeFilter = *o.EndedBeforeFilter - } - qEndedBeforeFilter := qrEndedBeforeFilter.String() - if qEndedBeforeFilter != "" { - - if err := r.SetQueryParam("endedBeforeFilter", qEndedBeforeFilter); err != nil { - return err - } - } - } - - if o.JobIDFilter != nil { - - // query param jobIdFilter - var qrJobIDFilter strfmt.UUID - - if o.JobIDFilter != nil { - qrJobIDFilter = *o.JobIDFilter - } - qJobIDFilter := qrJobIDFilter.String() - if qJobIDFilter != "" { - - if err := r.SetQueryParam("jobIdFilter", qJobIDFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.ResultFilter != nil { - - // query param resultFilter - var qrResultFilter string - - if o.ResultFilter != nil { - qrResultFilter = *o.ResultFilter - } - qResultFilter := qrResultFilter - if qResultFilter != "" { - - if err := r.SetQueryParam("resultFilter", qResultFilter); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.StateFilter != nil { - - // query param stateFilter - var qrStateFilter string - - if o.StateFilter != nil { - qrStateFilter = *o.StateFilter - } - qStateFilter := qrStateFilter - if qStateFilter != "" { - - if err := r.SetQueryParam("stateFilter", qStateFilter); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/get_all_automation_sessions_responses.go b/client/automation/get_all_automation_sessions_responses.go deleted file mode 100644 index 4725f04..0000000 --- a/client/automation/get_all_automation_sessions_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllAutomationSessionsReader is a Reader for the GetAllAutomationSessions structure. -type GetAllAutomationSessionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllAutomationSessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllAutomationSessionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllAutomationSessionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllAutomationSessionsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllAutomationSessionsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllAutomationSessionsOK creates a GetAllAutomationSessionsOK with default headers values -func NewGetAllAutomationSessionsOK() *GetAllAutomationSessionsOK { - return &GetAllAutomationSessionsOK{} -} - -/* GetAllAutomationSessionsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllAutomationSessionsOK struct { - Payload *models.SessionsResult -} - -func (o *GetAllAutomationSessionsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions][%d] getAllAutomationSessionsOK %+v", 200, o.Payload) -} -func (o *GetAllAutomationSessionsOK) GetPayload() *models.SessionsResult { - return o.Payload -} - -func (o *GetAllAutomationSessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllAutomationSessionsUnauthorized creates a GetAllAutomationSessionsUnauthorized with default headers values -func NewGetAllAutomationSessionsUnauthorized() *GetAllAutomationSessionsUnauthorized { - return &GetAllAutomationSessionsUnauthorized{} -} - -/* GetAllAutomationSessionsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllAutomationSessionsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllAutomationSessionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions][%d] getAllAutomationSessionsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllAutomationSessionsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllAutomationSessionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllAutomationSessionsForbidden creates a GetAllAutomationSessionsForbidden with default headers values -func NewGetAllAutomationSessionsForbidden() *GetAllAutomationSessionsForbidden { - return &GetAllAutomationSessionsForbidden{} -} - -/* GetAllAutomationSessionsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllAutomationSessionsForbidden struct { - Payload *models.Error -} - -func (o *GetAllAutomationSessionsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions][%d] getAllAutomationSessionsForbidden %+v", 403, o.Payload) -} -func (o *GetAllAutomationSessionsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllAutomationSessionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllAutomationSessionsInternalServerError creates a GetAllAutomationSessionsInternalServerError with default headers values -func NewGetAllAutomationSessionsInternalServerError() *GetAllAutomationSessionsInternalServerError { - return &GetAllAutomationSessionsInternalServerError{} -} - -/* GetAllAutomationSessionsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllAutomationSessionsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllAutomationSessionsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions][%d] getAllAutomationSessionsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllAutomationSessionsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllAutomationSessionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/get_automation_session_logs_parameters.go b/client/automation/get_automation_session_logs_parameters.go deleted file mode 100644 index 32536b6..0000000 --- a/client/automation/get_automation_session_logs_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetAutomationSessionLogsParams creates a new GetAutomationSessionLogsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAutomationSessionLogsParams() *GetAutomationSessionLogsParams { - return &GetAutomationSessionLogsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAutomationSessionLogsParamsWithTimeout creates a new GetAutomationSessionLogsParams object -// with the ability to set a timeout on a request. -func NewGetAutomationSessionLogsParamsWithTimeout(timeout time.Duration) *GetAutomationSessionLogsParams { - return &GetAutomationSessionLogsParams{ - timeout: timeout, - } -} - -// NewGetAutomationSessionLogsParamsWithContext creates a new GetAutomationSessionLogsParams object -// with the ability to set a context for a request. -func NewGetAutomationSessionLogsParamsWithContext(ctx context.Context) *GetAutomationSessionLogsParams { - return &GetAutomationSessionLogsParams{ - Context: ctx, - } -} - -// NewGetAutomationSessionLogsParamsWithHTTPClient creates a new GetAutomationSessionLogsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAutomationSessionLogsParamsWithHTTPClient(client *http.Client) *GetAutomationSessionLogsParams { - return &GetAutomationSessionLogsParams{ - HTTPClient: client, - } -} - -/* GetAutomationSessionLogsParams contains all the parameters to send to the API endpoint - for the get automation session logs operation. - - Typically these are written to a http.Request. -*/ -type GetAutomationSessionLogsParams struct { - - /* ID. - - ID of the session. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get automation session logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAutomationSessionLogsParams) WithDefaults() *GetAutomationSessionLogsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get automation session logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAutomationSessionLogsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAutomationSessionLogsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get automation session logs params -func (o *GetAutomationSessionLogsParams) WithTimeout(timeout time.Duration) *GetAutomationSessionLogsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get automation session logs params -func (o *GetAutomationSessionLogsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get automation session logs params -func (o *GetAutomationSessionLogsParams) WithContext(ctx context.Context) *GetAutomationSessionLogsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get automation session logs params -func (o *GetAutomationSessionLogsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get automation session logs params -func (o *GetAutomationSessionLogsParams) WithHTTPClient(client *http.Client) *GetAutomationSessionLogsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get automation session logs params -func (o *GetAutomationSessionLogsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get automation session logs params -func (o *GetAutomationSessionLogsParams) WithID(id strfmt.UUID) *GetAutomationSessionLogsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get automation session logs params -func (o *GetAutomationSessionLogsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get automation session logs params -func (o *GetAutomationSessionLogsParams) WithXAPIVersion(xAPIVersion string) *GetAutomationSessionLogsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get automation session logs params -func (o *GetAutomationSessionLogsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAutomationSessionLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/get_automation_session_logs_responses.go b/client/automation/get_automation_session_logs_responses.go deleted file mode 100644 index 7d21d66..0000000 --- a/client/automation/get_automation_session_logs_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAutomationSessionLogsReader is a Reader for the GetAutomationSessionLogs structure. -type GetAutomationSessionLogsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAutomationSessionLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAutomationSessionLogsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAutomationSessionLogsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAutomationSessionLogsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetAutomationSessionLogsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAutomationSessionLogsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAutomationSessionLogsOK creates a GetAutomationSessionLogsOK with default headers values -func NewGetAutomationSessionLogsOK() *GetAutomationSessionLogsOK { - return &GetAutomationSessionLogsOK{} -} - -/* GetAutomationSessionLogsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAutomationSessionLogsOK struct { - Payload *models.SessionLogResult -} - -func (o *GetAutomationSessionLogsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}/logs][%d] getAutomationSessionLogsOK %+v", 200, o.Payload) -} -func (o *GetAutomationSessionLogsOK) GetPayload() *models.SessionLogResult { - return o.Payload -} - -func (o *GetAutomationSessionLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionLogResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutomationSessionLogsUnauthorized creates a GetAutomationSessionLogsUnauthorized with default headers values -func NewGetAutomationSessionLogsUnauthorized() *GetAutomationSessionLogsUnauthorized { - return &GetAutomationSessionLogsUnauthorized{} -} - -/* GetAutomationSessionLogsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAutomationSessionLogsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAutomationSessionLogsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}/logs][%d] getAutomationSessionLogsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAutomationSessionLogsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAutomationSessionLogsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutomationSessionLogsForbidden creates a GetAutomationSessionLogsForbidden with default headers values -func NewGetAutomationSessionLogsForbidden() *GetAutomationSessionLogsForbidden { - return &GetAutomationSessionLogsForbidden{} -} - -/* GetAutomationSessionLogsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAutomationSessionLogsForbidden struct { - Payload *models.Error -} - -func (o *GetAutomationSessionLogsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}/logs][%d] getAutomationSessionLogsForbidden %+v", 403, o.Payload) -} -func (o *GetAutomationSessionLogsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAutomationSessionLogsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutomationSessionLogsNotFound creates a GetAutomationSessionLogsNotFound with default headers values -func NewGetAutomationSessionLogsNotFound() *GetAutomationSessionLogsNotFound { - return &GetAutomationSessionLogsNotFound{} -} - -/* GetAutomationSessionLogsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetAutomationSessionLogsNotFound struct { - Payload *models.Error -} - -func (o *GetAutomationSessionLogsNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}/logs][%d] getAutomationSessionLogsNotFound %+v", 404, o.Payload) -} -func (o *GetAutomationSessionLogsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAutomationSessionLogsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutomationSessionLogsInternalServerError creates a GetAutomationSessionLogsInternalServerError with default headers values -func NewGetAutomationSessionLogsInternalServerError() *GetAutomationSessionLogsInternalServerError { - return &GetAutomationSessionLogsInternalServerError{} -} - -/* GetAutomationSessionLogsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAutomationSessionLogsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAutomationSessionLogsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}/logs][%d] getAutomationSessionLogsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAutomationSessionLogsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAutomationSessionLogsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/get_automation_session_parameters.go b/client/automation/get_automation_session_parameters.go deleted file mode 100644 index c8ff35e..0000000 --- a/client/automation/get_automation_session_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetAutomationSessionParams creates a new GetAutomationSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAutomationSessionParams() *GetAutomationSessionParams { - return &GetAutomationSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAutomationSessionParamsWithTimeout creates a new GetAutomationSessionParams object -// with the ability to set a timeout on a request. -func NewGetAutomationSessionParamsWithTimeout(timeout time.Duration) *GetAutomationSessionParams { - return &GetAutomationSessionParams{ - timeout: timeout, - } -} - -// NewGetAutomationSessionParamsWithContext creates a new GetAutomationSessionParams object -// with the ability to set a context for a request. -func NewGetAutomationSessionParamsWithContext(ctx context.Context) *GetAutomationSessionParams { - return &GetAutomationSessionParams{ - Context: ctx, - } -} - -// NewGetAutomationSessionParamsWithHTTPClient creates a new GetAutomationSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAutomationSessionParamsWithHTTPClient(client *http.Client) *GetAutomationSessionParams { - return &GetAutomationSessionParams{ - HTTPClient: client, - } -} - -/* GetAutomationSessionParams contains all the parameters to send to the API endpoint - for the get automation session operation. - - Typically these are written to a http.Request. -*/ -type GetAutomationSessionParams struct { - - /* ID. - - ID of the session. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get automation session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAutomationSessionParams) WithDefaults() *GetAutomationSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get automation session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAutomationSessionParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAutomationSessionParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get automation session params -func (o *GetAutomationSessionParams) WithTimeout(timeout time.Duration) *GetAutomationSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get automation session params -func (o *GetAutomationSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get automation session params -func (o *GetAutomationSessionParams) WithContext(ctx context.Context) *GetAutomationSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get automation session params -func (o *GetAutomationSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get automation session params -func (o *GetAutomationSessionParams) WithHTTPClient(client *http.Client) *GetAutomationSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get automation session params -func (o *GetAutomationSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get automation session params -func (o *GetAutomationSessionParams) WithID(id strfmt.UUID) *GetAutomationSessionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get automation session params -func (o *GetAutomationSessionParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get automation session params -func (o *GetAutomationSessionParams) WithXAPIVersion(xAPIVersion string) *GetAutomationSessionParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get automation session params -func (o *GetAutomationSessionParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAutomationSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/get_automation_session_responses.go b/client/automation/get_automation_session_responses.go deleted file mode 100644 index 0dbb30e..0000000 --- a/client/automation/get_automation_session_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAutomationSessionReader is a Reader for the GetAutomationSession structure. -type GetAutomationSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAutomationSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAutomationSessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAutomationSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAutomationSessionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetAutomationSessionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAutomationSessionInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAutomationSessionOK creates a GetAutomationSessionOK with default headers values -func NewGetAutomationSessionOK() *GetAutomationSessionOK { - return &GetAutomationSessionOK{} -} - -/* GetAutomationSessionOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAutomationSessionOK struct { - Payload *models.SessionModel -} - -func (o *GetAutomationSessionOK) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}][%d] getAutomationSessionOK %+v", 200, o.Payload) -} -func (o *GetAutomationSessionOK) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *GetAutomationSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutomationSessionUnauthorized creates a GetAutomationSessionUnauthorized with default headers values -func NewGetAutomationSessionUnauthorized() *GetAutomationSessionUnauthorized { - return &GetAutomationSessionUnauthorized{} -} - -/* GetAutomationSessionUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAutomationSessionUnauthorized struct { - Payload *models.Error -} - -func (o *GetAutomationSessionUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}][%d] getAutomationSessionUnauthorized %+v", 401, o.Payload) -} -func (o *GetAutomationSessionUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAutomationSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutomationSessionForbidden creates a GetAutomationSessionForbidden with default headers values -func NewGetAutomationSessionForbidden() *GetAutomationSessionForbidden { - return &GetAutomationSessionForbidden{} -} - -/* GetAutomationSessionForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAutomationSessionForbidden struct { - Payload *models.Error -} - -func (o *GetAutomationSessionForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}][%d] getAutomationSessionForbidden %+v", 403, o.Payload) -} -func (o *GetAutomationSessionForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAutomationSessionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutomationSessionNotFound creates a GetAutomationSessionNotFound with default headers values -func NewGetAutomationSessionNotFound() *GetAutomationSessionNotFound { - return &GetAutomationSessionNotFound{} -} - -/* GetAutomationSessionNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetAutomationSessionNotFound struct { - Payload *models.Error -} - -func (o *GetAutomationSessionNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}][%d] getAutomationSessionNotFound %+v", 404, o.Payload) -} -func (o *GetAutomationSessionNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAutomationSessionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutomationSessionInternalServerError creates a GetAutomationSessionInternalServerError with default headers values -func NewGetAutomationSessionInternalServerError() *GetAutomationSessionInternalServerError { - return &GetAutomationSessionInternalServerError{} -} - -/* GetAutomationSessionInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAutomationSessionInternalServerError struct { - Payload *models.Error -} - -func (o *GetAutomationSessionInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/automation/sessions/{id}][%d] getAutomationSessionInternalServerError %+v", 500, o.Payload) -} -func (o *GetAutomationSessionInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAutomationSessionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/import_credentials_parameters.go b/client/automation/import_credentials_parameters.go deleted file mode 100644 index cdf80bf..0000000 --- a/client/automation/import_credentials_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewImportCredentialsParams creates a new ImportCredentialsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewImportCredentialsParams() *ImportCredentialsParams { - return &ImportCredentialsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewImportCredentialsParamsWithTimeout creates a new ImportCredentialsParams object -// with the ability to set a timeout on a request. -func NewImportCredentialsParamsWithTimeout(timeout time.Duration) *ImportCredentialsParams { - return &ImportCredentialsParams{ - timeout: timeout, - } -} - -// NewImportCredentialsParamsWithContext creates a new ImportCredentialsParams object -// with the ability to set a context for a request. -func NewImportCredentialsParamsWithContext(ctx context.Context) *ImportCredentialsParams { - return &ImportCredentialsParams{ - Context: ctx, - } -} - -// NewImportCredentialsParamsWithHTTPClient creates a new ImportCredentialsParams object -// with the ability to set a custom HTTPClient for a request. -func NewImportCredentialsParamsWithHTTPClient(client *http.Client) *ImportCredentialsParams { - return &ImportCredentialsParams{ - HTTPClient: client, - } -} - -/* ImportCredentialsParams contains all the parameters to send to the API endpoint - for the import credentials operation. - - Typically these are written to a http.Request. -*/ -type ImportCredentialsParams struct { - - // Body. - Body *models.CredentialsImportSpecCollection - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the import credentials params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportCredentialsParams) WithDefaults() *ImportCredentialsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the import credentials params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportCredentialsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ImportCredentialsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the import credentials params -func (o *ImportCredentialsParams) WithTimeout(timeout time.Duration) *ImportCredentialsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the import credentials params -func (o *ImportCredentialsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the import credentials params -func (o *ImportCredentialsParams) WithContext(ctx context.Context) *ImportCredentialsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the import credentials params -func (o *ImportCredentialsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the import credentials params -func (o *ImportCredentialsParams) WithHTTPClient(client *http.Client) *ImportCredentialsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the import credentials params -func (o *ImportCredentialsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the import credentials params -func (o *ImportCredentialsParams) WithBody(body *models.CredentialsImportSpecCollection) *ImportCredentialsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the import credentials params -func (o *ImportCredentialsParams) SetBody(body *models.CredentialsImportSpecCollection) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the import credentials params -func (o *ImportCredentialsParams) WithXAPIVersion(xAPIVersion string) *ImportCredentialsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the import credentials params -func (o *ImportCredentialsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ImportCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/import_credentials_responses.go b/client/automation/import_credentials_responses.go deleted file mode 100644 index 00b7a35..0000000 --- a/client/automation/import_credentials_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ImportCredentialsReader is a Reader for the ImportCredentials structure. -type ImportCredentialsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ImportCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewImportCredentialsCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewImportCredentialsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewImportCredentialsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewImportCredentialsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewImportCredentialsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewImportCredentialsCreated creates a ImportCredentialsCreated with default headers values -func NewImportCredentialsCreated() *ImportCredentialsCreated { - return &ImportCredentialsCreated{} -} - -/* ImportCredentialsCreated describes a response with status code 201, with default header values. - -Automation session has been created to import the credentials. To check the progress, track the session `state`. -*/ -type ImportCredentialsCreated struct { - Payload *models.SessionModel -} - -func (o *ImportCredentialsCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/import][%d] importCredentialsCreated %+v", 201, o.Payload) -} -func (o *ImportCredentialsCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *ImportCredentialsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportCredentialsBadRequest creates a ImportCredentialsBadRequest with default headers values -func NewImportCredentialsBadRequest() *ImportCredentialsBadRequest { - return &ImportCredentialsBadRequest{} -} - -/* ImportCredentialsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ImportCredentialsBadRequest struct { - Payload *models.Error -} - -func (o *ImportCredentialsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/import][%d] importCredentialsBadRequest %+v", 400, o.Payload) -} -func (o *ImportCredentialsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportCredentialsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportCredentialsUnauthorized creates a ImportCredentialsUnauthorized with default headers values -func NewImportCredentialsUnauthorized() *ImportCredentialsUnauthorized { - return &ImportCredentialsUnauthorized{} -} - -/* ImportCredentialsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ImportCredentialsUnauthorized struct { - Payload *models.Error -} - -func (o *ImportCredentialsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/import][%d] importCredentialsUnauthorized %+v", 401, o.Payload) -} -func (o *ImportCredentialsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportCredentialsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportCredentialsForbidden creates a ImportCredentialsForbidden with default headers values -func NewImportCredentialsForbidden() *ImportCredentialsForbidden { - return &ImportCredentialsForbidden{} -} - -/* ImportCredentialsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ImportCredentialsForbidden struct { - Payload *models.Error -} - -func (o *ImportCredentialsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/import][%d] importCredentialsForbidden %+v", 403, o.Payload) -} -func (o *ImportCredentialsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportCredentialsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportCredentialsInternalServerError creates a ImportCredentialsInternalServerError with default headers values -func NewImportCredentialsInternalServerError() *ImportCredentialsInternalServerError { - return &ImportCredentialsInternalServerError{} -} - -/* ImportCredentialsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ImportCredentialsInternalServerError struct { - Payload *models.Error -} - -func (o *ImportCredentialsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/credentials/import][%d] importCredentialsInternalServerError %+v", 500, o.Payload) -} -func (o *ImportCredentialsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportCredentialsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/import_encryption_passwords_parameters.go b/client/automation/import_encryption_passwords_parameters.go deleted file mode 100644 index a5639a0..0000000 --- a/client/automation/import_encryption_passwords_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewImportEncryptionPasswordsParams creates a new ImportEncryptionPasswordsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewImportEncryptionPasswordsParams() *ImportEncryptionPasswordsParams { - return &ImportEncryptionPasswordsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewImportEncryptionPasswordsParamsWithTimeout creates a new ImportEncryptionPasswordsParams object -// with the ability to set a timeout on a request. -func NewImportEncryptionPasswordsParamsWithTimeout(timeout time.Duration) *ImportEncryptionPasswordsParams { - return &ImportEncryptionPasswordsParams{ - timeout: timeout, - } -} - -// NewImportEncryptionPasswordsParamsWithContext creates a new ImportEncryptionPasswordsParams object -// with the ability to set a context for a request. -func NewImportEncryptionPasswordsParamsWithContext(ctx context.Context) *ImportEncryptionPasswordsParams { - return &ImportEncryptionPasswordsParams{ - Context: ctx, - } -} - -// NewImportEncryptionPasswordsParamsWithHTTPClient creates a new ImportEncryptionPasswordsParams object -// with the ability to set a custom HTTPClient for a request. -func NewImportEncryptionPasswordsParamsWithHTTPClient(client *http.Client) *ImportEncryptionPasswordsParams { - return &ImportEncryptionPasswordsParams{ - HTTPClient: client, - } -} - -/* ImportEncryptionPasswordsParams contains all the parameters to send to the API endpoint - for the import encryption passwords operation. - - Typically these are written to a http.Request. -*/ -type ImportEncryptionPasswordsParams struct { - - // Body. - Body *models.EncryptionPasswordImportSpecCollection - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the import encryption passwords params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportEncryptionPasswordsParams) WithDefaults() *ImportEncryptionPasswordsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the import encryption passwords params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportEncryptionPasswordsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ImportEncryptionPasswordsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) WithTimeout(timeout time.Duration) *ImportEncryptionPasswordsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) WithContext(ctx context.Context) *ImportEncryptionPasswordsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) WithHTTPClient(client *http.Client) *ImportEncryptionPasswordsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) WithBody(body *models.EncryptionPasswordImportSpecCollection) *ImportEncryptionPasswordsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) SetBody(body *models.EncryptionPasswordImportSpecCollection) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) WithXAPIVersion(xAPIVersion string) *ImportEncryptionPasswordsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the import encryption passwords params -func (o *ImportEncryptionPasswordsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ImportEncryptionPasswordsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/import_encryption_passwords_responses.go b/client/automation/import_encryption_passwords_responses.go deleted file mode 100644 index e07d2a4..0000000 --- a/client/automation/import_encryption_passwords_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ImportEncryptionPasswordsReader is a Reader for the ImportEncryptionPasswords structure. -type ImportEncryptionPasswordsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ImportEncryptionPasswordsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewImportEncryptionPasswordsCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewImportEncryptionPasswordsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewImportEncryptionPasswordsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewImportEncryptionPasswordsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewImportEncryptionPasswordsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewImportEncryptionPasswordsCreated creates a ImportEncryptionPasswordsCreated with default headers values -func NewImportEncryptionPasswordsCreated() *ImportEncryptionPasswordsCreated { - return &ImportEncryptionPasswordsCreated{} -} - -/* ImportEncryptionPasswordsCreated describes a response with status code 201, with default header values. - -Automation session has been created to import the passwords. To check the progress, track the session `state`. -*/ -type ImportEncryptionPasswordsCreated struct { - Payload *models.SessionModel -} - -func (o *ImportEncryptionPasswordsCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/import][%d] importEncryptionPasswordsCreated %+v", 201, o.Payload) -} -func (o *ImportEncryptionPasswordsCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *ImportEncryptionPasswordsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportEncryptionPasswordsBadRequest creates a ImportEncryptionPasswordsBadRequest with default headers values -func NewImportEncryptionPasswordsBadRequest() *ImportEncryptionPasswordsBadRequest { - return &ImportEncryptionPasswordsBadRequest{} -} - -/* ImportEncryptionPasswordsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ImportEncryptionPasswordsBadRequest struct { - Payload *models.Error -} - -func (o *ImportEncryptionPasswordsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/import][%d] importEncryptionPasswordsBadRequest %+v", 400, o.Payload) -} -func (o *ImportEncryptionPasswordsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportEncryptionPasswordsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportEncryptionPasswordsUnauthorized creates a ImportEncryptionPasswordsUnauthorized with default headers values -func NewImportEncryptionPasswordsUnauthorized() *ImportEncryptionPasswordsUnauthorized { - return &ImportEncryptionPasswordsUnauthorized{} -} - -/* ImportEncryptionPasswordsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ImportEncryptionPasswordsUnauthorized struct { - Payload *models.Error -} - -func (o *ImportEncryptionPasswordsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/import][%d] importEncryptionPasswordsUnauthorized %+v", 401, o.Payload) -} -func (o *ImportEncryptionPasswordsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportEncryptionPasswordsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportEncryptionPasswordsForbidden creates a ImportEncryptionPasswordsForbidden with default headers values -func NewImportEncryptionPasswordsForbidden() *ImportEncryptionPasswordsForbidden { - return &ImportEncryptionPasswordsForbidden{} -} - -/* ImportEncryptionPasswordsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ImportEncryptionPasswordsForbidden struct { - Payload *models.Error -} - -func (o *ImportEncryptionPasswordsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/import][%d] importEncryptionPasswordsForbidden %+v", 403, o.Payload) -} -func (o *ImportEncryptionPasswordsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportEncryptionPasswordsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportEncryptionPasswordsInternalServerError creates a ImportEncryptionPasswordsInternalServerError with default headers values -func NewImportEncryptionPasswordsInternalServerError() *ImportEncryptionPasswordsInternalServerError { - return &ImportEncryptionPasswordsInternalServerError{} -} - -/* ImportEncryptionPasswordsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ImportEncryptionPasswordsInternalServerError struct { - Payload *models.Error -} - -func (o *ImportEncryptionPasswordsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/encryptionPasswords/import][%d] importEncryptionPasswordsInternalServerError %+v", 500, o.Payload) -} -func (o *ImportEncryptionPasswordsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportEncryptionPasswordsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/import_jobs_parameters.go b/client/automation/import_jobs_parameters.go deleted file mode 100644 index 67edace..0000000 --- a/client/automation/import_jobs_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewImportJobsParams creates a new ImportJobsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewImportJobsParams() *ImportJobsParams { - return &ImportJobsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewImportJobsParamsWithTimeout creates a new ImportJobsParams object -// with the ability to set a timeout on a request. -func NewImportJobsParamsWithTimeout(timeout time.Duration) *ImportJobsParams { - return &ImportJobsParams{ - timeout: timeout, - } -} - -// NewImportJobsParamsWithContext creates a new ImportJobsParams object -// with the ability to set a context for a request. -func NewImportJobsParamsWithContext(ctx context.Context) *ImportJobsParams { - return &ImportJobsParams{ - Context: ctx, - } -} - -// NewImportJobsParamsWithHTTPClient creates a new ImportJobsParams object -// with the ability to set a custom HTTPClient for a request. -func NewImportJobsParamsWithHTTPClient(client *http.Client) *ImportJobsParams { - return &ImportJobsParams{ - HTTPClient: client, - } -} - -/* ImportJobsParams contains all the parameters to send to the API endpoint - for the import jobs operation. - - Typically these are written to a http.Request. -*/ -type ImportJobsParams struct { - - // Body. - Body *models.JobImportSpecCollection - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the import jobs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportJobsParams) WithDefaults() *ImportJobsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the import jobs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportJobsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ImportJobsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the import jobs params -func (o *ImportJobsParams) WithTimeout(timeout time.Duration) *ImportJobsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the import jobs params -func (o *ImportJobsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the import jobs params -func (o *ImportJobsParams) WithContext(ctx context.Context) *ImportJobsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the import jobs params -func (o *ImportJobsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the import jobs params -func (o *ImportJobsParams) WithHTTPClient(client *http.Client) *ImportJobsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the import jobs params -func (o *ImportJobsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the import jobs params -func (o *ImportJobsParams) WithBody(body *models.JobImportSpecCollection) *ImportJobsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the import jobs params -func (o *ImportJobsParams) SetBody(body *models.JobImportSpecCollection) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the import jobs params -func (o *ImportJobsParams) WithXAPIVersion(xAPIVersion string) *ImportJobsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the import jobs params -func (o *ImportJobsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ImportJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/import_jobs_responses.go b/client/automation/import_jobs_responses.go deleted file mode 100644 index 72e30c6..0000000 --- a/client/automation/import_jobs_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ImportJobsReader is a Reader for the ImportJobs structure. -type ImportJobsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ImportJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewImportJobsCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewImportJobsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewImportJobsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewImportJobsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewImportJobsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewImportJobsCreated creates a ImportJobsCreated with default headers values -func NewImportJobsCreated() *ImportJobsCreated { - return &ImportJobsCreated{} -} - -/* ImportJobsCreated describes a response with status code 201, with default header values. - -Automation session has been created to import the jobs. To check the progress, track the session `state`. -*/ -type ImportJobsCreated struct { - Payload *models.SessionModel -} - -func (o *ImportJobsCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/import][%d] importJobsCreated %+v", 201, o.Payload) -} -func (o *ImportJobsCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *ImportJobsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportJobsBadRequest creates a ImportJobsBadRequest with default headers values -func NewImportJobsBadRequest() *ImportJobsBadRequest { - return &ImportJobsBadRequest{} -} - -/* ImportJobsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ImportJobsBadRequest struct { - Payload *models.Error -} - -func (o *ImportJobsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/import][%d] importJobsBadRequest %+v", 400, o.Payload) -} -func (o *ImportJobsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportJobsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportJobsUnauthorized creates a ImportJobsUnauthorized with default headers values -func NewImportJobsUnauthorized() *ImportJobsUnauthorized { - return &ImportJobsUnauthorized{} -} - -/* ImportJobsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ImportJobsUnauthorized struct { - Payload *models.Error -} - -func (o *ImportJobsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/import][%d] importJobsUnauthorized %+v", 401, o.Payload) -} -func (o *ImportJobsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportJobsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportJobsForbidden creates a ImportJobsForbidden with default headers values -func NewImportJobsForbidden() *ImportJobsForbidden { - return &ImportJobsForbidden{} -} - -/* ImportJobsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ImportJobsForbidden struct { - Payload *models.Error -} - -func (o *ImportJobsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/import][%d] importJobsForbidden %+v", 403, o.Payload) -} -func (o *ImportJobsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportJobsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportJobsInternalServerError creates a ImportJobsInternalServerError with default headers values -func NewImportJobsInternalServerError() *ImportJobsInternalServerError { - return &ImportJobsInternalServerError{} -} - -/* ImportJobsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ImportJobsInternalServerError struct { - Payload *models.Error -} - -func (o *ImportJobsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/jobs/import][%d] importJobsInternalServerError %+v", 500, o.Payload) -} -func (o *ImportJobsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportJobsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/import_managed_servers_parameters.go b/client/automation/import_managed_servers_parameters.go deleted file mode 100644 index cda45d7..0000000 --- a/client/automation/import_managed_servers_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewImportManagedServersParams creates a new ImportManagedServersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewImportManagedServersParams() *ImportManagedServersParams { - return &ImportManagedServersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewImportManagedServersParamsWithTimeout creates a new ImportManagedServersParams object -// with the ability to set a timeout on a request. -func NewImportManagedServersParamsWithTimeout(timeout time.Duration) *ImportManagedServersParams { - return &ImportManagedServersParams{ - timeout: timeout, - } -} - -// NewImportManagedServersParamsWithContext creates a new ImportManagedServersParams object -// with the ability to set a context for a request. -func NewImportManagedServersParamsWithContext(ctx context.Context) *ImportManagedServersParams { - return &ImportManagedServersParams{ - Context: ctx, - } -} - -// NewImportManagedServersParamsWithHTTPClient creates a new ImportManagedServersParams object -// with the ability to set a custom HTTPClient for a request. -func NewImportManagedServersParamsWithHTTPClient(client *http.Client) *ImportManagedServersParams { - return &ImportManagedServersParams{ - HTTPClient: client, - } -} - -/* ImportManagedServersParams contains all the parameters to send to the API endpoint - for the import managed servers operation. - - Typically these are written to a http.Request. -*/ -type ImportManagedServersParams struct { - - // Body. - Body *models.ManageServerImportSpecCollection - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the import managed servers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportManagedServersParams) WithDefaults() *ImportManagedServersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the import managed servers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportManagedServersParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ImportManagedServersParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the import managed servers params -func (o *ImportManagedServersParams) WithTimeout(timeout time.Duration) *ImportManagedServersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the import managed servers params -func (o *ImportManagedServersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the import managed servers params -func (o *ImportManagedServersParams) WithContext(ctx context.Context) *ImportManagedServersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the import managed servers params -func (o *ImportManagedServersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the import managed servers params -func (o *ImportManagedServersParams) WithHTTPClient(client *http.Client) *ImportManagedServersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the import managed servers params -func (o *ImportManagedServersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the import managed servers params -func (o *ImportManagedServersParams) WithBody(body *models.ManageServerImportSpecCollection) *ImportManagedServersParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the import managed servers params -func (o *ImportManagedServersParams) SetBody(body *models.ManageServerImportSpecCollection) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the import managed servers params -func (o *ImportManagedServersParams) WithXAPIVersion(xAPIVersion string) *ImportManagedServersParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the import managed servers params -func (o *ImportManagedServersParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ImportManagedServersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/import_managed_servers_responses.go b/client/automation/import_managed_servers_responses.go deleted file mode 100644 index 8f06094..0000000 --- a/client/automation/import_managed_servers_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ImportManagedServersReader is a Reader for the ImportManagedServers structure. -type ImportManagedServersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ImportManagedServersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewImportManagedServersCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewImportManagedServersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewImportManagedServersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewImportManagedServersForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewImportManagedServersInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewImportManagedServersCreated creates a ImportManagedServersCreated with default headers values -func NewImportManagedServersCreated() *ImportManagedServersCreated { - return &ImportManagedServersCreated{} -} - -/* ImportManagedServersCreated describes a response with status code 201, with default header values. - -Automation session has been created to import the servers. To check the progress, track the session `state`. -*/ -type ImportManagedServersCreated struct { - Payload *models.SessionModel -} - -func (o *ImportManagedServersCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/import][%d] importManagedServersCreated %+v", 201, o.Payload) -} -func (o *ImportManagedServersCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *ImportManagedServersCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportManagedServersBadRequest creates a ImportManagedServersBadRequest with default headers values -func NewImportManagedServersBadRequest() *ImportManagedServersBadRequest { - return &ImportManagedServersBadRequest{} -} - -/* ImportManagedServersBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ImportManagedServersBadRequest struct { - Payload *models.Error -} - -func (o *ImportManagedServersBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/import][%d] importManagedServersBadRequest %+v", 400, o.Payload) -} -func (o *ImportManagedServersBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportManagedServersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportManagedServersUnauthorized creates a ImportManagedServersUnauthorized with default headers values -func NewImportManagedServersUnauthorized() *ImportManagedServersUnauthorized { - return &ImportManagedServersUnauthorized{} -} - -/* ImportManagedServersUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ImportManagedServersUnauthorized struct { - Payload *models.Error -} - -func (o *ImportManagedServersUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/import][%d] importManagedServersUnauthorized %+v", 401, o.Payload) -} -func (o *ImportManagedServersUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportManagedServersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportManagedServersForbidden creates a ImportManagedServersForbidden with default headers values -func NewImportManagedServersForbidden() *ImportManagedServersForbidden { - return &ImportManagedServersForbidden{} -} - -/* ImportManagedServersForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ImportManagedServersForbidden struct { - Payload *models.Error -} - -func (o *ImportManagedServersForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/import][%d] importManagedServersForbidden %+v", 403, o.Payload) -} -func (o *ImportManagedServersForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportManagedServersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportManagedServersInternalServerError creates a ImportManagedServersInternalServerError with default headers values -func NewImportManagedServersInternalServerError() *ImportManagedServersInternalServerError { - return &ImportManagedServersInternalServerError{} -} - -/* ImportManagedServersInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ImportManagedServersInternalServerError struct { - Payload *models.Error -} - -func (o *ImportManagedServersInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/managedServers/import][%d] importManagedServersInternalServerError %+v", 500, o.Payload) -} -func (o *ImportManagedServersInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportManagedServersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/import_proxies_parameters.go b/client/automation/import_proxies_parameters.go deleted file mode 100644 index 423671a..0000000 --- a/client/automation/import_proxies_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewImportProxiesParams creates a new ImportProxiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewImportProxiesParams() *ImportProxiesParams { - return &ImportProxiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewImportProxiesParamsWithTimeout creates a new ImportProxiesParams object -// with the ability to set a timeout on a request. -func NewImportProxiesParamsWithTimeout(timeout time.Duration) *ImportProxiesParams { - return &ImportProxiesParams{ - timeout: timeout, - } -} - -// NewImportProxiesParamsWithContext creates a new ImportProxiesParams object -// with the ability to set a context for a request. -func NewImportProxiesParamsWithContext(ctx context.Context) *ImportProxiesParams { - return &ImportProxiesParams{ - Context: ctx, - } -} - -// NewImportProxiesParamsWithHTTPClient creates a new ImportProxiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewImportProxiesParamsWithHTTPClient(client *http.Client) *ImportProxiesParams { - return &ImportProxiesParams{ - HTTPClient: client, - } -} - -/* ImportProxiesParams contains all the parameters to send to the API endpoint - for the import proxies operation. - - Typically these are written to a http.Request. -*/ -type ImportProxiesParams struct { - - // Body. - Body *models.ProxyImportSpecCollection - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the import proxies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportProxiesParams) WithDefaults() *ImportProxiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the import proxies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportProxiesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ImportProxiesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the import proxies params -func (o *ImportProxiesParams) WithTimeout(timeout time.Duration) *ImportProxiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the import proxies params -func (o *ImportProxiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the import proxies params -func (o *ImportProxiesParams) WithContext(ctx context.Context) *ImportProxiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the import proxies params -func (o *ImportProxiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the import proxies params -func (o *ImportProxiesParams) WithHTTPClient(client *http.Client) *ImportProxiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the import proxies params -func (o *ImportProxiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the import proxies params -func (o *ImportProxiesParams) WithBody(body *models.ProxyImportSpecCollection) *ImportProxiesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the import proxies params -func (o *ImportProxiesParams) SetBody(body *models.ProxyImportSpecCollection) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the import proxies params -func (o *ImportProxiesParams) WithXAPIVersion(xAPIVersion string) *ImportProxiesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the import proxies params -func (o *ImportProxiesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ImportProxiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/import_proxies_responses.go b/client/automation/import_proxies_responses.go deleted file mode 100644 index d28e3cb..0000000 --- a/client/automation/import_proxies_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ImportProxiesReader is a Reader for the ImportProxies structure. -type ImportProxiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ImportProxiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewImportProxiesCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewImportProxiesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewImportProxiesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewImportProxiesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewImportProxiesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewImportProxiesCreated creates a ImportProxiesCreated with default headers values -func NewImportProxiesCreated() *ImportProxiesCreated { - return &ImportProxiesCreated{} -} - -/* ImportProxiesCreated describes a response with status code 201, with default header values. - -Automation session has been created to import the proxies. To check the progress, track the session `state`. -*/ -type ImportProxiesCreated struct { - Payload *models.SessionModel -} - -func (o *ImportProxiesCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/import][%d] importProxiesCreated %+v", 201, o.Payload) -} -func (o *ImportProxiesCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *ImportProxiesCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportProxiesBadRequest creates a ImportProxiesBadRequest with default headers values -func NewImportProxiesBadRequest() *ImportProxiesBadRequest { - return &ImportProxiesBadRequest{} -} - -/* ImportProxiesBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ImportProxiesBadRequest struct { - Payload *models.Error -} - -func (o *ImportProxiesBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/import][%d] importProxiesBadRequest %+v", 400, o.Payload) -} -func (o *ImportProxiesBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportProxiesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportProxiesUnauthorized creates a ImportProxiesUnauthorized with default headers values -func NewImportProxiesUnauthorized() *ImportProxiesUnauthorized { - return &ImportProxiesUnauthorized{} -} - -/* ImportProxiesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ImportProxiesUnauthorized struct { - Payload *models.Error -} - -func (o *ImportProxiesUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/import][%d] importProxiesUnauthorized %+v", 401, o.Payload) -} -func (o *ImportProxiesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportProxiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportProxiesForbidden creates a ImportProxiesForbidden with default headers values -func NewImportProxiesForbidden() *ImportProxiesForbidden { - return &ImportProxiesForbidden{} -} - -/* ImportProxiesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ImportProxiesForbidden struct { - Payload *models.Error -} - -func (o *ImportProxiesForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/import][%d] importProxiesForbidden %+v", 403, o.Payload) -} -func (o *ImportProxiesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportProxiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportProxiesInternalServerError creates a ImportProxiesInternalServerError with default headers values -func NewImportProxiesInternalServerError() *ImportProxiesInternalServerError { - return &ImportProxiesInternalServerError{} -} - -/* ImportProxiesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ImportProxiesInternalServerError struct { - Payload *models.Error -} - -func (o *ImportProxiesInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/proxies/import][%d] importProxiesInternalServerError %+v", 500, o.Payload) -} -func (o *ImportProxiesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportProxiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/import_repositories_parameters.go b/client/automation/import_repositories_parameters.go deleted file mode 100644 index e42794e..0000000 --- a/client/automation/import_repositories_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewImportRepositoriesParams creates a new ImportRepositoriesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewImportRepositoriesParams() *ImportRepositoriesParams { - return &ImportRepositoriesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewImportRepositoriesParamsWithTimeout creates a new ImportRepositoriesParams object -// with the ability to set a timeout on a request. -func NewImportRepositoriesParamsWithTimeout(timeout time.Duration) *ImportRepositoriesParams { - return &ImportRepositoriesParams{ - timeout: timeout, - } -} - -// NewImportRepositoriesParamsWithContext creates a new ImportRepositoriesParams object -// with the ability to set a context for a request. -func NewImportRepositoriesParamsWithContext(ctx context.Context) *ImportRepositoriesParams { - return &ImportRepositoriesParams{ - Context: ctx, - } -} - -// NewImportRepositoriesParamsWithHTTPClient creates a new ImportRepositoriesParams object -// with the ability to set a custom HTTPClient for a request. -func NewImportRepositoriesParamsWithHTTPClient(client *http.Client) *ImportRepositoriesParams { - return &ImportRepositoriesParams{ - HTTPClient: client, - } -} - -/* ImportRepositoriesParams contains all the parameters to send to the API endpoint - for the import repositories operation. - - Typically these are written to a http.Request. -*/ -type ImportRepositoriesParams struct { - - // Body. - Body *models.RepositoryImportSpecCollection - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the import repositories params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportRepositoriesParams) WithDefaults() *ImportRepositoriesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the import repositories params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ImportRepositoriesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ImportRepositoriesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the import repositories params -func (o *ImportRepositoriesParams) WithTimeout(timeout time.Duration) *ImportRepositoriesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the import repositories params -func (o *ImportRepositoriesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the import repositories params -func (o *ImportRepositoriesParams) WithContext(ctx context.Context) *ImportRepositoriesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the import repositories params -func (o *ImportRepositoriesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the import repositories params -func (o *ImportRepositoriesParams) WithHTTPClient(client *http.Client) *ImportRepositoriesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the import repositories params -func (o *ImportRepositoriesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the import repositories params -func (o *ImportRepositoriesParams) WithBody(body *models.RepositoryImportSpecCollection) *ImportRepositoriesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the import repositories params -func (o *ImportRepositoriesParams) SetBody(body *models.RepositoryImportSpecCollection) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the import repositories params -func (o *ImportRepositoriesParams) WithXAPIVersion(xAPIVersion string) *ImportRepositoriesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the import repositories params -func (o *ImportRepositoriesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ImportRepositoriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/import_repositories_responses.go b/client/automation/import_repositories_responses.go deleted file mode 100644 index 55e075e..0000000 --- a/client/automation/import_repositories_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ImportRepositoriesReader is a Reader for the ImportRepositories structure. -type ImportRepositoriesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ImportRepositoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewImportRepositoriesCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewImportRepositoriesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewImportRepositoriesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewImportRepositoriesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewImportRepositoriesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewImportRepositoriesCreated creates a ImportRepositoriesCreated with default headers values -func NewImportRepositoriesCreated() *ImportRepositoriesCreated { - return &ImportRepositoriesCreated{} -} - -/* ImportRepositoriesCreated describes a response with status code 201, with default header values. - -Automation session has been created to import the repositories. To check the progress, track the session `state`. -*/ -type ImportRepositoriesCreated struct { - Payload *models.SessionModel -} - -func (o *ImportRepositoriesCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/import][%d] importRepositoriesCreated %+v", 201, o.Payload) -} -func (o *ImportRepositoriesCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *ImportRepositoriesCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportRepositoriesBadRequest creates a ImportRepositoriesBadRequest with default headers values -func NewImportRepositoriesBadRequest() *ImportRepositoriesBadRequest { - return &ImportRepositoriesBadRequest{} -} - -/* ImportRepositoriesBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ImportRepositoriesBadRequest struct { - Payload *models.Error -} - -func (o *ImportRepositoriesBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/import][%d] importRepositoriesBadRequest %+v", 400, o.Payload) -} -func (o *ImportRepositoriesBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportRepositoriesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportRepositoriesUnauthorized creates a ImportRepositoriesUnauthorized with default headers values -func NewImportRepositoriesUnauthorized() *ImportRepositoriesUnauthorized { - return &ImportRepositoriesUnauthorized{} -} - -/* ImportRepositoriesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ImportRepositoriesUnauthorized struct { - Payload *models.Error -} - -func (o *ImportRepositoriesUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/import][%d] importRepositoriesUnauthorized %+v", 401, o.Payload) -} -func (o *ImportRepositoriesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportRepositoriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportRepositoriesForbidden creates a ImportRepositoriesForbidden with default headers values -func NewImportRepositoriesForbidden() *ImportRepositoriesForbidden { - return &ImportRepositoriesForbidden{} -} - -/* ImportRepositoriesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ImportRepositoriesForbidden struct { - Payload *models.Error -} - -func (o *ImportRepositoriesForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/import][%d] importRepositoriesForbidden %+v", 403, o.Payload) -} -func (o *ImportRepositoriesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportRepositoriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewImportRepositoriesInternalServerError creates a ImportRepositoriesInternalServerError with default headers values -func NewImportRepositoriesInternalServerError() *ImportRepositoriesInternalServerError { - return &ImportRepositoriesInternalServerError{} -} - -/* ImportRepositoriesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ImportRepositoriesInternalServerError struct { - Payload *models.Error -} - -func (o *ImportRepositoriesInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/repositories/import][%d] importRepositoriesInternalServerError %+v", 500, o.Payload) -} -func (o *ImportRepositoriesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ImportRepositoriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/automation/stop_automation_session_parameters.go b/client/automation/stop_automation_session_parameters.go deleted file mode 100644 index 7281a06..0000000 --- a/client/automation/stop_automation_session_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewStopAutomationSessionParams creates a new StopAutomationSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewStopAutomationSessionParams() *StopAutomationSessionParams { - return &StopAutomationSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStopAutomationSessionParamsWithTimeout creates a new StopAutomationSessionParams object -// with the ability to set a timeout on a request. -func NewStopAutomationSessionParamsWithTimeout(timeout time.Duration) *StopAutomationSessionParams { - return &StopAutomationSessionParams{ - timeout: timeout, - } -} - -// NewStopAutomationSessionParamsWithContext creates a new StopAutomationSessionParams object -// with the ability to set a context for a request. -func NewStopAutomationSessionParamsWithContext(ctx context.Context) *StopAutomationSessionParams { - return &StopAutomationSessionParams{ - Context: ctx, - } -} - -// NewStopAutomationSessionParamsWithHTTPClient creates a new StopAutomationSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewStopAutomationSessionParamsWithHTTPClient(client *http.Client) *StopAutomationSessionParams { - return &StopAutomationSessionParams{ - HTTPClient: client, - } -} - -/* StopAutomationSessionParams contains all the parameters to send to the API endpoint - for the stop automation session operation. - - Typically these are written to a http.Request. -*/ -type StopAutomationSessionParams struct { - - /* ID. - - ID of the session. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the stop automation session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StopAutomationSessionParams) WithDefaults() *StopAutomationSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the stop automation session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StopAutomationSessionParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := StopAutomationSessionParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the stop automation session params -func (o *StopAutomationSessionParams) WithTimeout(timeout time.Duration) *StopAutomationSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the stop automation session params -func (o *StopAutomationSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the stop automation session params -func (o *StopAutomationSessionParams) WithContext(ctx context.Context) *StopAutomationSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the stop automation session params -func (o *StopAutomationSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the stop automation session params -func (o *StopAutomationSessionParams) WithHTTPClient(client *http.Client) *StopAutomationSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the stop automation session params -func (o *StopAutomationSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the stop automation session params -func (o *StopAutomationSessionParams) WithID(id strfmt.UUID) *StopAutomationSessionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the stop automation session params -func (o *StopAutomationSessionParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the stop automation session params -func (o *StopAutomationSessionParams) WithXAPIVersion(xAPIVersion string) *StopAutomationSessionParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the stop automation session params -func (o *StopAutomationSessionParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *StopAutomationSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/automation/stop_automation_session_responses.go b/client/automation/stop_automation_session_responses.go deleted file mode 100644 index 5706623..0000000 --- a/client/automation/stop_automation_session_responses.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package automation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// StopAutomationSessionReader is a Reader for the StopAutomationSession structure. -type StopAutomationSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StopAutomationSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewStopAutomationSessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewStopAutomationSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewStopAutomationSessionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewStopAutomationSessionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewStopAutomationSessionInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewStopAutomationSessionOK creates a StopAutomationSessionOK with default headers values -func NewStopAutomationSessionOK() *StopAutomationSessionOK { - return &StopAutomationSessionOK{} -} - -/* StopAutomationSessionOK describes a response with status code 200, with default header values. - -OK -*/ -type StopAutomationSessionOK struct { - Payload models.EmptySuccessResponse -} - -func (o *StopAutomationSessionOK) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/sessions/{id}/stop][%d] stopAutomationSessionOK %+v", 200, o.Payload) -} -func (o *StopAutomationSessionOK) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *StopAutomationSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopAutomationSessionUnauthorized creates a StopAutomationSessionUnauthorized with default headers values -func NewStopAutomationSessionUnauthorized() *StopAutomationSessionUnauthorized { - return &StopAutomationSessionUnauthorized{} -} - -/* StopAutomationSessionUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type StopAutomationSessionUnauthorized struct { - Payload *models.Error -} - -func (o *StopAutomationSessionUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/sessions/{id}/stop][%d] stopAutomationSessionUnauthorized %+v", 401, o.Payload) -} -func (o *StopAutomationSessionUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopAutomationSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopAutomationSessionForbidden creates a StopAutomationSessionForbidden with default headers values -func NewStopAutomationSessionForbidden() *StopAutomationSessionForbidden { - return &StopAutomationSessionForbidden{} -} - -/* StopAutomationSessionForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type StopAutomationSessionForbidden struct { - Payload *models.Error -} - -func (o *StopAutomationSessionForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/sessions/{id}/stop][%d] stopAutomationSessionForbidden %+v", 403, o.Payload) -} -func (o *StopAutomationSessionForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopAutomationSessionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopAutomationSessionNotFound creates a StopAutomationSessionNotFound with default headers values -func NewStopAutomationSessionNotFound() *StopAutomationSessionNotFound { - return &StopAutomationSessionNotFound{} -} - -/* StopAutomationSessionNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type StopAutomationSessionNotFound struct { - Payload *models.Error -} - -func (o *StopAutomationSessionNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/sessions/{id}/stop][%d] stopAutomationSessionNotFound %+v", 404, o.Payload) -} -func (o *StopAutomationSessionNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopAutomationSessionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopAutomationSessionInternalServerError creates a StopAutomationSessionInternalServerError with default headers values -func NewStopAutomationSessionInternalServerError() *StopAutomationSessionInternalServerError { - return &StopAutomationSessionInternalServerError{} -} - -/* StopAutomationSessionInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type StopAutomationSessionInternalServerError struct { - Payload *models.Error -} - -func (o *StopAutomationSessionInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/automation/sessions/{id}/stop][%d] stopAutomationSessionInternalServerError %+v", 500, o.Payload) -} -func (o *StopAutomationSessionInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopAutomationSessionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/backup_objects/backup_objects_client.go b/client/backup_objects/backup_objects_client.go deleted file mode 100644 index c40819f..0000000 --- a/client/backup_objects/backup_objects_client.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_objects - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new backup objects API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for backup objects API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetAllBackupObjects(params *GetAllBackupObjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllBackupObjectsOK, error) - - GetBackupObject(params *GetBackupObjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBackupObjectOK, error) - - GetBackupObjectRestorePoints(params *GetBackupObjectRestorePointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBackupObjectRestorePointsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAllBackupObjects gets all backup objects - - The HTTP GET request to the `/api/v1/backupObjects` path allows you to get an array of virtual infrastructure objects (VMs and VM containers) that are inсluded in backups created by the backup server. -*/ -func (a *Client) GetAllBackupObjects(params *GetAllBackupObjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllBackupObjectsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllBackupObjectsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllBackupObjects", - Method: "GET", - PathPattern: "/api/v1/backupObjects", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllBackupObjectsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllBackupObjectsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllBackupObjects: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetBackupObject gets backup object - - The HTTP GET request to the `/api/v1/backupObjects/{id}` path allows you to get a backup object that has the specified `id`. -*/ -func (a *Client) GetBackupObject(params *GetBackupObjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBackupObjectOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetBackupObjectParams() - } - op := &runtime.ClientOperation{ - ID: "GetBackupObject", - Method: "GET", - PathPattern: "/api/v1/backupObjects/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetBackupObjectReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetBackupObjectOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetBackupObject: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetBackupObjectRestorePoints gets restore points - - The HTTP GET request to the `/api/v1/backupObjects/{id}/restorePoints` path allows you to get an array of restore points of a backup object that has the specified `id`. -*/ -func (a *Client) GetBackupObjectRestorePoints(params *GetBackupObjectRestorePointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBackupObjectRestorePointsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetBackupObjectRestorePointsParams() - } - op := &runtime.ClientOperation{ - ID: "GetBackupObjectRestorePoints", - Method: "GET", - PathPattern: "/api/v1/backupObjects/{id}/restorePoints", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetBackupObjectRestorePointsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetBackupObjectRestorePointsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetBackupObjectRestorePoints: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/backup_objects/get_all_backup_objects_parameters.go b/client/backup_objects/get_all_backup_objects_parameters.go deleted file mode 100644 index 6ebbc41..0000000 --- a/client/backup_objects/get_all_backup_objects_parameters.go +++ /dev/null @@ -1,477 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_objects - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllBackupObjectsParams creates a new GetAllBackupObjectsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllBackupObjectsParams() *GetAllBackupObjectsParams { - return &GetAllBackupObjectsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllBackupObjectsParamsWithTimeout creates a new GetAllBackupObjectsParams object -// with the ability to set a timeout on a request. -func NewGetAllBackupObjectsParamsWithTimeout(timeout time.Duration) *GetAllBackupObjectsParams { - return &GetAllBackupObjectsParams{ - timeout: timeout, - } -} - -// NewGetAllBackupObjectsParamsWithContext creates a new GetAllBackupObjectsParams object -// with the ability to set a context for a request. -func NewGetAllBackupObjectsParamsWithContext(ctx context.Context) *GetAllBackupObjectsParams { - return &GetAllBackupObjectsParams{ - Context: ctx, - } -} - -// NewGetAllBackupObjectsParamsWithHTTPClient creates a new GetAllBackupObjectsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllBackupObjectsParamsWithHTTPClient(client *http.Client) *GetAllBackupObjectsParams { - return &GetAllBackupObjectsParams{ - HTTPClient: client, - } -} - -/* GetAllBackupObjectsParams contains all the parameters to send to the API endpoint - for the get all backup objects operation. - - Typically these are written to a http.Request. -*/ -type GetAllBackupObjectsParams struct { - - /* Limit. - - Maximum number of backup objects to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters backup objects by the `nameFilter` pattern. The pattern can match any backup object parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts backup objects in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts backup objects by one of the backup object parameters. - */ - OrderColumn *string - - /* PlatformIDFilter. - - Filters backup objects by platform ID. - - Format: uuid - */ - PlatformIDFilter *strfmt.UUID - - /* PlatformNameFilter. - - Filters backup objects by platform ID. - */ - PlatformNameFilter *string - - /* Skip. - - Number of backup objects to skip. - - Format: int32 - */ - Skip *int32 - - /* TypeFilter. - - Filters backup objects by object type. - */ - TypeFilter *string - - /* ViTypeFilter. - - Filters backup objects by the type of VMware vSphere server. - */ - ViTypeFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all backup objects params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllBackupObjectsParams) WithDefaults() *GetAllBackupObjectsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all backup objects params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllBackupObjectsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllBackupObjectsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithTimeout(timeout time.Duration) *GetAllBackupObjectsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithContext(ctx context.Context) *GetAllBackupObjectsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithHTTPClient(client *http.Client) *GetAllBackupObjectsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithLimit(limit *int32) *GetAllBackupObjectsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithNameFilter(nameFilter *string) *GetAllBackupObjectsParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithOrderAsc(orderAsc *bool) *GetAllBackupObjectsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithOrderColumn(orderColumn *string) *GetAllBackupObjectsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithPlatformIDFilter adds the platformIDFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithPlatformIDFilter(platformIDFilter *strfmt.UUID) *GetAllBackupObjectsParams { - o.SetPlatformIDFilter(platformIDFilter) - return o -} - -// SetPlatformIDFilter adds the platformIdFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetPlatformIDFilter(platformIDFilter *strfmt.UUID) { - o.PlatformIDFilter = platformIDFilter -} - -// WithPlatformNameFilter adds the platformNameFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithPlatformNameFilter(platformNameFilter *string) *GetAllBackupObjectsParams { - o.SetPlatformNameFilter(platformNameFilter) - return o -} - -// SetPlatformNameFilter adds the platformNameFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetPlatformNameFilter(platformNameFilter *string) { - o.PlatformNameFilter = platformNameFilter -} - -// WithSkip adds the skip to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithSkip(skip *int32) *GetAllBackupObjectsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithTypeFilter adds the typeFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithTypeFilter(typeFilter *string) *GetAllBackupObjectsParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithViTypeFilter adds the viTypeFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithViTypeFilter(viTypeFilter *string) *GetAllBackupObjectsParams { - o.SetViTypeFilter(viTypeFilter) - return o -} - -// SetViTypeFilter adds the viTypeFilter to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetViTypeFilter(viTypeFilter *string) { - o.ViTypeFilter = viTypeFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all backup objects params -func (o *GetAllBackupObjectsParams) WithXAPIVersion(xAPIVersion string) *GetAllBackupObjectsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all backup objects params -func (o *GetAllBackupObjectsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllBackupObjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.PlatformIDFilter != nil { - - // query param platformIdFilter - var qrPlatformIDFilter strfmt.UUID - - if o.PlatformIDFilter != nil { - qrPlatformIDFilter = *o.PlatformIDFilter - } - qPlatformIDFilter := qrPlatformIDFilter.String() - if qPlatformIDFilter != "" { - - if err := r.SetQueryParam("platformIdFilter", qPlatformIDFilter); err != nil { - return err - } - } - } - - if o.PlatformNameFilter != nil { - - // query param platformNameFilter - var qrPlatformNameFilter string - - if o.PlatformNameFilter != nil { - qrPlatformNameFilter = *o.PlatformNameFilter - } - qPlatformNameFilter := qrPlatformNameFilter - if qPlatformNameFilter != "" { - - if err := r.SetQueryParam("platformNameFilter", qPlatformNameFilter); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - if o.ViTypeFilter != nil { - - // query param viTypeFilter - var qrViTypeFilter string - - if o.ViTypeFilter != nil { - qrViTypeFilter = *o.ViTypeFilter - } - qViTypeFilter := qrViTypeFilter - if qViTypeFilter != "" { - - if err := r.SetQueryParam("viTypeFilter", qViTypeFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/backup_objects/get_all_backup_objects_responses.go b/client/backup_objects/get_all_backup_objects_responses.go deleted file mode 100644 index 64aacc5..0000000 --- a/client/backup_objects/get_all_backup_objects_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_objects - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllBackupObjectsReader is a Reader for the GetAllBackupObjects structure. -type GetAllBackupObjectsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllBackupObjectsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllBackupObjectsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllBackupObjectsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllBackupObjectsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetAllBackupObjectsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllBackupObjectsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllBackupObjectsOK creates a GetAllBackupObjectsOK with default headers values -func NewGetAllBackupObjectsOK() *GetAllBackupObjectsOK { - return &GetAllBackupObjectsOK{} -} - -/* GetAllBackupObjectsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllBackupObjectsOK struct { - Payload *models.BackupObjectsResult -} - -func (o *GetAllBackupObjectsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects][%d] getAllBackupObjectsOK %+v", 200, o.Payload) -} -func (o *GetAllBackupObjectsOK) GetPayload() *models.BackupObjectsResult { - return o.Payload -} - -func (o *GetAllBackupObjectsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.BackupObjectsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllBackupObjectsUnauthorized creates a GetAllBackupObjectsUnauthorized with default headers values -func NewGetAllBackupObjectsUnauthorized() *GetAllBackupObjectsUnauthorized { - return &GetAllBackupObjectsUnauthorized{} -} - -/* GetAllBackupObjectsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllBackupObjectsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllBackupObjectsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects][%d] getAllBackupObjectsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllBackupObjectsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllBackupObjectsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllBackupObjectsForbidden creates a GetAllBackupObjectsForbidden with default headers values -func NewGetAllBackupObjectsForbidden() *GetAllBackupObjectsForbidden { - return &GetAllBackupObjectsForbidden{} -} - -/* GetAllBackupObjectsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllBackupObjectsForbidden struct { - Payload *models.Error -} - -func (o *GetAllBackupObjectsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects][%d] getAllBackupObjectsForbidden %+v", 403, o.Payload) -} -func (o *GetAllBackupObjectsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllBackupObjectsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllBackupObjectsNotFound creates a GetAllBackupObjectsNotFound with default headers values -func NewGetAllBackupObjectsNotFound() *GetAllBackupObjectsNotFound { - return &GetAllBackupObjectsNotFound{} -} - -/* GetAllBackupObjectsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetAllBackupObjectsNotFound struct { - Payload *models.Error -} - -func (o *GetAllBackupObjectsNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects][%d] getAllBackupObjectsNotFound %+v", 404, o.Payload) -} -func (o *GetAllBackupObjectsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllBackupObjectsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllBackupObjectsInternalServerError creates a GetAllBackupObjectsInternalServerError with default headers values -func NewGetAllBackupObjectsInternalServerError() *GetAllBackupObjectsInternalServerError { - return &GetAllBackupObjectsInternalServerError{} -} - -/* GetAllBackupObjectsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllBackupObjectsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllBackupObjectsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects][%d] getAllBackupObjectsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllBackupObjectsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllBackupObjectsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/backup_objects/get_backup_object_parameters.go b/client/backup_objects/get_backup_object_parameters.go deleted file mode 100644 index b8133db..0000000 --- a/client/backup_objects/get_backup_object_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_objects - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetBackupObjectParams creates a new GetBackupObjectParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetBackupObjectParams() *GetBackupObjectParams { - return &GetBackupObjectParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetBackupObjectParamsWithTimeout creates a new GetBackupObjectParams object -// with the ability to set a timeout on a request. -func NewGetBackupObjectParamsWithTimeout(timeout time.Duration) *GetBackupObjectParams { - return &GetBackupObjectParams{ - timeout: timeout, - } -} - -// NewGetBackupObjectParamsWithContext creates a new GetBackupObjectParams object -// with the ability to set a context for a request. -func NewGetBackupObjectParamsWithContext(ctx context.Context) *GetBackupObjectParams { - return &GetBackupObjectParams{ - Context: ctx, - } -} - -// NewGetBackupObjectParamsWithHTTPClient creates a new GetBackupObjectParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetBackupObjectParamsWithHTTPClient(client *http.Client) *GetBackupObjectParams { - return &GetBackupObjectParams{ - HTTPClient: client, - } -} - -/* GetBackupObjectParams contains all the parameters to send to the API endpoint - for the get backup object operation. - - Typically these are written to a http.Request. -*/ -type GetBackupObjectParams struct { - - /* ID. - - ID of the backup object. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get backup object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetBackupObjectParams) WithDefaults() *GetBackupObjectParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get backup object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetBackupObjectParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetBackupObjectParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get backup object params -func (o *GetBackupObjectParams) WithTimeout(timeout time.Duration) *GetBackupObjectParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get backup object params -func (o *GetBackupObjectParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get backup object params -func (o *GetBackupObjectParams) WithContext(ctx context.Context) *GetBackupObjectParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get backup object params -func (o *GetBackupObjectParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get backup object params -func (o *GetBackupObjectParams) WithHTTPClient(client *http.Client) *GetBackupObjectParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get backup object params -func (o *GetBackupObjectParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get backup object params -func (o *GetBackupObjectParams) WithID(id strfmt.UUID) *GetBackupObjectParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get backup object params -func (o *GetBackupObjectParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get backup object params -func (o *GetBackupObjectParams) WithXAPIVersion(xAPIVersion string) *GetBackupObjectParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get backup object params -func (o *GetBackupObjectParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetBackupObjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/backup_objects/get_backup_object_responses.go b/client/backup_objects/get_backup_object_responses.go deleted file mode 100644 index 865c2c0..0000000 --- a/client/backup_objects/get_backup_object_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_objects - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetBackupObjectReader is a Reader for the GetBackupObject structure. -type GetBackupObjectReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetBackupObjectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetBackupObjectOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetBackupObjectUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetBackupObjectForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetBackupObjectNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetBackupObjectInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetBackupObjectOK creates a GetBackupObjectOK with default headers values -func NewGetBackupObjectOK() *GetBackupObjectOK { - return &GetBackupObjectOK{} -} - -/* GetBackupObjectOK describes a response with status code 200, with default header values. - -OK -*/ -type GetBackupObjectOK struct { - Payload *models.BackupObjectModel -} - -func (o *GetBackupObjectOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}][%d] getBackupObjectOK %+v", 200, o.Payload) -} -func (o *GetBackupObjectOK) GetPayload() *models.BackupObjectModel { - return o.Payload -} - -func (o *GetBackupObjectOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.BackupObjectModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectUnauthorized creates a GetBackupObjectUnauthorized with default headers values -func NewGetBackupObjectUnauthorized() *GetBackupObjectUnauthorized { - return &GetBackupObjectUnauthorized{} -} - -/* GetBackupObjectUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetBackupObjectUnauthorized struct { - Payload *models.Error -} - -func (o *GetBackupObjectUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}][%d] getBackupObjectUnauthorized %+v", 401, o.Payload) -} -func (o *GetBackupObjectUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectForbidden creates a GetBackupObjectForbidden with default headers values -func NewGetBackupObjectForbidden() *GetBackupObjectForbidden { - return &GetBackupObjectForbidden{} -} - -/* GetBackupObjectForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetBackupObjectForbidden struct { - Payload *models.Error -} - -func (o *GetBackupObjectForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}][%d] getBackupObjectForbidden %+v", 403, o.Payload) -} -func (o *GetBackupObjectForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectNotFound creates a GetBackupObjectNotFound with default headers values -func NewGetBackupObjectNotFound() *GetBackupObjectNotFound { - return &GetBackupObjectNotFound{} -} - -/* GetBackupObjectNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetBackupObjectNotFound struct { - Payload *models.Error -} - -func (o *GetBackupObjectNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}][%d] getBackupObjectNotFound %+v", 404, o.Payload) -} -func (o *GetBackupObjectNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectInternalServerError creates a GetBackupObjectInternalServerError with default headers values -func NewGetBackupObjectInternalServerError() *GetBackupObjectInternalServerError { - return &GetBackupObjectInternalServerError{} -} - -/* GetBackupObjectInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetBackupObjectInternalServerError struct { - Payload *models.Error -} - -func (o *GetBackupObjectInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}][%d] getBackupObjectInternalServerError %+v", 500, o.Payload) -} -func (o *GetBackupObjectInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/backup_objects/get_backup_object_restore_points_parameters.go b/client/backup_objects/get_backup_object_restore_points_parameters.go deleted file mode 100644 index 593aaba..0000000 --- a/client/backup_objects/get_backup_object_restore_points_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_objects - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetBackupObjectRestorePointsParams creates a new GetBackupObjectRestorePointsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetBackupObjectRestorePointsParams() *GetBackupObjectRestorePointsParams { - return &GetBackupObjectRestorePointsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetBackupObjectRestorePointsParamsWithTimeout creates a new GetBackupObjectRestorePointsParams object -// with the ability to set a timeout on a request. -func NewGetBackupObjectRestorePointsParamsWithTimeout(timeout time.Duration) *GetBackupObjectRestorePointsParams { - return &GetBackupObjectRestorePointsParams{ - timeout: timeout, - } -} - -// NewGetBackupObjectRestorePointsParamsWithContext creates a new GetBackupObjectRestorePointsParams object -// with the ability to set a context for a request. -func NewGetBackupObjectRestorePointsParamsWithContext(ctx context.Context) *GetBackupObjectRestorePointsParams { - return &GetBackupObjectRestorePointsParams{ - Context: ctx, - } -} - -// NewGetBackupObjectRestorePointsParamsWithHTTPClient creates a new GetBackupObjectRestorePointsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetBackupObjectRestorePointsParamsWithHTTPClient(client *http.Client) *GetBackupObjectRestorePointsParams { - return &GetBackupObjectRestorePointsParams{ - HTTPClient: client, - } -} - -/* GetBackupObjectRestorePointsParams contains all the parameters to send to the API endpoint - for the get backup object restore points operation. - - Typically these are written to a http.Request. -*/ -type GetBackupObjectRestorePointsParams struct { - - /* ID. - - ID of the backup object. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get backup object restore points params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetBackupObjectRestorePointsParams) WithDefaults() *GetBackupObjectRestorePointsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get backup object restore points params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetBackupObjectRestorePointsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetBackupObjectRestorePointsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) WithTimeout(timeout time.Duration) *GetBackupObjectRestorePointsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) WithContext(ctx context.Context) *GetBackupObjectRestorePointsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) WithHTTPClient(client *http.Client) *GetBackupObjectRestorePointsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) WithID(id strfmt.UUID) *GetBackupObjectRestorePointsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) WithXAPIVersion(xAPIVersion string) *GetBackupObjectRestorePointsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get backup object restore points params -func (o *GetBackupObjectRestorePointsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetBackupObjectRestorePointsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/backup_objects/get_backup_object_restore_points_responses.go b/client/backup_objects/get_backup_object_restore_points_responses.go deleted file mode 100644 index 50a6505..0000000 --- a/client/backup_objects/get_backup_object_restore_points_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_objects - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetBackupObjectRestorePointsReader is a Reader for the GetBackupObjectRestorePoints structure. -type GetBackupObjectRestorePointsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetBackupObjectRestorePointsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetBackupObjectRestorePointsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetBackupObjectRestorePointsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetBackupObjectRestorePointsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetBackupObjectRestorePointsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetBackupObjectRestorePointsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetBackupObjectRestorePointsOK creates a GetBackupObjectRestorePointsOK with default headers values -func NewGetBackupObjectRestorePointsOK() *GetBackupObjectRestorePointsOK { - return &GetBackupObjectRestorePointsOK{} -} - -/* GetBackupObjectRestorePointsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetBackupObjectRestorePointsOK struct { - Payload *models.ObjectRestorePointsResult -} - -func (o *GetBackupObjectRestorePointsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}/restorePoints][%d] getBackupObjectRestorePointsOK %+v", 200, o.Payload) -} -func (o *GetBackupObjectRestorePointsOK) GetPayload() *models.ObjectRestorePointsResult { - return o.Payload -} - -func (o *GetBackupObjectRestorePointsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ObjectRestorePointsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectRestorePointsUnauthorized creates a GetBackupObjectRestorePointsUnauthorized with default headers values -func NewGetBackupObjectRestorePointsUnauthorized() *GetBackupObjectRestorePointsUnauthorized { - return &GetBackupObjectRestorePointsUnauthorized{} -} - -/* GetBackupObjectRestorePointsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetBackupObjectRestorePointsUnauthorized struct { - Payload *models.Error -} - -func (o *GetBackupObjectRestorePointsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}/restorePoints][%d] getBackupObjectRestorePointsUnauthorized %+v", 401, o.Payload) -} -func (o *GetBackupObjectRestorePointsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectRestorePointsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectRestorePointsForbidden creates a GetBackupObjectRestorePointsForbidden with default headers values -func NewGetBackupObjectRestorePointsForbidden() *GetBackupObjectRestorePointsForbidden { - return &GetBackupObjectRestorePointsForbidden{} -} - -/* GetBackupObjectRestorePointsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetBackupObjectRestorePointsForbidden struct { - Payload *models.Error -} - -func (o *GetBackupObjectRestorePointsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}/restorePoints][%d] getBackupObjectRestorePointsForbidden %+v", 403, o.Payload) -} -func (o *GetBackupObjectRestorePointsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectRestorePointsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectRestorePointsNotFound creates a GetBackupObjectRestorePointsNotFound with default headers values -func NewGetBackupObjectRestorePointsNotFound() *GetBackupObjectRestorePointsNotFound { - return &GetBackupObjectRestorePointsNotFound{} -} - -/* GetBackupObjectRestorePointsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetBackupObjectRestorePointsNotFound struct { - Payload *models.Error -} - -func (o *GetBackupObjectRestorePointsNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}/restorePoints][%d] getBackupObjectRestorePointsNotFound %+v", 404, o.Payload) -} -func (o *GetBackupObjectRestorePointsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectRestorePointsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectRestorePointsInternalServerError creates a GetBackupObjectRestorePointsInternalServerError with default headers values -func NewGetBackupObjectRestorePointsInternalServerError() *GetBackupObjectRestorePointsInternalServerError { - return &GetBackupObjectRestorePointsInternalServerError{} -} - -/* GetBackupObjectRestorePointsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetBackupObjectRestorePointsInternalServerError struct { - Payload *models.Error -} - -func (o *GetBackupObjectRestorePointsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupObjects/{id}/restorePoints][%d] getBackupObjectRestorePointsInternalServerError %+v", 500, o.Payload) -} -func (o *GetBackupObjectRestorePointsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectRestorePointsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/backups/backups_client.go b/client/backups/backups_client.go deleted file mode 100644 index bde731d..0000000 --- a/client/backups/backups_client.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new backups API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for backups API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetAllBackups(params *GetAllBackupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllBackupsOK, error) - - GetBackup(params *GetBackupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBackupOK, error) - - GetBackupObjects(params *GetBackupObjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBackupObjectsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAllBackups gets all backups - - The HTTP GET request to the `/api/v1/backups` path allows you to get an array of all backups that are created on or imported to the backup server. -*/ -func (a *Client) GetAllBackups(params *GetAllBackupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllBackupsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllBackupsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllBackups", - Method: "GET", - PathPattern: "/api/v1/backups", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllBackupsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllBackupsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllBackups: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetBackup gets backup - - The HTTP GET request to the `/api/v1/backups/{id}` path allows you to get a backup that has the specified `id`. -*/ -func (a *Client) GetBackup(params *GetBackupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBackupOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetBackupParams() - } - op := &runtime.ClientOperation{ - ID: "GetBackup", - Method: "GET", - PathPattern: "/api/v1/backups/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetBackupReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetBackupOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetBackup: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetBackupObjects gets backup objects - - The HTTP GET request to the `/api/v1/backups/{id}/objects` path allows you to get an array of virtual infrastructure objects (VMs and VM containers) that are inсluded in a backup that has the specified ID. -*/ -func (a *Client) GetBackupObjects(params *GetBackupObjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBackupObjectsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetBackupObjectsParams() - } - op := &runtime.ClientOperation{ - ID: "GetBackupObjects", - Method: "GET", - PathPattern: "/api/v1/backups/{id}/objects", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetBackupObjectsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetBackupObjectsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetBackupObjects: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/backups/get_all_backups_parameters.go b/client/backups/get_all_backups_parameters.go deleted file mode 100644 index abfbe3e..0000000 --- a/client/backups/get_all_backups_parameters.go +++ /dev/null @@ -1,517 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllBackupsParams creates a new GetAllBackupsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllBackupsParams() *GetAllBackupsParams { - return &GetAllBackupsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllBackupsParamsWithTimeout creates a new GetAllBackupsParams object -// with the ability to set a timeout on a request. -func NewGetAllBackupsParamsWithTimeout(timeout time.Duration) *GetAllBackupsParams { - return &GetAllBackupsParams{ - timeout: timeout, - } -} - -// NewGetAllBackupsParamsWithContext creates a new GetAllBackupsParams object -// with the ability to set a context for a request. -func NewGetAllBackupsParamsWithContext(ctx context.Context) *GetAllBackupsParams { - return &GetAllBackupsParams{ - Context: ctx, - } -} - -// NewGetAllBackupsParamsWithHTTPClient creates a new GetAllBackupsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllBackupsParamsWithHTTPClient(client *http.Client) *GetAllBackupsParams { - return &GetAllBackupsParams{ - HTTPClient: client, - } -} - -/* GetAllBackupsParams contains all the parameters to send to the API endpoint - for the get all backups operation. - - Typically these are written to a http.Request. -*/ -type GetAllBackupsParams struct { - - /* CreatedAfterFilter. - - Returns backups that are created after the specified date and time. - - Format: date-time - */ - CreatedAfterFilter *strfmt.DateTime - - /* CreatedBeforeFilter. - - Returns backups that are created before the specified date and time. - - Format: date-time - */ - CreatedBeforeFilter *strfmt.DateTime - - /* JobIDFilter. - - Filters backups by ID of the parent job. - - Format: uuid - */ - JobIDFilter *strfmt.UUID - - /* Limit. - - Maximum number of backups to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters backups by the `nameFilter` pattern. The pattern can match any backup parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts backups in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts backups by one of the backup parameters. - */ - OrderColumn *string - - /* PlatformIDFilter. - - Filters backups by ID of the backup object platform. - - Format: uuid - */ - PlatformIDFilter *strfmt.UUID - - /* PolicyTagFilter. - - Filters backups by retention policy tag. - */ - PolicyTagFilter *string - - /* Skip. - - Number of backups to skip. - - Format: int32 - */ - Skip *int32 - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all backups params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllBackupsParams) WithDefaults() *GetAllBackupsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all backups params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllBackupsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllBackupsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all backups params -func (o *GetAllBackupsParams) WithTimeout(timeout time.Duration) *GetAllBackupsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all backups params -func (o *GetAllBackupsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all backups params -func (o *GetAllBackupsParams) WithContext(ctx context.Context) *GetAllBackupsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all backups params -func (o *GetAllBackupsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all backups params -func (o *GetAllBackupsParams) WithHTTPClient(client *http.Client) *GetAllBackupsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all backups params -func (o *GetAllBackupsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCreatedAfterFilter adds the createdAfterFilter to the get all backups params -func (o *GetAllBackupsParams) WithCreatedAfterFilter(createdAfterFilter *strfmt.DateTime) *GetAllBackupsParams { - o.SetCreatedAfterFilter(createdAfterFilter) - return o -} - -// SetCreatedAfterFilter adds the createdAfterFilter to the get all backups params -func (o *GetAllBackupsParams) SetCreatedAfterFilter(createdAfterFilter *strfmt.DateTime) { - o.CreatedAfterFilter = createdAfterFilter -} - -// WithCreatedBeforeFilter adds the createdBeforeFilter to the get all backups params -func (o *GetAllBackupsParams) WithCreatedBeforeFilter(createdBeforeFilter *strfmt.DateTime) *GetAllBackupsParams { - o.SetCreatedBeforeFilter(createdBeforeFilter) - return o -} - -// SetCreatedBeforeFilter adds the createdBeforeFilter to the get all backups params -func (o *GetAllBackupsParams) SetCreatedBeforeFilter(createdBeforeFilter *strfmt.DateTime) { - o.CreatedBeforeFilter = createdBeforeFilter -} - -// WithJobIDFilter adds the jobIDFilter to the get all backups params -func (o *GetAllBackupsParams) WithJobIDFilter(jobIDFilter *strfmt.UUID) *GetAllBackupsParams { - o.SetJobIDFilter(jobIDFilter) - return o -} - -// SetJobIDFilter adds the jobIdFilter to the get all backups params -func (o *GetAllBackupsParams) SetJobIDFilter(jobIDFilter *strfmt.UUID) { - o.JobIDFilter = jobIDFilter -} - -// WithLimit adds the limit to the get all backups params -func (o *GetAllBackupsParams) WithLimit(limit *int32) *GetAllBackupsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all backups params -func (o *GetAllBackupsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all backups params -func (o *GetAllBackupsParams) WithNameFilter(nameFilter *string) *GetAllBackupsParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all backups params -func (o *GetAllBackupsParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all backups params -func (o *GetAllBackupsParams) WithOrderAsc(orderAsc *bool) *GetAllBackupsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all backups params -func (o *GetAllBackupsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all backups params -func (o *GetAllBackupsParams) WithOrderColumn(orderColumn *string) *GetAllBackupsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all backups params -func (o *GetAllBackupsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithPlatformIDFilter adds the platformIDFilter to the get all backups params -func (o *GetAllBackupsParams) WithPlatformIDFilter(platformIDFilter *strfmt.UUID) *GetAllBackupsParams { - o.SetPlatformIDFilter(platformIDFilter) - return o -} - -// SetPlatformIDFilter adds the platformIdFilter to the get all backups params -func (o *GetAllBackupsParams) SetPlatformIDFilter(platformIDFilter *strfmt.UUID) { - o.PlatformIDFilter = platformIDFilter -} - -// WithPolicyTagFilter adds the policyTagFilter to the get all backups params -func (o *GetAllBackupsParams) WithPolicyTagFilter(policyTagFilter *string) *GetAllBackupsParams { - o.SetPolicyTagFilter(policyTagFilter) - return o -} - -// SetPolicyTagFilter adds the policyTagFilter to the get all backups params -func (o *GetAllBackupsParams) SetPolicyTagFilter(policyTagFilter *string) { - o.PolicyTagFilter = policyTagFilter -} - -// WithSkip adds the skip to the get all backups params -func (o *GetAllBackupsParams) WithSkip(skip *int32) *GetAllBackupsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all backups params -func (o *GetAllBackupsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithXAPIVersion adds the xAPIVersion to the get all backups params -func (o *GetAllBackupsParams) WithXAPIVersion(xAPIVersion string) *GetAllBackupsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all backups params -func (o *GetAllBackupsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllBackupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.CreatedAfterFilter != nil { - - // query param createdAfterFilter - var qrCreatedAfterFilter strfmt.DateTime - - if o.CreatedAfterFilter != nil { - qrCreatedAfterFilter = *o.CreatedAfterFilter - } - qCreatedAfterFilter := qrCreatedAfterFilter.String() - if qCreatedAfterFilter != "" { - - if err := r.SetQueryParam("createdAfterFilter", qCreatedAfterFilter); err != nil { - return err - } - } - } - - if o.CreatedBeforeFilter != nil { - - // query param createdBeforeFilter - var qrCreatedBeforeFilter strfmt.DateTime - - if o.CreatedBeforeFilter != nil { - qrCreatedBeforeFilter = *o.CreatedBeforeFilter - } - qCreatedBeforeFilter := qrCreatedBeforeFilter.String() - if qCreatedBeforeFilter != "" { - - if err := r.SetQueryParam("createdBeforeFilter", qCreatedBeforeFilter); err != nil { - return err - } - } - } - - if o.JobIDFilter != nil { - - // query param jobIdFilter - var qrJobIDFilter strfmt.UUID - - if o.JobIDFilter != nil { - qrJobIDFilter = *o.JobIDFilter - } - qJobIDFilter := qrJobIDFilter.String() - if qJobIDFilter != "" { - - if err := r.SetQueryParam("jobIdFilter", qJobIDFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.PlatformIDFilter != nil { - - // query param platformIdFilter - var qrPlatformIDFilter strfmt.UUID - - if o.PlatformIDFilter != nil { - qrPlatformIDFilter = *o.PlatformIDFilter - } - qPlatformIDFilter := qrPlatformIDFilter.String() - if qPlatformIDFilter != "" { - - if err := r.SetQueryParam("platformIdFilter", qPlatformIDFilter); err != nil { - return err - } - } - } - - if o.PolicyTagFilter != nil { - - // query param policyTagFilter - var qrPolicyTagFilter string - - if o.PolicyTagFilter != nil { - qrPolicyTagFilter = *o.PolicyTagFilter - } - qPolicyTagFilter := qrPolicyTagFilter - if qPolicyTagFilter != "" { - - if err := r.SetQueryParam("policyTagFilter", qPolicyTagFilter); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/backups/get_all_backups_responses.go b/client/backups/get_all_backups_responses.go deleted file mode 100644 index 68af7ea..0000000 --- a/client/backups/get_all_backups_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllBackupsReader is a Reader for the GetAllBackups structure. -type GetAllBackupsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllBackupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllBackupsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllBackupsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllBackupsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllBackupsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllBackupsOK creates a GetAllBackupsOK with default headers values -func NewGetAllBackupsOK() *GetAllBackupsOK { - return &GetAllBackupsOK{} -} - -/* GetAllBackupsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllBackupsOK struct { - Payload *models.BackupsResult -} - -func (o *GetAllBackupsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backups][%d] getAllBackupsOK %+v", 200, o.Payload) -} -func (o *GetAllBackupsOK) GetPayload() *models.BackupsResult { - return o.Payload -} - -func (o *GetAllBackupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.BackupsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllBackupsUnauthorized creates a GetAllBackupsUnauthorized with default headers values -func NewGetAllBackupsUnauthorized() *GetAllBackupsUnauthorized { - return &GetAllBackupsUnauthorized{} -} - -/* GetAllBackupsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllBackupsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllBackupsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backups][%d] getAllBackupsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllBackupsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllBackupsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllBackupsForbidden creates a GetAllBackupsForbidden with default headers values -func NewGetAllBackupsForbidden() *GetAllBackupsForbidden { - return &GetAllBackupsForbidden{} -} - -/* GetAllBackupsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllBackupsForbidden struct { - Payload *models.Error -} - -func (o *GetAllBackupsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backups][%d] getAllBackupsForbidden %+v", 403, o.Payload) -} -func (o *GetAllBackupsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllBackupsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllBackupsInternalServerError creates a GetAllBackupsInternalServerError with default headers values -func NewGetAllBackupsInternalServerError() *GetAllBackupsInternalServerError { - return &GetAllBackupsInternalServerError{} -} - -/* GetAllBackupsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllBackupsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllBackupsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backups][%d] getAllBackupsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllBackupsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllBackupsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/backups/get_backup_objects_parameters.go b/client/backups/get_backup_objects_parameters.go deleted file mode 100644 index 026a2a1..0000000 --- a/client/backups/get_backup_objects_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetBackupObjectsParams creates a new GetBackupObjectsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetBackupObjectsParams() *GetBackupObjectsParams { - return &GetBackupObjectsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetBackupObjectsParamsWithTimeout creates a new GetBackupObjectsParams object -// with the ability to set a timeout on a request. -func NewGetBackupObjectsParamsWithTimeout(timeout time.Duration) *GetBackupObjectsParams { - return &GetBackupObjectsParams{ - timeout: timeout, - } -} - -// NewGetBackupObjectsParamsWithContext creates a new GetBackupObjectsParams object -// with the ability to set a context for a request. -func NewGetBackupObjectsParamsWithContext(ctx context.Context) *GetBackupObjectsParams { - return &GetBackupObjectsParams{ - Context: ctx, - } -} - -// NewGetBackupObjectsParamsWithHTTPClient creates a new GetBackupObjectsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetBackupObjectsParamsWithHTTPClient(client *http.Client) *GetBackupObjectsParams { - return &GetBackupObjectsParams{ - HTTPClient: client, - } -} - -/* GetBackupObjectsParams contains all the parameters to send to the API endpoint - for the get backup objects operation. - - Typically these are written to a http.Request. -*/ -type GetBackupObjectsParams struct { - - /* ID. - - ID of the backup. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get backup objects params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetBackupObjectsParams) WithDefaults() *GetBackupObjectsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get backup objects params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetBackupObjectsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetBackupObjectsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get backup objects params -func (o *GetBackupObjectsParams) WithTimeout(timeout time.Duration) *GetBackupObjectsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get backup objects params -func (o *GetBackupObjectsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get backup objects params -func (o *GetBackupObjectsParams) WithContext(ctx context.Context) *GetBackupObjectsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get backup objects params -func (o *GetBackupObjectsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get backup objects params -func (o *GetBackupObjectsParams) WithHTTPClient(client *http.Client) *GetBackupObjectsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get backup objects params -func (o *GetBackupObjectsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get backup objects params -func (o *GetBackupObjectsParams) WithID(id strfmt.UUID) *GetBackupObjectsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get backup objects params -func (o *GetBackupObjectsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get backup objects params -func (o *GetBackupObjectsParams) WithXAPIVersion(xAPIVersion string) *GetBackupObjectsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get backup objects params -func (o *GetBackupObjectsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetBackupObjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/backups/get_backup_objects_responses.go b/client/backups/get_backup_objects_responses.go deleted file mode 100644 index 1359cf1..0000000 --- a/client/backups/get_backup_objects_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetBackupObjectsReader is a Reader for the GetBackupObjects structure. -type GetBackupObjectsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetBackupObjectsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetBackupObjectsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetBackupObjectsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetBackupObjectsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetBackupObjectsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetBackupObjectsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetBackupObjectsOK creates a GetBackupObjectsOK with default headers values -func NewGetBackupObjectsOK() *GetBackupObjectsOK { - return &GetBackupObjectsOK{} -} - -/* GetBackupObjectsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetBackupObjectsOK struct { - Payload *models.BackupObjectsResult -} - -func (o *GetBackupObjectsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}/objects][%d] getBackupObjectsOK %+v", 200, o.Payload) -} -func (o *GetBackupObjectsOK) GetPayload() *models.BackupObjectsResult { - return o.Payload -} - -func (o *GetBackupObjectsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.BackupObjectsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectsUnauthorized creates a GetBackupObjectsUnauthorized with default headers values -func NewGetBackupObjectsUnauthorized() *GetBackupObjectsUnauthorized { - return &GetBackupObjectsUnauthorized{} -} - -/* GetBackupObjectsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetBackupObjectsUnauthorized struct { - Payload *models.Error -} - -func (o *GetBackupObjectsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}/objects][%d] getBackupObjectsUnauthorized %+v", 401, o.Payload) -} -func (o *GetBackupObjectsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectsForbidden creates a GetBackupObjectsForbidden with default headers values -func NewGetBackupObjectsForbidden() *GetBackupObjectsForbidden { - return &GetBackupObjectsForbidden{} -} - -/* GetBackupObjectsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetBackupObjectsForbidden struct { - Payload *models.Error -} - -func (o *GetBackupObjectsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}/objects][%d] getBackupObjectsForbidden %+v", 403, o.Payload) -} -func (o *GetBackupObjectsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectsNotFound creates a GetBackupObjectsNotFound with default headers values -func NewGetBackupObjectsNotFound() *GetBackupObjectsNotFound { - return &GetBackupObjectsNotFound{} -} - -/* GetBackupObjectsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetBackupObjectsNotFound struct { - Payload *models.Error -} - -func (o *GetBackupObjectsNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}/objects][%d] getBackupObjectsNotFound %+v", 404, o.Payload) -} -func (o *GetBackupObjectsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupObjectsInternalServerError creates a GetBackupObjectsInternalServerError with default headers values -func NewGetBackupObjectsInternalServerError() *GetBackupObjectsInternalServerError { - return &GetBackupObjectsInternalServerError{} -} - -/* GetBackupObjectsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetBackupObjectsInternalServerError struct { - Payload *models.Error -} - -func (o *GetBackupObjectsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}/objects][%d] getBackupObjectsInternalServerError %+v", 500, o.Payload) -} -func (o *GetBackupObjectsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupObjectsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/backups/get_backup_parameters.go b/client/backups/get_backup_parameters.go deleted file mode 100644 index f0bc663..0000000 --- a/client/backups/get_backup_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetBackupParams creates a new GetBackupParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetBackupParams() *GetBackupParams { - return &GetBackupParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetBackupParamsWithTimeout creates a new GetBackupParams object -// with the ability to set a timeout on a request. -func NewGetBackupParamsWithTimeout(timeout time.Duration) *GetBackupParams { - return &GetBackupParams{ - timeout: timeout, - } -} - -// NewGetBackupParamsWithContext creates a new GetBackupParams object -// with the ability to set a context for a request. -func NewGetBackupParamsWithContext(ctx context.Context) *GetBackupParams { - return &GetBackupParams{ - Context: ctx, - } -} - -// NewGetBackupParamsWithHTTPClient creates a new GetBackupParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetBackupParamsWithHTTPClient(client *http.Client) *GetBackupParams { - return &GetBackupParams{ - HTTPClient: client, - } -} - -/* GetBackupParams contains all the parameters to send to the API endpoint - for the get backup operation. - - Typically these are written to a http.Request. -*/ -type GetBackupParams struct { - - /* ID. - - ID of the backup. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetBackupParams) WithDefaults() *GetBackupParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetBackupParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetBackupParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get backup params -func (o *GetBackupParams) WithTimeout(timeout time.Duration) *GetBackupParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get backup params -func (o *GetBackupParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get backup params -func (o *GetBackupParams) WithContext(ctx context.Context) *GetBackupParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get backup params -func (o *GetBackupParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get backup params -func (o *GetBackupParams) WithHTTPClient(client *http.Client) *GetBackupParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get backup params -func (o *GetBackupParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get backup params -func (o *GetBackupParams) WithID(id strfmt.UUID) *GetBackupParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get backup params -func (o *GetBackupParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get backup params -func (o *GetBackupParams) WithXAPIVersion(xAPIVersion string) *GetBackupParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get backup params -func (o *GetBackupParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/backups/get_backup_responses.go b/client/backups/get_backup_responses.go deleted file mode 100644 index cc47e4d..0000000 --- a/client/backups/get_backup_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetBackupReader is a Reader for the GetBackup structure. -type GetBackupReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetBackupOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetBackupUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetBackupForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetBackupNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetBackupInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetBackupOK creates a GetBackupOK with default headers values -func NewGetBackupOK() *GetBackupOK { - return &GetBackupOK{} -} - -/* GetBackupOK describes a response with status code 200, with default header values. - -OK -*/ -type GetBackupOK struct { - Payload *models.BackupModel -} - -func (o *GetBackupOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}][%d] getBackupOK %+v", 200, o.Payload) -} -func (o *GetBackupOK) GetPayload() *models.BackupModel { - return o.Payload -} - -func (o *GetBackupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.BackupModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupUnauthorized creates a GetBackupUnauthorized with default headers values -func NewGetBackupUnauthorized() *GetBackupUnauthorized { - return &GetBackupUnauthorized{} -} - -/* GetBackupUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetBackupUnauthorized struct { - Payload *models.Error -} - -func (o *GetBackupUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}][%d] getBackupUnauthorized %+v", 401, o.Payload) -} -func (o *GetBackupUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupForbidden creates a GetBackupForbidden with default headers values -func NewGetBackupForbidden() *GetBackupForbidden { - return &GetBackupForbidden{} -} - -/* GetBackupForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetBackupForbidden struct { - Payload *models.Error -} - -func (o *GetBackupForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}][%d] getBackupForbidden %+v", 403, o.Payload) -} -func (o *GetBackupForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupNotFound creates a GetBackupNotFound with default headers values -func NewGetBackupNotFound() *GetBackupNotFound { - return &GetBackupNotFound{} -} - -/* GetBackupNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetBackupNotFound struct { - Payload *models.Error -} - -func (o *GetBackupNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}][%d] getBackupNotFound %+v", 404, o.Payload) -} -func (o *GetBackupNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetBackupInternalServerError creates a GetBackupInternalServerError with default headers values -func NewGetBackupInternalServerError() *GetBackupInternalServerError { - return &GetBackupInternalServerError{} -} - -/* GetBackupInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetBackupInternalServerError struct { - Payload *models.Error -} - -func (o *GetBackupInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backups/{id}][%d] getBackupInternalServerError %+v", 500, o.Payload) -} -func (o *GetBackupInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetBackupInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/configuration_backup/configuration_backup_client.go b/client/configuration_backup/configuration_backup_client.go deleted file mode 100644 index aaf6d19..0000000 --- a/client/configuration_backup/configuration_backup_client.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package configuration_backup - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new configuration backup API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for configuration backup API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetConfigBackupOptions(params *GetConfigBackupOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConfigBackupOptionsOK, error) - - StartConfigBackup(params *StartConfigBackupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartConfigBackupOK, error) - - UpdateConfigBackupOptions(params *UpdateConfigBackupOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigBackupOptionsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetConfigBackupOptions gets configuration backup - - The HTTP GET request to the `/api/v1/configBackup` path allows you to get configuration backup of the backup server. -*/ -func (a *Client) GetConfigBackupOptions(params *GetConfigBackupOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConfigBackupOptionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetConfigBackupOptionsParams() - } - op := &runtime.ClientOperation{ - ID: "GetConfigBackupOptions", - Method: "GET", - PathPattern: "/api/v1/configBackup", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetConfigBackupOptionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetConfigBackupOptionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetConfigBackupOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - StartConfigBackup starts configuration backup - - The HTTP POST request to the `/api/v1/configBackup` path allows you to start configuration backup. -*/ -func (a *Client) StartConfigBackup(params *StartConfigBackupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartConfigBackupOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewStartConfigBackupParams() - } - op := &runtime.ClientOperation{ - ID: "StartConfigBackup", - Method: "POST", - PathPattern: "/api/v1/configBackup/backup", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &StartConfigBackupReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*StartConfigBackupOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for StartConfigBackup: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateConfigBackupOptions edits configuration backup - - The HTTP PUT request to the `/api/v1/configBackup` path allows you to edit configuration backup of the backup server. -*/ -func (a *Client) UpdateConfigBackupOptions(params *UpdateConfigBackupOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigBackupOptionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateConfigBackupOptionsParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateConfigBackupOptions", - Method: "PUT", - PathPattern: "/api/v1/configBackup", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateConfigBackupOptionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateConfigBackupOptionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateConfigBackupOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/configuration_backup/get_config_backup_options_parameters.go b/client/configuration_backup/get_config_backup_options_parameters.go deleted file mode 100644 index 05ddcec..0000000 --- a/client/configuration_backup/get_config_backup_options_parameters.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package configuration_backup - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetConfigBackupOptionsParams creates a new GetConfigBackupOptionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetConfigBackupOptionsParams() *GetConfigBackupOptionsParams { - return &GetConfigBackupOptionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetConfigBackupOptionsParamsWithTimeout creates a new GetConfigBackupOptionsParams object -// with the ability to set a timeout on a request. -func NewGetConfigBackupOptionsParamsWithTimeout(timeout time.Duration) *GetConfigBackupOptionsParams { - return &GetConfigBackupOptionsParams{ - timeout: timeout, - } -} - -// NewGetConfigBackupOptionsParamsWithContext creates a new GetConfigBackupOptionsParams object -// with the ability to set a context for a request. -func NewGetConfigBackupOptionsParamsWithContext(ctx context.Context) *GetConfigBackupOptionsParams { - return &GetConfigBackupOptionsParams{ - Context: ctx, - } -} - -// NewGetConfigBackupOptionsParamsWithHTTPClient creates a new GetConfigBackupOptionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetConfigBackupOptionsParamsWithHTTPClient(client *http.Client) *GetConfigBackupOptionsParams { - return &GetConfigBackupOptionsParams{ - HTTPClient: client, - } -} - -/* GetConfigBackupOptionsParams contains all the parameters to send to the API endpoint - for the get config backup options operation. - - Typically these are written to a http.Request. -*/ -type GetConfigBackupOptionsParams struct { - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get config backup options params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetConfigBackupOptionsParams) WithDefaults() *GetConfigBackupOptionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get config backup options params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetConfigBackupOptionsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetConfigBackupOptionsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get config backup options params -func (o *GetConfigBackupOptionsParams) WithTimeout(timeout time.Duration) *GetConfigBackupOptionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get config backup options params -func (o *GetConfigBackupOptionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get config backup options params -func (o *GetConfigBackupOptionsParams) WithContext(ctx context.Context) *GetConfigBackupOptionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get config backup options params -func (o *GetConfigBackupOptionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get config backup options params -func (o *GetConfigBackupOptionsParams) WithHTTPClient(client *http.Client) *GetConfigBackupOptionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get config backup options params -func (o *GetConfigBackupOptionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXAPIVersion adds the xAPIVersion to the get config backup options params -func (o *GetConfigBackupOptionsParams) WithXAPIVersion(xAPIVersion string) *GetConfigBackupOptionsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get config backup options params -func (o *GetConfigBackupOptionsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetConfigBackupOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/configuration_backup/get_config_backup_options_responses.go b/client/configuration_backup/get_config_backup_options_responses.go deleted file mode 100644 index 5249042..0000000 --- a/client/configuration_backup/get_config_backup_options_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package configuration_backup - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetConfigBackupOptionsReader is a Reader for the GetConfigBackupOptions structure. -type GetConfigBackupOptionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetConfigBackupOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetConfigBackupOptionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetConfigBackupOptionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetConfigBackupOptionsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetConfigBackupOptionsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetConfigBackupOptionsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetConfigBackupOptionsOK creates a GetConfigBackupOptionsOK with default headers values -func NewGetConfigBackupOptionsOK() *GetConfigBackupOptionsOK { - return &GetConfigBackupOptionsOK{} -} - -/* GetConfigBackupOptionsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetConfigBackupOptionsOK struct { - Payload *models.ConfigBackupModel -} - -func (o *GetConfigBackupOptionsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/configBackup][%d] getConfigBackupOptionsOK %+v", 200, o.Payload) -} -func (o *GetConfigBackupOptionsOK) GetPayload() *models.ConfigBackupModel { - return o.Payload -} - -func (o *GetConfigBackupOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ConfigBackupModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetConfigBackupOptionsUnauthorized creates a GetConfigBackupOptionsUnauthorized with default headers values -func NewGetConfigBackupOptionsUnauthorized() *GetConfigBackupOptionsUnauthorized { - return &GetConfigBackupOptionsUnauthorized{} -} - -/* GetConfigBackupOptionsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetConfigBackupOptionsUnauthorized struct { - Payload *models.Error -} - -func (o *GetConfigBackupOptionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/configBackup][%d] getConfigBackupOptionsUnauthorized %+v", 401, o.Payload) -} -func (o *GetConfigBackupOptionsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetConfigBackupOptionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetConfigBackupOptionsForbidden creates a GetConfigBackupOptionsForbidden with default headers values -func NewGetConfigBackupOptionsForbidden() *GetConfigBackupOptionsForbidden { - return &GetConfigBackupOptionsForbidden{} -} - -/* GetConfigBackupOptionsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetConfigBackupOptionsForbidden struct { - Payload *models.Error -} - -func (o *GetConfigBackupOptionsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/configBackup][%d] getConfigBackupOptionsForbidden %+v", 403, o.Payload) -} -func (o *GetConfigBackupOptionsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetConfigBackupOptionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetConfigBackupOptionsNotFound creates a GetConfigBackupOptionsNotFound with default headers values -func NewGetConfigBackupOptionsNotFound() *GetConfigBackupOptionsNotFound { - return &GetConfigBackupOptionsNotFound{} -} - -/* GetConfigBackupOptionsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetConfigBackupOptionsNotFound struct { - Payload *models.Error -} - -func (o *GetConfigBackupOptionsNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/configBackup][%d] getConfigBackupOptionsNotFound %+v", 404, o.Payload) -} -func (o *GetConfigBackupOptionsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetConfigBackupOptionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetConfigBackupOptionsInternalServerError creates a GetConfigBackupOptionsInternalServerError with default headers values -func NewGetConfigBackupOptionsInternalServerError() *GetConfigBackupOptionsInternalServerError { - return &GetConfigBackupOptionsInternalServerError{} -} - -/* GetConfigBackupOptionsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetConfigBackupOptionsInternalServerError struct { - Payload *models.Error -} - -func (o *GetConfigBackupOptionsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/configBackup][%d] getConfigBackupOptionsInternalServerError %+v", 500, o.Payload) -} -func (o *GetConfigBackupOptionsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetConfigBackupOptionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/configuration_backup/start_config_backup_parameters.go b/client/configuration_backup/start_config_backup_parameters.go deleted file mode 100644 index edebc87..0000000 --- a/client/configuration_backup/start_config_backup_parameters.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package configuration_backup - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewStartConfigBackupParams creates a new StartConfigBackupParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewStartConfigBackupParams() *StartConfigBackupParams { - return &StartConfigBackupParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStartConfigBackupParamsWithTimeout creates a new StartConfigBackupParams object -// with the ability to set a timeout on a request. -func NewStartConfigBackupParamsWithTimeout(timeout time.Duration) *StartConfigBackupParams { - return &StartConfigBackupParams{ - timeout: timeout, - } -} - -// NewStartConfigBackupParamsWithContext creates a new StartConfigBackupParams object -// with the ability to set a context for a request. -func NewStartConfigBackupParamsWithContext(ctx context.Context) *StartConfigBackupParams { - return &StartConfigBackupParams{ - Context: ctx, - } -} - -// NewStartConfigBackupParamsWithHTTPClient creates a new StartConfigBackupParams object -// with the ability to set a custom HTTPClient for a request. -func NewStartConfigBackupParamsWithHTTPClient(client *http.Client) *StartConfigBackupParams { - return &StartConfigBackupParams{ - HTTPClient: client, - } -} - -/* StartConfigBackupParams contains all the parameters to send to the API endpoint - for the start config backup operation. - - Typically these are written to a http.Request. -*/ -type StartConfigBackupParams struct { - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the start config backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartConfigBackupParams) WithDefaults() *StartConfigBackupParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the start config backup params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartConfigBackupParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := StartConfigBackupParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the start config backup params -func (o *StartConfigBackupParams) WithTimeout(timeout time.Duration) *StartConfigBackupParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the start config backup params -func (o *StartConfigBackupParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the start config backup params -func (o *StartConfigBackupParams) WithContext(ctx context.Context) *StartConfigBackupParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the start config backup params -func (o *StartConfigBackupParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the start config backup params -func (o *StartConfigBackupParams) WithHTTPClient(client *http.Client) *StartConfigBackupParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the start config backup params -func (o *StartConfigBackupParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXAPIVersion adds the xAPIVersion to the start config backup params -func (o *StartConfigBackupParams) WithXAPIVersion(xAPIVersion string) *StartConfigBackupParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the start config backup params -func (o *StartConfigBackupParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *StartConfigBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/configuration_backup/start_config_backup_responses.go b/client/configuration_backup/start_config_backup_responses.go deleted file mode 100644 index 1ad9fff..0000000 --- a/client/configuration_backup/start_config_backup_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package configuration_backup - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// StartConfigBackupReader is a Reader for the StartConfigBackup structure. -type StartConfigBackupReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StartConfigBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewStartConfigBackupOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewStartConfigBackupBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewStartConfigBackupUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewStartConfigBackupForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewStartConfigBackupInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewStartConfigBackupOK creates a StartConfigBackupOK with default headers values -func NewStartConfigBackupOK() *StartConfigBackupOK { - return &StartConfigBackupOK{} -} - -/* StartConfigBackupOK describes a response with status code 200, with default header values. - -Configuration backup has been started. -*/ -type StartConfigBackupOK struct { - Payload *models.SessionModel -} - -func (o *StartConfigBackupOK) Error() string { - return fmt.Sprintf("[POST /api/v1/configBackup/backup][%d] startConfigBackupOK %+v", 200, o.Payload) -} -func (o *StartConfigBackupOK) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *StartConfigBackupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartConfigBackupBadRequest creates a StartConfigBackupBadRequest with default headers values -func NewStartConfigBackupBadRequest() *StartConfigBackupBadRequest { - return &StartConfigBackupBadRequest{} -} - -/* StartConfigBackupBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type StartConfigBackupBadRequest struct { - Payload *models.Error -} - -func (o *StartConfigBackupBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/configBackup/backup][%d] startConfigBackupBadRequest %+v", 400, o.Payload) -} -func (o *StartConfigBackupBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartConfigBackupBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartConfigBackupUnauthorized creates a StartConfigBackupUnauthorized with default headers values -func NewStartConfigBackupUnauthorized() *StartConfigBackupUnauthorized { - return &StartConfigBackupUnauthorized{} -} - -/* StartConfigBackupUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type StartConfigBackupUnauthorized struct { - Payload *models.Error -} - -func (o *StartConfigBackupUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/configBackup/backup][%d] startConfigBackupUnauthorized %+v", 401, o.Payload) -} -func (o *StartConfigBackupUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartConfigBackupUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartConfigBackupForbidden creates a StartConfigBackupForbidden with default headers values -func NewStartConfigBackupForbidden() *StartConfigBackupForbidden { - return &StartConfigBackupForbidden{} -} - -/* StartConfigBackupForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type StartConfigBackupForbidden struct { - Payload *models.Error -} - -func (o *StartConfigBackupForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/configBackup/backup][%d] startConfigBackupForbidden %+v", 403, o.Payload) -} -func (o *StartConfigBackupForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartConfigBackupForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartConfigBackupInternalServerError creates a StartConfigBackupInternalServerError with default headers values -func NewStartConfigBackupInternalServerError() *StartConfigBackupInternalServerError { - return &StartConfigBackupInternalServerError{} -} - -/* StartConfigBackupInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type StartConfigBackupInternalServerError struct { - Payload *models.Error -} - -func (o *StartConfigBackupInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/configBackup/backup][%d] startConfigBackupInternalServerError %+v", 500, o.Payload) -} -func (o *StartConfigBackupInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartConfigBackupInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/configuration_backup/update_config_backup_options_parameters.go b/client/configuration_backup/update_config_backup_options_parameters.go deleted file mode 100644 index ea5b1af..0000000 --- a/client/configuration_backup/update_config_backup_options_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package configuration_backup - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateConfigBackupOptionsParams creates a new UpdateConfigBackupOptionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateConfigBackupOptionsParams() *UpdateConfigBackupOptionsParams { - return &UpdateConfigBackupOptionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateConfigBackupOptionsParamsWithTimeout creates a new UpdateConfigBackupOptionsParams object -// with the ability to set a timeout on a request. -func NewUpdateConfigBackupOptionsParamsWithTimeout(timeout time.Duration) *UpdateConfigBackupOptionsParams { - return &UpdateConfigBackupOptionsParams{ - timeout: timeout, - } -} - -// NewUpdateConfigBackupOptionsParamsWithContext creates a new UpdateConfigBackupOptionsParams object -// with the ability to set a context for a request. -func NewUpdateConfigBackupOptionsParamsWithContext(ctx context.Context) *UpdateConfigBackupOptionsParams { - return &UpdateConfigBackupOptionsParams{ - Context: ctx, - } -} - -// NewUpdateConfigBackupOptionsParamsWithHTTPClient creates a new UpdateConfigBackupOptionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateConfigBackupOptionsParamsWithHTTPClient(client *http.Client) *UpdateConfigBackupOptionsParams { - return &UpdateConfigBackupOptionsParams{ - HTTPClient: client, - } -} - -/* UpdateConfigBackupOptionsParams contains all the parameters to send to the API endpoint - for the update config backup options operation. - - Typically these are written to a http.Request. -*/ -type UpdateConfigBackupOptionsParams struct { - - // Body. - Body *models.ConfigBackupModel - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update config backup options params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateConfigBackupOptionsParams) WithDefaults() *UpdateConfigBackupOptionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update config backup options params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateConfigBackupOptionsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateConfigBackupOptionsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) WithTimeout(timeout time.Duration) *UpdateConfigBackupOptionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) WithContext(ctx context.Context) *UpdateConfigBackupOptionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) WithHTTPClient(client *http.Client) *UpdateConfigBackupOptionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) WithBody(body *models.ConfigBackupModel) *UpdateConfigBackupOptionsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) SetBody(body *models.ConfigBackupModel) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) WithXAPIVersion(xAPIVersion string) *UpdateConfigBackupOptionsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update config backup options params -func (o *UpdateConfigBackupOptionsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateConfigBackupOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/configuration_backup/update_config_backup_options_responses.go b/client/configuration_backup/update_config_backup_options_responses.go deleted file mode 100644 index 50129a3..0000000 --- a/client/configuration_backup/update_config_backup_options_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package configuration_backup - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateConfigBackupOptionsReader is a Reader for the UpdateConfigBackupOptions structure. -type UpdateConfigBackupOptionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateConfigBackupOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateConfigBackupOptionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateConfigBackupOptionsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateConfigBackupOptionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateConfigBackupOptionsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateConfigBackupOptionsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateConfigBackupOptionsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateConfigBackupOptionsOK creates a UpdateConfigBackupOptionsOK with default headers values -func NewUpdateConfigBackupOptionsOK() *UpdateConfigBackupOptionsOK { - return &UpdateConfigBackupOptionsOK{} -} - -/* UpdateConfigBackupOptionsOK describes a response with status code 200, with default header values. - -Configuration backup settings have been updated. -*/ -type UpdateConfigBackupOptionsOK struct { - Payload *models.ConfigBackupModel -} - -func (o *UpdateConfigBackupOptionsOK) Error() string { - return fmt.Sprintf("[PUT /api/v1/configBackup][%d] updateConfigBackupOptionsOK %+v", 200, o.Payload) -} -func (o *UpdateConfigBackupOptionsOK) GetPayload() *models.ConfigBackupModel { - return o.Payload -} - -func (o *UpdateConfigBackupOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ConfigBackupModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigBackupOptionsBadRequest creates a UpdateConfigBackupOptionsBadRequest with default headers values -func NewUpdateConfigBackupOptionsBadRequest() *UpdateConfigBackupOptionsBadRequest { - return &UpdateConfigBackupOptionsBadRequest{} -} - -/* UpdateConfigBackupOptionsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateConfigBackupOptionsBadRequest struct { - Payload *models.Error -} - -func (o *UpdateConfigBackupOptionsBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/configBackup][%d] updateConfigBackupOptionsBadRequest %+v", 400, o.Payload) -} -func (o *UpdateConfigBackupOptionsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateConfigBackupOptionsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigBackupOptionsUnauthorized creates a UpdateConfigBackupOptionsUnauthorized with default headers values -func NewUpdateConfigBackupOptionsUnauthorized() *UpdateConfigBackupOptionsUnauthorized { - return &UpdateConfigBackupOptionsUnauthorized{} -} - -/* UpdateConfigBackupOptionsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateConfigBackupOptionsUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateConfigBackupOptionsUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/configBackup][%d] updateConfigBackupOptionsUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateConfigBackupOptionsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateConfigBackupOptionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigBackupOptionsForbidden creates a UpdateConfigBackupOptionsForbidden with default headers values -func NewUpdateConfigBackupOptionsForbidden() *UpdateConfigBackupOptionsForbidden { - return &UpdateConfigBackupOptionsForbidden{} -} - -/* UpdateConfigBackupOptionsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateConfigBackupOptionsForbidden struct { - Payload *models.Error -} - -func (o *UpdateConfigBackupOptionsForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/configBackup][%d] updateConfigBackupOptionsForbidden %+v", 403, o.Payload) -} -func (o *UpdateConfigBackupOptionsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateConfigBackupOptionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigBackupOptionsNotFound creates a UpdateConfigBackupOptionsNotFound with default headers values -func NewUpdateConfigBackupOptionsNotFound() *UpdateConfigBackupOptionsNotFound { - return &UpdateConfigBackupOptionsNotFound{} -} - -/* UpdateConfigBackupOptionsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type UpdateConfigBackupOptionsNotFound struct { - Payload *models.Error -} - -func (o *UpdateConfigBackupOptionsNotFound) Error() string { - return fmt.Sprintf("[PUT /api/v1/configBackup][%d] updateConfigBackupOptionsNotFound %+v", 404, o.Payload) -} -func (o *UpdateConfigBackupOptionsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateConfigBackupOptionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigBackupOptionsInternalServerError creates a UpdateConfigBackupOptionsInternalServerError with default headers values -func NewUpdateConfigBackupOptionsInternalServerError() *UpdateConfigBackupOptionsInternalServerError { - return &UpdateConfigBackupOptionsInternalServerError{} -} - -/* UpdateConfigBackupOptionsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateConfigBackupOptionsInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateConfigBackupOptionsInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/configBackup][%d] updateConfigBackupOptionsInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateConfigBackupOptionsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateConfigBackupOptionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/connection/connection_client.go b/client/connection/connection_client.go deleted file mode 100644 index 578faa7..0000000 --- a/client/connection/connection_client.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package connection - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new connection API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for connection API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetConnectionCertificate(params *GetConnectionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConnectionCertificateCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetConnectionCertificate requests TLS certificate or SSH fingerprint - - The HTTP POST request to the `/api/v1/connectionCertificate` path allows you to get a TLS certificate or SSH fingerprint of the specified host. -*/ -func (a *Client) GetConnectionCertificate(params *GetConnectionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConnectionCertificateCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetConnectionCertificateParams() - } - op := &runtime.ClientOperation{ - ID: "GetConnectionCertificate", - Method: "POST", - PathPattern: "/api/v1/connectionCertificate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetConnectionCertificateReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetConnectionCertificateCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetConnectionCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/connection/get_connection_certificate_parameters.go b/client/connection/get_connection_certificate_parameters.go deleted file mode 100644 index 2cae2ea..0000000 --- a/client/connection/get_connection_certificate_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package connection - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewGetConnectionCertificateParams creates a new GetConnectionCertificateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetConnectionCertificateParams() *GetConnectionCertificateParams { - return &GetConnectionCertificateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetConnectionCertificateParamsWithTimeout creates a new GetConnectionCertificateParams object -// with the ability to set a timeout on a request. -func NewGetConnectionCertificateParamsWithTimeout(timeout time.Duration) *GetConnectionCertificateParams { - return &GetConnectionCertificateParams{ - timeout: timeout, - } -} - -// NewGetConnectionCertificateParamsWithContext creates a new GetConnectionCertificateParams object -// with the ability to set a context for a request. -func NewGetConnectionCertificateParamsWithContext(ctx context.Context) *GetConnectionCertificateParams { - return &GetConnectionCertificateParams{ - Context: ctx, - } -} - -// NewGetConnectionCertificateParamsWithHTTPClient creates a new GetConnectionCertificateParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetConnectionCertificateParamsWithHTTPClient(client *http.Client) *GetConnectionCertificateParams { - return &GetConnectionCertificateParams{ - HTTPClient: client, - } -} - -/* GetConnectionCertificateParams contains all the parameters to send to the API endpoint - for the get connection certificate operation. - - Typically these are written to a http.Request. -*/ -type GetConnectionCertificateParams struct { - - // Body. - Body *models.HostConnectionSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get connection certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetConnectionCertificateParams) WithDefaults() *GetConnectionCertificateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get connection certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetConnectionCertificateParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetConnectionCertificateParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get connection certificate params -func (o *GetConnectionCertificateParams) WithTimeout(timeout time.Duration) *GetConnectionCertificateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get connection certificate params -func (o *GetConnectionCertificateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get connection certificate params -func (o *GetConnectionCertificateParams) WithContext(ctx context.Context) *GetConnectionCertificateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get connection certificate params -func (o *GetConnectionCertificateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get connection certificate params -func (o *GetConnectionCertificateParams) WithHTTPClient(client *http.Client) *GetConnectionCertificateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get connection certificate params -func (o *GetConnectionCertificateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get connection certificate params -func (o *GetConnectionCertificateParams) WithBody(body *models.HostConnectionSpec) *GetConnectionCertificateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get connection certificate params -func (o *GetConnectionCertificateParams) SetBody(body *models.HostConnectionSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the get connection certificate params -func (o *GetConnectionCertificateParams) WithXAPIVersion(xAPIVersion string) *GetConnectionCertificateParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get connection certificate params -func (o *GetConnectionCertificateParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetConnectionCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/connection/get_connection_certificate_responses.go b/client/connection/get_connection_certificate_responses.go deleted file mode 100644 index 6fcce17..0000000 --- a/client/connection/get_connection_certificate_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package connection - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetConnectionCertificateReader is a Reader for the GetConnectionCertificate structure. -type GetConnectionCertificateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetConnectionCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewGetConnectionCertificateCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewGetConnectionCertificateBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewGetConnectionCertificateUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetConnectionCertificateForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetConnectionCertificateInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetConnectionCertificateCreated creates a GetConnectionCertificateCreated with default headers values -func NewGetConnectionCertificateCreated() *GetConnectionCertificateCreated { - return &GetConnectionCertificateCreated{} -} - -/* GetConnectionCertificateCreated describes a response with status code 201, with default header values. - -OK -*/ -type GetConnectionCertificateCreated struct { - Payload *models.ConnectionCertificateModel -} - -func (o *GetConnectionCertificateCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/connectionCertificate][%d] getConnectionCertificateCreated %+v", 201, o.Payload) -} -func (o *GetConnectionCertificateCreated) GetPayload() *models.ConnectionCertificateModel { - return o.Payload -} - -func (o *GetConnectionCertificateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ConnectionCertificateModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetConnectionCertificateBadRequest creates a GetConnectionCertificateBadRequest with default headers values -func NewGetConnectionCertificateBadRequest() *GetConnectionCertificateBadRequest { - return &GetConnectionCertificateBadRequest{} -} - -/* GetConnectionCertificateBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type GetConnectionCertificateBadRequest struct { - Payload *models.Error -} - -func (o *GetConnectionCertificateBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/connectionCertificate][%d] getConnectionCertificateBadRequest %+v", 400, o.Payload) -} -func (o *GetConnectionCertificateBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetConnectionCertificateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetConnectionCertificateUnauthorized creates a GetConnectionCertificateUnauthorized with default headers values -func NewGetConnectionCertificateUnauthorized() *GetConnectionCertificateUnauthorized { - return &GetConnectionCertificateUnauthorized{} -} - -/* GetConnectionCertificateUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetConnectionCertificateUnauthorized struct { - Payload *models.Error -} - -func (o *GetConnectionCertificateUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/connectionCertificate][%d] getConnectionCertificateUnauthorized %+v", 401, o.Payload) -} -func (o *GetConnectionCertificateUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetConnectionCertificateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetConnectionCertificateForbidden creates a GetConnectionCertificateForbidden with default headers values -func NewGetConnectionCertificateForbidden() *GetConnectionCertificateForbidden { - return &GetConnectionCertificateForbidden{} -} - -/* GetConnectionCertificateForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetConnectionCertificateForbidden struct { - Payload *models.Error -} - -func (o *GetConnectionCertificateForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/connectionCertificate][%d] getConnectionCertificateForbidden %+v", 403, o.Payload) -} -func (o *GetConnectionCertificateForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetConnectionCertificateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetConnectionCertificateInternalServerError creates a GetConnectionCertificateInternalServerError with default headers values -func NewGetConnectionCertificateInternalServerError() *GetConnectionCertificateInternalServerError { - return &GetConnectionCertificateInternalServerError{} -} - -/* GetConnectionCertificateInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetConnectionCertificateInternalServerError struct { - Payload *models.Error -} - -func (o *GetConnectionCertificateInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/connectionCertificate][%d] getConnectionCertificateInternalServerError %+v", 500, o.Payload) -} -func (o *GetConnectionCertificateInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetConnectionCertificateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/credentials/change_password_for_creds_parameters.go b/client/credentials/change_password_for_creds_parameters.go deleted file mode 100644 index 46e16cf..0000000 --- a/client/credentials/change_password_for_creds_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewChangePasswordForCredsParams creates a new ChangePasswordForCredsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewChangePasswordForCredsParams() *ChangePasswordForCredsParams { - return &ChangePasswordForCredsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangePasswordForCredsParamsWithTimeout creates a new ChangePasswordForCredsParams object -// with the ability to set a timeout on a request. -func NewChangePasswordForCredsParamsWithTimeout(timeout time.Duration) *ChangePasswordForCredsParams { - return &ChangePasswordForCredsParams{ - timeout: timeout, - } -} - -// NewChangePasswordForCredsParamsWithContext creates a new ChangePasswordForCredsParams object -// with the ability to set a context for a request. -func NewChangePasswordForCredsParamsWithContext(ctx context.Context) *ChangePasswordForCredsParams { - return &ChangePasswordForCredsParams{ - Context: ctx, - } -} - -// NewChangePasswordForCredsParamsWithHTTPClient creates a new ChangePasswordForCredsParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangePasswordForCredsParamsWithHTTPClient(client *http.Client) *ChangePasswordForCredsParams { - return &ChangePasswordForCredsParams{ - HTTPClient: client, - } -} - -/* ChangePasswordForCredsParams contains all the parameters to send to the API endpoint - for the change password for creds operation. - - Typically these are written to a http.Request. -*/ -type ChangePasswordForCredsParams struct { - - // Body. - Body *models.CredentialsPasswordChangeSpec - - /* ID. - - ID of the credentials record. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change password for creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangePasswordForCredsParams) WithDefaults() *ChangePasswordForCredsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change password for creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangePasswordForCredsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ChangePasswordForCredsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the change password for creds params -func (o *ChangePasswordForCredsParams) WithTimeout(timeout time.Duration) *ChangePasswordForCredsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change password for creds params -func (o *ChangePasswordForCredsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change password for creds params -func (o *ChangePasswordForCredsParams) WithContext(ctx context.Context) *ChangePasswordForCredsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change password for creds params -func (o *ChangePasswordForCredsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change password for creds params -func (o *ChangePasswordForCredsParams) WithHTTPClient(client *http.Client) *ChangePasswordForCredsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change password for creds params -func (o *ChangePasswordForCredsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change password for creds params -func (o *ChangePasswordForCredsParams) WithBody(body *models.CredentialsPasswordChangeSpec) *ChangePasswordForCredsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change password for creds params -func (o *ChangePasswordForCredsParams) SetBody(body *models.CredentialsPasswordChangeSpec) { - o.Body = body -} - -// WithID adds the id to the change password for creds params -func (o *ChangePasswordForCredsParams) WithID(id strfmt.UUID) *ChangePasswordForCredsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the change password for creds params -func (o *ChangePasswordForCredsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the change password for creds params -func (o *ChangePasswordForCredsParams) WithXAPIVersion(xAPIVersion string) *ChangePasswordForCredsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the change password for creds params -func (o *ChangePasswordForCredsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangePasswordForCredsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/credentials/change_password_for_creds_responses.go b/client/credentials/change_password_for_creds_responses.go deleted file mode 100644 index 4273063..0000000 --- a/client/credentials/change_password_for_creds_responses.go +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ChangePasswordForCredsReader is a Reader for the ChangePasswordForCreds structure. -type ChangePasswordForCredsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangePasswordForCredsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewChangePasswordForCredsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewChangePasswordForCredsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewChangePasswordForCredsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewChangePasswordForCredsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewChangePasswordForCredsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewChangePasswordForCredsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewChangePasswordForCredsOK creates a ChangePasswordForCredsOK with default headers values -func NewChangePasswordForCredsOK() *ChangePasswordForCredsOK { - return &ChangePasswordForCredsOK{} -} - -/* ChangePasswordForCredsOK describes a response with status code 200, with default header values. - -Password has been changed. -*/ -type ChangePasswordForCredsOK struct { - Payload models.EmptySuccessResponse -} - -func (o *ChangePasswordForCredsOK) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changepassword][%d] changePasswordForCredsOK %+v", 200, o.Payload) -} -func (o *ChangePasswordForCredsOK) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *ChangePasswordForCredsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePasswordForCredsBadRequest creates a ChangePasswordForCredsBadRequest with default headers values -func NewChangePasswordForCredsBadRequest() *ChangePasswordForCredsBadRequest { - return &ChangePasswordForCredsBadRequest{} -} - -/* ChangePasswordForCredsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ChangePasswordForCredsBadRequest struct { - Payload *models.Error -} - -func (o *ChangePasswordForCredsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changepassword][%d] changePasswordForCredsBadRequest %+v", 400, o.Payload) -} -func (o *ChangePasswordForCredsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePasswordForCredsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePasswordForCredsUnauthorized creates a ChangePasswordForCredsUnauthorized with default headers values -func NewChangePasswordForCredsUnauthorized() *ChangePasswordForCredsUnauthorized { - return &ChangePasswordForCredsUnauthorized{} -} - -/* ChangePasswordForCredsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ChangePasswordForCredsUnauthorized struct { - Payload *models.Error -} - -func (o *ChangePasswordForCredsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changepassword][%d] changePasswordForCredsUnauthorized %+v", 401, o.Payload) -} -func (o *ChangePasswordForCredsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePasswordForCredsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePasswordForCredsForbidden creates a ChangePasswordForCredsForbidden with default headers values -func NewChangePasswordForCredsForbidden() *ChangePasswordForCredsForbidden { - return &ChangePasswordForCredsForbidden{} -} - -/* ChangePasswordForCredsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ChangePasswordForCredsForbidden struct { - Payload *models.Error -} - -func (o *ChangePasswordForCredsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changepassword][%d] changePasswordForCredsForbidden %+v", 403, o.Payload) -} -func (o *ChangePasswordForCredsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePasswordForCredsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePasswordForCredsNotFound creates a ChangePasswordForCredsNotFound with default headers values -func NewChangePasswordForCredsNotFound() *ChangePasswordForCredsNotFound { - return &ChangePasswordForCredsNotFound{} -} - -/* ChangePasswordForCredsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type ChangePasswordForCredsNotFound struct { - Payload *models.Error -} - -func (o *ChangePasswordForCredsNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changepassword][%d] changePasswordForCredsNotFound %+v", 404, o.Payload) -} -func (o *ChangePasswordForCredsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePasswordForCredsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePasswordForCredsInternalServerError creates a ChangePasswordForCredsInternalServerError with default headers values -func NewChangePasswordForCredsInternalServerError() *ChangePasswordForCredsInternalServerError { - return &ChangePasswordForCredsInternalServerError{} -} - -/* ChangePasswordForCredsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ChangePasswordForCredsInternalServerError struct { - Payload *models.Error -} - -func (o *ChangePasswordForCredsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changepassword][%d] changePasswordForCredsInternalServerError %+v", 500, o.Payload) -} -func (o *ChangePasswordForCredsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePasswordForCredsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/credentials/change_private_key_for_creds_parameters.go b/client/credentials/change_private_key_for_creds_parameters.go deleted file mode 100644 index 45983a8..0000000 --- a/client/credentials/change_private_key_for_creds_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewChangePrivateKeyForCredsParams creates a new ChangePrivateKeyForCredsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewChangePrivateKeyForCredsParams() *ChangePrivateKeyForCredsParams { - return &ChangePrivateKeyForCredsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangePrivateKeyForCredsParamsWithTimeout creates a new ChangePrivateKeyForCredsParams object -// with the ability to set a timeout on a request. -func NewChangePrivateKeyForCredsParamsWithTimeout(timeout time.Duration) *ChangePrivateKeyForCredsParams { - return &ChangePrivateKeyForCredsParams{ - timeout: timeout, - } -} - -// NewChangePrivateKeyForCredsParamsWithContext creates a new ChangePrivateKeyForCredsParams object -// with the ability to set a context for a request. -func NewChangePrivateKeyForCredsParamsWithContext(ctx context.Context) *ChangePrivateKeyForCredsParams { - return &ChangePrivateKeyForCredsParams{ - Context: ctx, - } -} - -// NewChangePrivateKeyForCredsParamsWithHTTPClient creates a new ChangePrivateKeyForCredsParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangePrivateKeyForCredsParamsWithHTTPClient(client *http.Client) *ChangePrivateKeyForCredsParams { - return &ChangePrivateKeyForCredsParams{ - HTTPClient: client, - } -} - -/* ChangePrivateKeyForCredsParams contains all the parameters to send to the API endpoint - for the change private key for creds operation. - - Typically these are written to a http.Request. -*/ -type ChangePrivateKeyForCredsParams struct { - - // Body. - Body *models.PrivateKeyChangeSpec - - /* ID. - - ID of the credentials record. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change private key for creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangePrivateKeyForCredsParams) WithDefaults() *ChangePrivateKeyForCredsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change private key for creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangePrivateKeyForCredsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ChangePrivateKeyForCredsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) WithTimeout(timeout time.Duration) *ChangePrivateKeyForCredsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) WithContext(ctx context.Context) *ChangePrivateKeyForCredsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) WithHTTPClient(client *http.Client) *ChangePrivateKeyForCredsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) WithBody(body *models.PrivateKeyChangeSpec) *ChangePrivateKeyForCredsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) SetBody(body *models.PrivateKeyChangeSpec) { - o.Body = body -} - -// WithID adds the id to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) WithID(id strfmt.UUID) *ChangePrivateKeyForCredsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) WithXAPIVersion(xAPIVersion string) *ChangePrivateKeyForCredsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the change private key for creds params -func (o *ChangePrivateKeyForCredsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangePrivateKeyForCredsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/credentials/change_private_key_for_creds_responses.go b/client/credentials/change_private_key_for_creds_responses.go deleted file mode 100644 index 2bba09e..0000000 --- a/client/credentials/change_private_key_for_creds_responses.go +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ChangePrivateKeyForCredsReader is a Reader for the ChangePrivateKeyForCreds structure. -type ChangePrivateKeyForCredsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangePrivateKeyForCredsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewChangePrivateKeyForCredsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewChangePrivateKeyForCredsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewChangePrivateKeyForCredsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewChangePrivateKeyForCredsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewChangePrivateKeyForCredsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewChangePrivateKeyForCredsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewChangePrivateKeyForCredsOK creates a ChangePrivateKeyForCredsOK with default headers values -func NewChangePrivateKeyForCredsOK() *ChangePrivateKeyForCredsOK { - return &ChangePrivateKeyForCredsOK{} -} - -/* ChangePrivateKeyForCredsOK describes a response with status code 200, with default header values. - -Private key has been changed. -*/ -type ChangePrivateKeyForCredsOK struct { - Payload models.EmptySuccessResponse -} - -func (o *ChangePrivateKeyForCredsOK) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changeprivatekey][%d] changePrivateKeyForCredsOK %+v", 200, o.Payload) -} -func (o *ChangePrivateKeyForCredsOK) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *ChangePrivateKeyForCredsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePrivateKeyForCredsBadRequest creates a ChangePrivateKeyForCredsBadRequest with default headers values -func NewChangePrivateKeyForCredsBadRequest() *ChangePrivateKeyForCredsBadRequest { - return &ChangePrivateKeyForCredsBadRequest{} -} - -/* ChangePrivateKeyForCredsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ChangePrivateKeyForCredsBadRequest struct { - Payload *models.Error -} - -func (o *ChangePrivateKeyForCredsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changeprivatekey][%d] changePrivateKeyForCredsBadRequest %+v", 400, o.Payload) -} -func (o *ChangePrivateKeyForCredsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePrivateKeyForCredsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePrivateKeyForCredsUnauthorized creates a ChangePrivateKeyForCredsUnauthorized with default headers values -func NewChangePrivateKeyForCredsUnauthorized() *ChangePrivateKeyForCredsUnauthorized { - return &ChangePrivateKeyForCredsUnauthorized{} -} - -/* ChangePrivateKeyForCredsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ChangePrivateKeyForCredsUnauthorized struct { - Payload *models.Error -} - -func (o *ChangePrivateKeyForCredsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changeprivatekey][%d] changePrivateKeyForCredsUnauthorized %+v", 401, o.Payload) -} -func (o *ChangePrivateKeyForCredsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePrivateKeyForCredsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePrivateKeyForCredsForbidden creates a ChangePrivateKeyForCredsForbidden with default headers values -func NewChangePrivateKeyForCredsForbidden() *ChangePrivateKeyForCredsForbidden { - return &ChangePrivateKeyForCredsForbidden{} -} - -/* ChangePrivateKeyForCredsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ChangePrivateKeyForCredsForbidden struct { - Payload *models.Error -} - -func (o *ChangePrivateKeyForCredsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changeprivatekey][%d] changePrivateKeyForCredsForbidden %+v", 403, o.Payload) -} -func (o *ChangePrivateKeyForCredsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePrivateKeyForCredsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePrivateKeyForCredsNotFound creates a ChangePrivateKeyForCredsNotFound with default headers values -func NewChangePrivateKeyForCredsNotFound() *ChangePrivateKeyForCredsNotFound { - return &ChangePrivateKeyForCredsNotFound{} -} - -/* ChangePrivateKeyForCredsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type ChangePrivateKeyForCredsNotFound struct { - Payload *models.Error -} - -func (o *ChangePrivateKeyForCredsNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changeprivatekey][%d] changePrivateKeyForCredsNotFound %+v", 404, o.Payload) -} -func (o *ChangePrivateKeyForCredsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePrivateKeyForCredsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangePrivateKeyForCredsInternalServerError creates a ChangePrivateKeyForCredsInternalServerError with default headers values -func NewChangePrivateKeyForCredsInternalServerError() *ChangePrivateKeyForCredsInternalServerError { - return &ChangePrivateKeyForCredsInternalServerError{} -} - -/* ChangePrivateKeyForCredsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ChangePrivateKeyForCredsInternalServerError struct { - Payload *models.Error -} - -func (o *ChangePrivateKeyForCredsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changeprivatekey][%d] changePrivateKeyForCredsInternalServerError %+v", 500, o.Payload) -} -func (o *ChangePrivateKeyForCredsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangePrivateKeyForCredsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/credentials/change_root_password_for_creds_parameters.go b/client/credentials/change_root_password_for_creds_parameters.go deleted file mode 100644 index feeb2fc..0000000 --- a/client/credentials/change_root_password_for_creds_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewChangeRootPasswordForCredsParams creates a new ChangeRootPasswordForCredsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewChangeRootPasswordForCredsParams() *ChangeRootPasswordForCredsParams { - return &ChangeRootPasswordForCredsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangeRootPasswordForCredsParamsWithTimeout creates a new ChangeRootPasswordForCredsParams object -// with the ability to set a timeout on a request. -func NewChangeRootPasswordForCredsParamsWithTimeout(timeout time.Duration) *ChangeRootPasswordForCredsParams { - return &ChangeRootPasswordForCredsParams{ - timeout: timeout, - } -} - -// NewChangeRootPasswordForCredsParamsWithContext creates a new ChangeRootPasswordForCredsParams object -// with the ability to set a context for a request. -func NewChangeRootPasswordForCredsParamsWithContext(ctx context.Context) *ChangeRootPasswordForCredsParams { - return &ChangeRootPasswordForCredsParams{ - Context: ctx, - } -} - -// NewChangeRootPasswordForCredsParamsWithHTTPClient creates a new ChangeRootPasswordForCredsParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangeRootPasswordForCredsParamsWithHTTPClient(client *http.Client) *ChangeRootPasswordForCredsParams { - return &ChangeRootPasswordForCredsParams{ - HTTPClient: client, - } -} - -/* ChangeRootPasswordForCredsParams contains all the parameters to send to the API endpoint - for the change root password for creds operation. - - Typically these are written to a http.Request. -*/ -type ChangeRootPasswordForCredsParams struct { - - // Body. - Body *models.CredentialsPasswordChangeSpec - - /* ID. - - ID of the credentials record. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the change root password for creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeRootPasswordForCredsParams) WithDefaults() *ChangeRootPasswordForCredsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the change root password for creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ChangeRootPasswordForCredsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := ChangeRootPasswordForCredsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) WithTimeout(timeout time.Duration) *ChangeRootPasswordForCredsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) WithContext(ctx context.Context) *ChangeRootPasswordForCredsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) WithHTTPClient(client *http.Client) *ChangeRootPasswordForCredsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) WithBody(body *models.CredentialsPasswordChangeSpec) *ChangeRootPasswordForCredsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) SetBody(body *models.CredentialsPasswordChangeSpec) { - o.Body = body -} - -// WithID adds the id to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) WithID(id strfmt.UUID) *ChangeRootPasswordForCredsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) WithXAPIVersion(xAPIVersion string) *ChangeRootPasswordForCredsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the change root password for creds params -func (o *ChangeRootPasswordForCredsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangeRootPasswordForCredsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/credentials/change_root_password_for_creds_responses.go b/client/credentials/change_root_password_for_creds_responses.go deleted file mode 100644 index b3f1c35..0000000 --- a/client/credentials/change_root_password_for_creds_responses.go +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// ChangeRootPasswordForCredsReader is a Reader for the ChangeRootPasswordForCreds structure. -type ChangeRootPasswordForCredsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangeRootPasswordForCredsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewChangeRootPasswordForCredsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewChangeRootPasswordForCredsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewChangeRootPasswordForCredsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewChangeRootPasswordForCredsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewChangeRootPasswordForCredsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewChangeRootPasswordForCredsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewChangeRootPasswordForCredsOK creates a ChangeRootPasswordForCredsOK with default headers values -func NewChangeRootPasswordForCredsOK() *ChangeRootPasswordForCredsOK { - return &ChangeRootPasswordForCredsOK{} -} - -/* ChangeRootPasswordForCredsOK describes a response with status code 200, with default header values. - -Root password has been changed. -*/ -type ChangeRootPasswordForCredsOK struct { - Payload models.EmptySuccessResponse -} - -func (o *ChangeRootPasswordForCredsOK) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changerootpassword][%d] changeRootPasswordForCredsOK %+v", 200, o.Payload) -} -func (o *ChangeRootPasswordForCredsOK) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *ChangeRootPasswordForCredsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangeRootPasswordForCredsBadRequest creates a ChangeRootPasswordForCredsBadRequest with default headers values -func NewChangeRootPasswordForCredsBadRequest() *ChangeRootPasswordForCredsBadRequest { - return &ChangeRootPasswordForCredsBadRequest{} -} - -/* ChangeRootPasswordForCredsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type ChangeRootPasswordForCredsBadRequest struct { - Payload *models.Error -} - -func (o *ChangeRootPasswordForCredsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changerootpassword][%d] changeRootPasswordForCredsBadRequest %+v", 400, o.Payload) -} -func (o *ChangeRootPasswordForCredsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangeRootPasswordForCredsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangeRootPasswordForCredsUnauthorized creates a ChangeRootPasswordForCredsUnauthorized with default headers values -func NewChangeRootPasswordForCredsUnauthorized() *ChangeRootPasswordForCredsUnauthorized { - return &ChangeRootPasswordForCredsUnauthorized{} -} - -/* ChangeRootPasswordForCredsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type ChangeRootPasswordForCredsUnauthorized struct { - Payload *models.Error -} - -func (o *ChangeRootPasswordForCredsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changerootpassword][%d] changeRootPasswordForCredsUnauthorized %+v", 401, o.Payload) -} -func (o *ChangeRootPasswordForCredsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangeRootPasswordForCredsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangeRootPasswordForCredsForbidden creates a ChangeRootPasswordForCredsForbidden with default headers values -func NewChangeRootPasswordForCredsForbidden() *ChangeRootPasswordForCredsForbidden { - return &ChangeRootPasswordForCredsForbidden{} -} - -/* ChangeRootPasswordForCredsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type ChangeRootPasswordForCredsForbidden struct { - Payload *models.Error -} - -func (o *ChangeRootPasswordForCredsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changerootpassword][%d] changeRootPasswordForCredsForbidden %+v", 403, o.Payload) -} -func (o *ChangeRootPasswordForCredsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangeRootPasswordForCredsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangeRootPasswordForCredsNotFound creates a ChangeRootPasswordForCredsNotFound with default headers values -func NewChangeRootPasswordForCredsNotFound() *ChangeRootPasswordForCredsNotFound { - return &ChangeRootPasswordForCredsNotFound{} -} - -/* ChangeRootPasswordForCredsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type ChangeRootPasswordForCredsNotFound struct { - Payload *models.Error -} - -func (o *ChangeRootPasswordForCredsNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changerootpassword][%d] changeRootPasswordForCredsNotFound %+v", 404, o.Payload) -} -func (o *ChangeRootPasswordForCredsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangeRootPasswordForCredsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewChangeRootPasswordForCredsInternalServerError creates a ChangeRootPasswordForCredsInternalServerError with default headers values -func NewChangeRootPasswordForCredsInternalServerError() *ChangeRootPasswordForCredsInternalServerError { - return &ChangeRootPasswordForCredsInternalServerError{} -} - -/* ChangeRootPasswordForCredsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type ChangeRootPasswordForCredsInternalServerError struct { - Payload *models.Error -} - -func (o *ChangeRootPasswordForCredsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials/{id}/changerootpassword][%d] changeRootPasswordForCredsInternalServerError %+v", 500, o.Payload) -} -func (o *ChangeRootPasswordForCredsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ChangeRootPasswordForCredsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/credentials/create_creds_parameters.go b/client/credentials/create_creds_parameters.go deleted file mode 100644 index 3f65e17..0000000 --- a/client/credentials/create_creds_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewCreateCredsParams creates a new CreateCredsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateCredsParams() *CreateCredsParams { - return &CreateCredsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateCredsParamsWithTimeout creates a new CreateCredsParams object -// with the ability to set a timeout on a request. -func NewCreateCredsParamsWithTimeout(timeout time.Duration) *CreateCredsParams { - return &CreateCredsParams{ - timeout: timeout, - } -} - -// NewCreateCredsParamsWithContext creates a new CreateCredsParams object -// with the ability to set a context for a request. -func NewCreateCredsParamsWithContext(ctx context.Context) *CreateCredsParams { - return &CreateCredsParams{ - Context: ctx, - } -} - -// NewCreateCredsParamsWithHTTPClient creates a new CreateCredsParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateCredsParamsWithHTTPClient(client *http.Client) *CreateCredsParams { - return &CreateCredsParams{ - HTTPClient: client, - } -} - -/* CreateCredsParams contains all the parameters to send to the API endpoint - for the create creds operation. - - Typically these are written to a http.Request. -*/ -type CreateCredsParams struct { - - // Body. - Body *models.CredentialsSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateCredsParams) WithDefaults() *CreateCredsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateCredsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := CreateCredsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create creds params -func (o *CreateCredsParams) WithTimeout(timeout time.Duration) *CreateCredsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create creds params -func (o *CreateCredsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create creds params -func (o *CreateCredsParams) WithContext(ctx context.Context) *CreateCredsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create creds params -func (o *CreateCredsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create creds params -func (o *CreateCredsParams) WithHTTPClient(client *http.Client) *CreateCredsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create creds params -func (o *CreateCredsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create creds params -func (o *CreateCredsParams) WithBody(body *models.CredentialsSpec) *CreateCredsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create creds params -func (o *CreateCredsParams) SetBody(body *models.CredentialsSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the create creds params -func (o *CreateCredsParams) WithXAPIVersion(xAPIVersion string) *CreateCredsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the create creds params -func (o *CreateCredsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateCredsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/credentials/create_creds_responses.go b/client/credentials/create_creds_responses.go deleted file mode 100644 index 6034517..0000000 --- a/client/credentials/create_creds_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// CreateCredsReader is a Reader for the CreateCreds structure. -type CreateCredsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateCredsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateCredsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateCredsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateCredsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateCredsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateCredsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateCredsOK creates a CreateCredsOK with default headers values -func NewCreateCredsOK() *CreateCredsOK { - return &CreateCredsOK{} -} - -/* CreateCredsOK describes a response with status code 200, with default header values. - -Account has been added. -*/ -type CreateCredsOK struct { - Payload *models.CredentialsModel -} - -func (o *CreateCredsOK) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials][%d] createCredsOK %+v", 200, o.Payload) -} -func (o *CreateCredsOK) GetPayload() *models.CredentialsModel { - return o.Payload -} - -func (o *CreateCredsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CredentialsModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCredsBadRequest creates a CreateCredsBadRequest with default headers values -func NewCreateCredsBadRequest() *CreateCredsBadRequest { - return &CreateCredsBadRequest{} -} - -/* CreateCredsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type CreateCredsBadRequest struct { - Payload *models.Error -} - -func (o *CreateCredsBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials][%d] createCredsBadRequest %+v", 400, o.Payload) -} -func (o *CreateCredsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateCredsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCredsUnauthorized creates a CreateCredsUnauthorized with default headers values -func NewCreateCredsUnauthorized() *CreateCredsUnauthorized { - return &CreateCredsUnauthorized{} -} - -/* CreateCredsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type CreateCredsUnauthorized struct { - Payload *models.Error -} - -func (o *CreateCredsUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials][%d] createCredsUnauthorized %+v", 401, o.Payload) -} -func (o *CreateCredsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateCredsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCredsForbidden creates a CreateCredsForbidden with default headers values -func NewCreateCredsForbidden() *CreateCredsForbidden { - return &CreateCredsForbidden{} -} - -/* CreateCredsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type CreateCredsForbidden struct { - Payload *models.Error -} - -func (o *CreateCredsForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials][%d] createCredsForbidden %+v", 403, o.Payload) -} -func (o *CreateCredsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateCredsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCredsInternalServerError creates a CreateCredsInternalServerError with default headers values -func NewCreateCredsInternalServerError() *CreateCredsInternalServerError { - return &CreateCredsInternalServerError{} -} - -/* CreateCredsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type CreateCredsInternalServerError struct { - Payload *models.Error -} - -func (o *CreateCredsInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/credentials][%d] createCredsInternalServerError %+v", 500, o.Payload) -} -func (o *CreateCredsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateCredsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/credentials/credentials_client.go b/client/credentials/credentials_client.go deleted file mode 100644 index 77d3158..0000000 --- a/client/credentials/credentials_client.go +++ /dev/null @@ -1,383 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new credentials API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for credentials API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ChangePasswordForCreds(params *ChangePasswordForCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangePasswordForCredsOK, error) - - ChangePrivateKeyForCreds(params *ChangePrivateKeyForCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangePrivateKeyForCredsOK, error) - - ChangeRootPasswordForCreds(params *ChangeRootPasswordForCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeRootPasswordForCredsOK, error) - - CreateCreds(params *CreateCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCredsOK, error) - - DeleteCreds(params *DeleteCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCredsNoContent, error) - - GetAllCreds(params *GetAllCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllCredsOK, error) - - GetCreds(params *GetCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCredsOK, error) - - UpdateCreds(params *UpdateCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCredsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - ChangePasswordForCreds changes password - - The HTTP POST request to the `/api/v1/credentials/{id}/changepassword` path allows you to change a password of the credentials record that has the specified `id`. -*/ -func (a *Client) ChangePasswordForCreds(params *ChangePasswordForCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangePasswordForCredsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewChangePasswordForCredsParams() - } - op := &runtime.ClientOperation{ - ID: "ChangePasswordForCreds", - Method: "POST", - PathPattern: "/api/v1/credentials/{id}/changepassword", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ChangePasswordForCredsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ChangePasswordForCredsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ChangePasswordForCreds: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ChangePrivateKeyForCreds changes linux private key - - The HTTP POST request to the `/api/v1/credentials/{id}/changeprivatekey` path allows you to change a Linux private key of the credentials record that has the specified `id`. -*/ -func (a *Client) ChangePrivateKeyForCreds(params *ChangePrivateKeyForCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangePrivateKeyForCredsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewChangePrivateKeyForCredsParams() - } - op := &runtime.ClientOperation{ - ID: "ChangePrivateKeyForCreds", - Method: "POST", - PathPattern: "/api/v1/credentials/{id}/changeprivatekey", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ChangePrivateKeyForCredsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ChangePrivateKeyForCredsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ChangePrivateKeyForCreds: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ChangeRootPasswordForCreds changes linux root password - - The HTTP POST request to the `/api/v1/credentials/{id}/changerootpassword` path allows you to change a Linux root password of the credentials record that has the specified `id`. -*/ -func (a *Client) ChangeRootPasswordForCreds(params *ChangeRootPasswordForCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangeRootPasswordForCredsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewChangeRootPasswordForCredsParams() - } - op := &runtime.ClientOperation{ - ID: "ChangeRootPasswordForCreds", - Method: "POST", - PathPattern: "/api/v1/credentials/{id}/changerootpassword", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ChangeRootPasswordForCredsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ChangeRootPasswordForCredsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ChangeRootPasswordForCreds: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateCreds adds credentials record - - The HTTP POST request to the `/api/v1/credentials` path allows you to add a credentials record. -*/ -func (a *Client) CreateCreds(params *CreateCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCredsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateCredsParams() - } - op := &runtime.ClientOperation{ - ID: "CreateCreds", - Method: "POST", - PathPattern: "/api/v1/credentials", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateCredsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateCredsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateCreds: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteCreds removes credentials record - - The HTTP DELETE request to the `/api/v1/credentials/{id}` path allows you to remove a credentials record that has the specified `id`. -*/ -func (a *Client) DeleteCreds(params *DeleteCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCredsNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteCredsParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteCreds", - Method: "DELETE", - PathPattern: "/api/v1/credentials/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteCredsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteCredsNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteCreds: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllCreds gets all credentials - - The HTTP GET request to the `/api/v1/credentials` path allows you to get an array of credentials records that are added to the backup server. -*/ -func (a *Client) GetAllCreds(params *GetAllCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllCredsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllCredsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllCreds", - Method: "GET", - PathPattern: "/api/v1/credentials", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllCredsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllCredsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllCreds: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetCreds gets credentials record - - The HTTP GET request to the `/api/v1/credentials/{id}` path allows you to get a credentials record that has the specified `id`. -*/ -func (a *Client) GetCreds(params *GetCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCredsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetCredsParams() - } - op := &runtime.ClientOperation{ - ID: "GetCreds", - Method: "GET", - PathPattern: "/api/v1/credentials/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetCredsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetCredsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetCreds: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateCreds edits credentials record - - The HTTP PUT request to the `/api/v1/credentials/{id}` path allows you to edit a credentials record that has the specified `id`. -*/ -func (a *Client) UpdateCreds(params *UpdateCredsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCredsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateCredsParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateCreds", - Method: "PUT", - PathPattern: "/api/v1/credentials/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateCredsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateCredsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateCreds: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/credentials/delete_creds_parameters.go b/client/credentials/delete_creds_parameters.go deleted file mode 100644 index 3d3de4e..0000000 --- a/client/credentials/delete_creds_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteCredsParams creates a new DeleteCredsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteCredsParams() *DeleteCredsParams { - return &DeleteCredsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteCredsParamsWithTimeout creates a new DeleteCredsParams object -// with the ability to set a timeout on a request. -func NewDeleteCredsParamsWithTimeout(timeout time.Duration) *DeleteCredsParams { - return &DeleteCredsParams{ - timeout: timeout, - } -} - -// NewDeleteCredsParamsWithContext creates a new DeleteCredsParams object -// with the ability to set a context for a request. -func NewDeleteCredsParamsWithContext(ctx context.Context) *DeleteCredsParams { - return &DeleteCredsParams{ - Context: ctx, - } -} - -// NewDeleteCredsParamsWithHTTPClient creates a new DeleteCredsParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteCredsParamsWithHTTPClient(client *http.Client) *DeleteCredsParams { - return &DeleteCredsParams{ - HTTPClient: client, - } -} - -/* DeleteCredsParams contains all the parameters to send to the API endpoint - for the delete creds operation. - - Typically these are written to a http.Request. -*/ -type DeleteCredsParams struct { - - /* ID. - - ID of the credentials record. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCredsParams) WithDefaults() *DeleteCredsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCredsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := DeleteCredsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the delete creds params -func (o *DeleteCredsParams) WithTimeout(timeout time.Duration) *DeleteCredsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete creds params -func (o *DeleteCredsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete creds params -func (o *DeleteCredsParams) WithContext(ctx context.Context) *DeleteCredsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete creds params -func (o *DeleteCredsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete creds params -func (o *DeleteCredsParams) WithHTTPClient(client *http.Client) *DeleteCredsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete creds params -func (o *DeleteCredsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete creds params -func (o *DeleteCredsParams) WithID(id strfmt.UUID) *DeleteCredsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete creds params -func (o *DeleteCredsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the delete creds params -func (o *DeleteCredsParams) WithXAPIVersion(xAPIVersion string) *DeleteCredsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the delete creds params -func (o *DeleteCredsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteCredsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/credentials/delete_creds_responses.go b/client/credentials/delete_creds_responses.go deleted file mode 100644 index 1837a7e..0000000 --- a/client/credentials/delete_creds_responses.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// DeleteCredsReader is a Reader for the DeleteCreds structure. -type DeleteCredsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteCredsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteCredsNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteCredsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteCredsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteCredsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteCredsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteCredsNoContent creates a DeleteCredsNoContent with default headers values -func NewDeleteCredsNoContent() *DeleteCredsNoContent { - return &DeleteCredsNoContent{} -} - -/* DeleteCredsNoContent describes a response with status code 204, with default header values. - -Credentials record has been removed. -*/ -type DeleteCredsNoContent struct { - Payload models.EmptySuccessResponse -} - -func (o *DeleteCredsNoContent) Error() string { - return fmt.Sprintf("[DELETE /api/v1/credentials/{id}][%d] deleteCredsNoContent %+v", 204, o.Payload) -} -func (o *DeleteCredsNoContent) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *DeleteCredsNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCredsUnauthorized creates a DeleteCredsUnauthorized with default headers values -func NewDeleteCredsUnauthorized() *DeleteCredsUnauthorized { - return &DeleteCredsUnauthorized{} -} - -/* DeleteCredsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type DeleteCredsUnauthorized struct { - Payload *models.Error -} - -func (o *DeleteCredsUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /api/v1/credentials/{id}][%d] deleteCredsUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteCredsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteCredsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCredsForbidden creates a DeleteCredsForbidden with default headers values -func NewDeleteCredsForbidden() *DeleteCredsForbidden { - return &DeleteCredsForbidden{} -} - -/* DeleteCredsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type DeleteCredsForbidden struct { - Payload *models.Error -} - -func (o *DeleteCredsForbidden) Error() string { - return fmt.Sprintf("[DELETE /api/v1/credentials/{id}][%d] deleteCredsForbidden %+v", 403, o.Payload) -} -func (o *DeleteCredsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteCredsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCredsNotFound creates a DeleteCredsNotFound with default headers values -func NewDeleteCredsNotFound() *DeleteCredsNotFound { - return &DeleteCredsNotFound{} -} - -/* DeleteCredsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type DeleteCredsNotFound struct { - Payload *models.Error -} - -func (o *DeleteCredsNotFound) Error() string { - return fmt.Sprintf("[DELETE /api/v1/credentials/{id}][%d] deleteCredsNotFound %+v", 404, o.Payload) -} -func (o *DeleteCredsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteCredsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCredsInternalServerError creates a DeleteCredsInternalServerError with default headers values -func NewDeleteCredsInternalServerError() *DeleteCredsInternalServerError { - return &DeleteCredsInternalServerError{} -} - -/* DeleteCredsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type DeleteCredsInternalServerError struct { - Payload *models.Error -} - -func (o *DeleteCredsInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /api/v1/credentials/{id}][%d] deleteCredsInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteCredsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteCredsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/credentials/get_all_creds_parameters.go b/client/credentials/get_all_creds_parameters.go deleted file mode 100644 index c0b1d26..0000000 --- a/client/credentials/get_all_creds_parameters.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllCredsParams creates a new GetAllCredsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllCredsParams() *GetAllCredsParams { - return &GetAllCredsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllCredsParamsWithTimeout creates a new GetAllCredsParams object -// with the ability to set a timeout on a request. -func NewGetAllCredsParamsWithTimeout(timeout time.Duration) *GetAllCredsParams { - return &GetAllCredsParams{ - timeout: timeout, - } -} - -// NewGetAllCredsParamsWithContext creates a new GetAllCredsParams object -// with the ability to set a context for a request. -func NewGetAllCredsParamsWithContext(ctx context.Context) *GetAllCredsParams { - return &GetAllCredsParams{ - Context: ctx, - } -} - -// NewGetAllCredsParamsWithHTTPClient creates a new GetAllCredsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllCredsParamsWithHTTPClient(client *http.Client) *GetAllCredsParams { - return &GetAllCredsParams{ - HTTPClient: client, - } -} - -/* GetAllCredsParams contains all the parameters to send to the API endpoint - for the get all creds operation. - - Typically these are written to a http.Request. -*/ -type GetAllCredsParams struct { - - /* Limit. - - Maximum number of credentials records to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters credentials by the `nameFilter` pattern. The pattern can match any credentials parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts credentials in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts credentials by one of the credentials parameters. - */ - OrderColumn *string - - /* Skip. - - Number of credentials records to skip. - - Format: int32 - */ - Skip *int32 - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllCredsParams) WithDefaults() *GetAllCredsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllCredsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllCredsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all creds params -func (o *GetAllCredsParams) WithTimeout(timeout time.Duration) *GetAllCredsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all creds params -func (o *GetAllCredsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all creds params -func (o *GetAllCredsParams) WithContext(ctx context.Context) *GetAllCredsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all creds params -func (o *GetAllCredsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all creds params -func (o *GetAllCredsParams) WithHTTPClient(client *http.Client) *GetAllCredsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all creds params -func (o *GetAllCredsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get all creds params -func (o *GetAllCredsParams) WithLimit(limit *int32) *GetAllCredsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all creds params -func (o *GetAllCredsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all creds params -func (o *GetAllCredsParams) WithNameFilter(nameFilter *string) *GetAllCredsParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all creds params -func (o *GetAllCredsParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all creds params -func (o *GetAllCredsParams) WithOrderAsc(orderAsc *bool) *GetAllCredsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all creds params -func (o *GetAllCredsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all creds params -func (o *GetAllCredsParams) WithOrderColumn(orderColumn *string) *GetAllCredsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all creds params -func (o *GetAllCredsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all creds params -func (o *GetAllCredsParams) WithSkip(skip *int32) *GetAllCredsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all creds params -func (o *GetAllCredsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithXAPIVersion adds the xAPIVersion to the get all creds params -func (o *GetAllCredsParams) WithXAPIVersion(xAPIVersion string) *GetAllCredsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all creds params -func (o *GetAllCredsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllCredsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/credentials/get_all_creds_responses.go b/client/credentials/get_all_creds_responses.go deleted file mode 100644 index 1c23552..0000000 --- a/client/credentials/get_all_creds_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllCredsReader is a Reader for the GetAllCreds structure. -type GetAllCredsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllCredsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllCredsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllCredsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllCredsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllCredsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllCredsOK creates a GetAllCredsOK with default headers values -func NewGetAllCredsOK() *GetAllCredsOK { - return &GetAllCredsOK{} -} - -/* GetAllCredsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllCredsOK struct { - Payload *models.CredentialsResult -} - -func (o *GetAllCredsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials][%d] getAllCredsOK %+v", 200, o.Payload) -} -func (o *GetAllCredsOK) GetPayload() *models.CredentialsResult { - return o.Payload -} - -func (o *GetAllCredsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CredentialsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllCredsUnauthorized creates a GetAllCredsUnauthorized with default headers values -func NewGetAllCredsUnauthorized() *GetAllCredsUnauthorized { - return &GetAllCredsUnauthorized{} -} - -/* GetAllCredsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllCredsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllCredsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials][%d] getAllCredsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllCredsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllCredsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllCredsForbidden creates a GetAllCredsForbidden with default headers values -func NewGetAllCredsForbidden() *GetAllCredsForbidden { - return &GetAllCredsForbidden{} -} - -/* GetAllCredsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllCredsForbidden struct { - Payload *models.Error -} - -func (o *GetAllCredsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials][%d] getAllCredsForbidden %+v", 403, o.Payload) -} -func (o *GetAllCredsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllCredsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllCredsInternalServerError creates a GetAllCredsInternalServerError with default headers values -func NewGetAllCredsInternalServerError() *GetAllCredsInternalServerError { - return &GetAllCredsInternalServerError{} -} - -/* GetAllCredsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllCredsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllCredsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials][%d] getAllCredsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllCredsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllCredsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/credentials/get_creds_parameters.go b/client/credentials/get_creds_parameters.go deleted file mode 100644 index d9398cc..0000000 --- a/client/credentials/get_creds_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetCredsParams creates a new GetCredsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetCredsParams() *GetCredsParams { - return &GetCredsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetCredsParamsWithTimeout creates a new GetCredsParams object -// with the ability to set a timeout on a request. -func NewGetCredsParamsWithTimeout(timeout time.Duration) *GetCredsParams { - return &GetCredsParams{ - timeout: timeout, - } -} - -// NewGetCredsParamsWithContext creates a new GetCredsParams object -// with the ability to set a context for a request. -func NewGetCredsParamsWithContext(ctx context.Context) *GetCredsParams { - return &GetCredsParams{ - Context: ctx, - } -} - -// NewGetCredsParamsWithHTTPClient creates a new GetCredsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetCredsParamsWithHTTPClient(client *http.Client) *GetCredsParams { - return &GetCredsParams{ - HTTPClient: client, - } -} - -/* GetCredsParams contains all the parameters to send to the API endpoint - for the get creds operation. - - Typically these are written to a http.Request. -*/ -type GetCredsParams struct { - - /* ID. - - ID of the credentials record. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCredsParams) WithDefaults() *GetCredsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCredsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetCredsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get creds params -func (o *GetCredsParams) WithTimeout(timeout time.Duration) *GetCredsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get creds params -func (o *GetCredsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get creds params -func (o *GetCredsParams) WithContext(ctx context.Context) *GetCredsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get creds params -func (o *GetCredsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get creds params -func (o *GetCredsParams) WithHTTPClient(client *http.Client) *GetCredsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get creds params -func (o *GetCredsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get creds params -func (o *GetCredsParams) WithID(id strfmt.UUID) *GetCredsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get creds params -func (o *GetCredsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get creds params -func (o *GetCredsParams) WithXAPIVersion(xAPIVersion string) *GetCredsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get creds params -func (o *GetCredsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetCredsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/credentials/get_creds_responses.go b/client/credentials/get_creds_responses.go deleted file mode 100644 index bb707be..0000000 --- a/client/credentials/get_creds_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetCredsReader is a Reader for the GetCreds structure. -type GetCredsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetCredsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetCredsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetCredsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetCredsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetCredsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetCredsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetCredsOK creates a GetCredsOK with default headers values -func NewGetCredsOK() *GetCredsOK { - return &GetCredsOK{} -} - -/* GetCredsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetCredsOK struct { - Payload *models.CredentialsModel -} - -func (o *GetCredsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials/{id}][%d] getCredsOK %+v", 200, o.Payload) -} -func (o *GetCredsOK) GetPayload() *models.CredentialsModel { - return o.Payload -} - -func (o *GetCredsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CredentialsModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCredsUnauthorized creates a GetCredsUnauthorized with default headers values -func NewGetCredsUnauthorized() *GetCredsUnauthorized { - return &GetCredsUnauthorized{} -} - -/* GetCredsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetCredsUnauthorized struct { - Payload *models.Error -} - -func (o *GetCredsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials/{id}][%d] getCredsUnauthorized %+v", 401, o.Payload) -} -func (o *GetCredsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetCredsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCredsForbidden creates a GetCredsForbidden with default headers values -func NewGetCredsForbidden() *GetCredsForbidden { - return &GetCredsForbidden{} -} - -/* GetCredsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetCredsForbidden struct { - Payload *models.Error -} - -func (o *GetCredsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials/{id}][%d] getCredsForbidden %+v", 403, o.Payload) -} -func (o *GetCredsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetCredsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCredsNotFound creates a GetCredsNotFound with default headers values -func NewGetCredsNotFound() *GetCredsNotFound { - return &GetCredsNotFound{} -} - -/* GetCredsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetCredsNotFound struct { - Payload *models.Error -} - -func (o *GetCredsNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials/{id}][%d] getCredsNotFound %+v", 404, o.Payload) -} -func (o *GetCredsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetCredsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCredsInternalServerError creates a GetCredsInternalServerError with default headers values -func NewGetCredsInternalServerError() *GetCredsInternalServerError { - return &GetCredsInternalServerError{} -} - -/* GetCredsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetCredsInternalServerError struct { - Payload *models.Error -} - -func (o *GetCredsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/credentials/{id}][%d] getCredsInternalServerError %+v", 500, o.Payload) -} -func (o *GetCredsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetCredsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/credentials/update_creds_parameters.go b/client/credentials/update_creds_parameters.go deleted file mode 100644 index d756d76..0000000 --- a/client/credentials/update_creds_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateCredsParams creates a new UpdateCredsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateCredsParams() *UpdateCredsParams { - return &UpdateCredsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateCredsParamsWithTimeout creates a new UpdateCredsParams object -// with the ability to set a timeout on a request. -func NewUpdateCredsParamsWithTimeout(timeout time.Duration) *UpdateCredsParams { - return &UpdateCredsParams{ - timeout: timeout, - } -} - -// NewUpdateCredsParamsWithContext creates a new UpdateCredsParams object -// with the ability to set a context for a request. -func NewUpdateCredsParamsWithContext(ctx context.Context) *UpdateCredsParams { - return &UpdateCredsParams{ - Context: ctx, - } -} - -// NewUpdateCredsParamsWithHTTPClient creates a new UpdateCredsParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateCredsParamsWithHTTPClient(client *http.Client) *UpdateCredsParams { - return &UpdateCredsParams{ - HTTPClient: client, - } -} - -/* UpdateCredsParams contains all the parameters to send to the API endpoint - for the update creds operation. - - Typically these are written to a http.Request. -*/ -type UpdateCredsParams struct { - - // Body. - Body *models.CredentialsModel - - /* ID. - - ID of the credentials record. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateCredsParams) WithDefaults() *UpdateCredsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update creds params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateCredsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateCredsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update creds params -func (o *UpdateCredsParams) WithTimeout(timeout time.Duration) *UpdateCredsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update creds params -func (o *UpdateCredsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update creds params -func (o *UpdateCredsParams) WithContext(ctx context.Context) *UpdateCredsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update creds params -func (o *UpdateCredsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update creds params -func (o *UpdateCredsParams) WithHTTPClient(client *http.Client) *UpdateCredsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update creds params -func (o *UpdateCredsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update creds params -func (o *UpdateCredsParams) WithBody(body *models.CredentialsModel) *UpdateCredsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update creds params -func (o *UpdateCredsParams) SetBody(body *models.CredentialsModel) { - o.Body = body -} - -// WithID adds the id to the update creds params -func (o *UpdateCredsParams) WithID(id strfmt.UUID) *UpdateCredsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update creds params -func (o *UpdateCredsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the update creds params -func (o *UpdateCredsParams) WithXAPIVersion(xAPIVersion string) *UpdateCredsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update creds params -func (o *UpdateCredsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateCredsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/credentials/update_creds_responses.go b/client/credentials/update_creds_responses.go deleted file mode 100644 index 7f31196..0000000 --- a/client/credentials/update_creds_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package credentials - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateCredsReader is a Reader for the UpdateCreds structure. -type UpdateCredsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateCredsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateCredsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateCredsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateCredsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateCredsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateCredsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateCredsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateCredsOK creates a UpdateCredsOK with default headers values -func NewUpdateCredsOK() *UpdateCredsOK { - return &UpdateCredsOK{} -} - -/* UpdateCredsOK describes a response with status code 200, with default header values. - -Credentials record has been updated. -*/ -type UpdateCredsOK struct { - Payload *models.CredentialsModel -} - -func (o *UpdateCredsOK) Error() string { - return fmt.Sprintf("[PUT /api/v1/credentials/{id}][%d] updateCredsOK %+v", 200, o.Payload) -} -func (o *UpdateCredsOK) GetPayload() *models.CredentialsModel { - return o.Payload -} - -func (o *UpdateCredsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CredentialsModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCredsBadRequest creates a UpdateCredsBadRequest with default headers values -func NewUpdateCredsBadRequest() *UpdateCredsBadRequest { - return &UpdateCredsBadRequest{} -} - -/* UpdateCredsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateCredsBadRequest struct { - Payload *models.Error -} - -func (o *UpdateCredsBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/credentials/{id}][%d] updateCredsBadRequest %+v", 400, o.Payload) -} -func (o *UpdateCredsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateCredsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCredsUnauthorized creates a UpdateCredsUnauthorized with default headers values -func NewUpdateCredsUnauthorized() *UpdateCredsUnauthorized { - return &UpdateCredsUnauthorized{} -} - -/* UpdateCredsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateCredsUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateCredsUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/credentials/{id}][%d] updateCredsUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateCredsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateCredsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCredsForbidden creates a UpdateCredsForbidden with default headers values -func NewUpdateCredsForbidden() *UpdateCredsForbidden { - return &UpdateCredsForbidden{} -} - -/* UpdateCredsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateCredsForbidden struct { - Payload *models.Error -} - -func (o *UpdateCredsForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/credentials/{id}][%d] updateCredsForbidden %+v", 403, o.Payload) -} -func (o *UpdateCredsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateCredsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCredsNotFound creates a UpdateCredsNotFound with default headers values -func NewUpdateCredsNotFound() *UpdateCredsNotFound { - return &UpdateCredsNotFound{} -} - -/* UpdateCredsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type UpdateCredsNotFound struct { - Payload *models.Error -} - -func (o *UpdateCredsNotFound) Error() string { - return fmt.Sprintf("[PUT /api/v1/credentials/{id}][%d] updateCredsNotFound %+v", 404, o.Payload) -} -func (o *UpdateCredsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateCredsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCredsInternalServerError creates a UpdateCredsInternalServerError with default headers values -func NewUpdateCredsInternalServerError() *UpdateCredsInternalServerError { - return &UpdateCredsInternalServerError{} -} - -/* UpdateCredsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateCredsInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateCredsInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/credentials/{id}][%d] updateCredsInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateCredsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateCredsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/encryption/create_encryption_password_parameters.go b/client/encryption/create_encryption_password_parameters.go deleted file mode 100644 index 6eb9214..0000000 --- a/client/encryption/create_encryption_password_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewCreateEncryptionPasswordParams creates a new CreateEncryptionPasswordParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateEncryptionPasswordParams() *CreateEncryptionPasswordParams { - return &CreateEncryptionPasswordParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateEncryptionPasswordParamsWithTimeout creates a new CreateEncryptionPasswordParams object -// with the ability to set a timeout on a request. -func NewCreateEncryptionPasswordParamsWithTimeout(timeout time.Duration) *CreateEncryptionPasswordParams { - return &CreateEncryptionPasswordParams{ - timeout: timeout, - } -} - -// NewCreateEncryptionPasswordParamsWithContext creates a new CreateEncryptionPasswordParams object -// with the ability to set a context for a request. -func NewCreateEncryptionPasswordParamsWithContext(ctx context.Context) *CreateEncryptionPasswordParams { - return &CreateEncryptionPasswordParams{ - Context: ctx, - } -} - -// NewCreateEncryptionPasswordParamsWithHTTPClient creates a new CreateEncryptionPasswordParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateEncryptionPasswordParamsWithHTTPClient(client *http.Client) *CreateEncryptionPasswordParams { - return &CreateEncryptionPasswordParams{ - HTTPClient: client, - } -} - -/* CreateEncryptionPasswordParams contains all the parameters to send to the API endpoint - for the create encryption password operation. - - Typically these are written to a http.Request. -*/ -type CreateEncryptionPasswordParams struct { - - // Body. - Body *models.EncryptionPasswordSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create encryption password params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateEncryptionPasswordParams) WithDefaults() *CreateEncryptionPasswordParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create encryption password params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateEncryptionPasswordParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := CreateEncryptionPasswordParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create encryption password params -func (o *CreateEncryptionPasswordParams) WithTimeout(timeout time.Duration) *CreateEncryptionPasswordParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create encryption password params -func (o *CreateEncryptionPasswordParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create encryption password params -func (o *CreateEncryptionPasswordParams) WithContext(ctx context.Context) *CreateEncryptionPasswordParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create encryption password params -func (o *CreateEncryptionPasswordParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create encryption password params -func (o *CreateEncryptionPasswordParams) WithHTTPClient(client *http.Client) *CreateEncryptionPasswordParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create encryption password params -func (o *CreateEncryptionPasswordParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create encryption password params -func (o *CreateEncryptionPasswordParams) WithBody(body *models.EncryptionPasswordSpec) *CreateEncryptionPasswordParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create encryption password params -func (o *CreateEncryptionPasswordParams) SetBody(body *models.EncryptionPasswordSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the create encryption password params -func (o *CreateEncryptionPasswordParams) WithXAPIVersion(xAPIVersion string) *CreateEncryptionPasswordParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the create encryption password params -func (o *CreateEncryptionPasswordParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateEncryptionPasswordParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/encryption/create_encryption_password_responses.go b/client/encryption/create_encryption_password_responses.go deleted file mode 100644 index aca2a1f..0000000 --- a/client/encryption/create_encryption_password_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// CreateEncryptionPasswordReader is a Reader for the CreateEncryptionPassword structure. -type CreateEncryptionPasswordReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateEncryptionPasswordReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateEncryptionPasswordCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateEncryptionPasswordBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateEncryptionPasswordUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateEncryptionPasswordForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateEncryptionPasswordInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateEncryptionPasswordCreated creates a CreateEncryptionPasswordCreated with default headers values -func NewCreateEncryptionPasswordCreated() *CreateEncryptionPasswordCreated { - return &CreateEncryptionPasswordCreated{} -} - -/* CreateEncryptionPasswordCreated describes a response with status code 201, with default header values. - -Password has been added. -*/ -type CreateEncryptionPasswordCreated struct { - Payload *models.EncryptionPasswordModel -} - -func (o *CreateEncryptionPasswordCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/encryptionPasswords][%d] createEncryptionPasswordCreated %+v", 201, o.Payload) -} -func (o *CreateEncryptionPasswordCreated) GetPayload() *models.EncryptionPasswordModel { - return o.Payload -} - -func (o *CreateEncryptionPasswordCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.EncryptionPasswordModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEncryptionPasswordBadRequest creates a CreateEncryptionPasswordBadRequest with default headers values -func NewCreateEncryptionPasswordBadRequest() *CreateEncryptionPasswordBadRequest { - return &CreateEncryptionPasswordBadRequest{} -} - -/* CreateEncryptionPasswordBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type CreateEncryptionPasswordBadRequest struct { - Payload *models.Error -} - -func (o *CreateEncryptionPasswordBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/encryptionPasswords][%d] createEncryptionPasswordBadRequest %+v", 400, o.Payload) -} -func (o *CreateEncryptionPasswordBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateEncryptionPasswordBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEncryptionPasswordUnauthorized creates a CreateEncryptionPasswordUnauthorized with default headers values -func NewCreateEncryptionPasswordUnauthorized() *CreateEncryptionPasswordUnauthorized { - return &CreateEncryptionPasswordUnauthorized{} -} - -/* CreateEncryptionPasswordUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type CreateEncryptionPasswordUnauthorized struct { - Payload *models.Error -} - -func (o *CreateEncryptionPasswordUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/encryptionPasswords][%d] createEncryptionPasswordUnauthorized %+v", 401, o.Payload) -} -func (o *CreateEncryptionPasswordUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateEncryptionPasswordUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEncryptionPasswordForbidden creates a CreateEncryptionPasswordForbidden with default headers values -func NewCreateEncryptionPasswordForbidden() *CreateEncryptionPasswordForbidden { - return &CreateEncryptionPasswordForbidden{} -} - -/* CreateEncryptionPasswordForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type CreateEncryptionPasswordForbidden struct { - Payload *models.Error -} - -func (o *CreateEncryptionPasswordForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/encryptionPasswords][%d] createEncryptionPasswordForbidden %+v", 403, o.Payload) -} -func (o *CreateEncryptionPasswordForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateEncryptionPasswordForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEncryptionPasswordInternalServerError creates a CreateEncryptionPasswordInternalServerError with default headers values -func NewCreateEncryptionPasswordInternalServerError() *CreateEncryptionPasswordInternalServerError { - return &CreateEncryptionPasswordInternalServerError{} -} - -/* CreateEncryptionPasswordInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type CreateEncryptionPasswordInternalServerError struct { - Payload *models.Error -} - -func (o *CreateEncryptionPasswordInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/encryptionPasswords][%d] createEncryptionPasswordInternalServerError %+v", 500, o.Payload) -} -func (o *CreateEncryptionPasswordInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateEncryptionPasswordInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/encryption/delete_encryption_password_parameters.go b/client/encryption/delete_encryption_password_parameters.go deleted file mode 100644 index 4441e71..0000000 --- a/client/encryption/delete_encryption_password_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteEncryptionPasswordParams creates a new DeleteEncryptionPasswordParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteEncryptionPasswordParams() *DeleteEncryptionPasswordParams { - return &DeleteEncryptionPasswordParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteEncryptionPasswordParamsWithTimeout creates a new DeleteEncryptionPasswordParams object -// with the ability to set a timeout on a request. -func NewDeleteEncryptionPasswordParamsWithTimeout(timeout time.Duration) *DeleteEncryptionPasswordParams { - return &DeleteEncryptionPasswordParams{ - timeout: timeout, - } -} - -// NewDeleteEncryptionPasswordParamsWithContext creates a new DeleteEncryptionPasswordParams object -// with the ability to set a context for a request. -func NewDeleteEncryptionPasswordParamsWithContext(ctx context.Context) *DeleteEncryptionPasswordParams { - return &DeleteEncryptionPasswordParams{ - Context: ctx, - } -} - -// NewDeleteEncryptionPasswordParamsWithHTTPClient creates a new DeleteEncryptionPasswordParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteEncryptionPasswordParamsWithHTTPClient(client *http.Client) *DeleteEncryptionPasswordParams { - return &DeleteEncryptionPasswordParams{ - HTTPClient: client, - } -} - -/* DeleteEncryptionPasswordParams contains all the parameters to send to the API endpoint - for the delete encryption password operation. - - Typically these are written to a http.Request. -*/ -type DeleteEncryptionPasswordParams struct { - - /* ID. - - ID of the encryption password. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete encryption password params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteEncryptionPasswordParams) WithDefaults() *DeleteEncryptionPasswordParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete encryption password params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteEncryptionPasswordParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := DeleteEncryptionPasswordParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) WithTimeout(timeout time.Duration) *DeleteEncryptionPasswordParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) WithContext(ctx context.Context) *DeleteEncryptionPasswordParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) WithHTTPClient(client *http.Client) *DeleteEncryptionPasswordParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) WithID(id strfmt.UUID) *DeleteEncryptionPasswordParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) WithXAPIVersion(xAPIVersion string) *DeleteEncryptionPasswordParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the delete encryption password params -func (o *DeleteEncryptionPasswordParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteEncryptionPasswordParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/encryption/delete_encryption_password_responses.go b/client/encryption/delete_encryption_password_responses.go deleted file mode 100644 index 3240994..0000000 --- a/client/encryption/delete_encryption_password_responses.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// DeleteEncryptionPasswordReader is a Reader for the DeleteEncryptionPassword structure. -type DeleteEncryptionPasswordReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteEncryptionPasswordReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteEncryptionPasswordNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteEncryptionPasswordUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteEncryptionPasswordForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteEncryptionPasswordNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteEncryptionPasswordInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteEncryptionPasswordNoContent creates a DeleteEncryptionPasswordNoContent with default headers values -func NewDeleteEncryptionPasswordNoContent() *DeleteEncryptionPasswordNoContent { - return &DeleteEncryptionPasswordNoContent{} -} - -/* DeleteEncryptionPasswordNoContent describes a response with status code 204, with default header values. - -Password has been removed. -*/ -type DeleteEncryptionPasswordNoContent struct { - Payload models.EmptySuccessResponse -} - -func (o *DeleteEncryptionPasswordNoContent) Error() string { - return fmt.Sprintf("[DELETE /api/v1/encryptionPasswords/{id}][%d] deleteEncryptionPasswordNoContent %+v", 204, o.Payload) -} -func (o *DeleteEncryptionPasswordNoContent) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *DeleteEncryptionPasswordNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEncryptionPasswordUnauthorized creates a DeleteEncryptionPasswordUnauthorized with default headers values -func NewDeleteEncryptionPasswordUnauthorized() *DeleteEncryptionPasswordUnauthorized { - return &DeleteEncryptionPasswordUnauthorized{} -} - -/* DeleteEncryptionPasswordUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type DeleteEncryptionPasswordUnauthorized struct { - Payload *models.Error -} - -func (o *DeleteEncryptionPasswordUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /api/v1/encryptionPasswords/{id}][%d] deleteEncryptionPasswordUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteEncryptionPasswordUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteEncryptionPasswordUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEncryptionPasswordForbidden creates a DeleteEncryptionPasswordForbidden with default headers values -func NewDeleteEncryptionPasswordForbidden() *DeleteEncryptionPasswordForbidden { - return &DeleteEncryptionPasswordForbidden{} -} - -/* DeleteEncryptionPasswordForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type DeleteEncryptionPasswordForbidden struct { - Payload *models.Error -} - -func (o *DeleteEncryptionPasswordForbidden) Error() string { - return fmt.Sprintf("[DELETE /api/v1/encryptionPasswords/{id}][%d] deleteEncryptionPasswordForbidden %+v", 403, o.Payload) -} -func (o *DeleteEncryptionPasswordForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteEncryptionPasswordForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEncryptionPasswordNotFound creates a DeleteEncryptionPasswordNotFound with default headers values -func NewDeleteEncryptionPasswordNotFound() *DeleteEncryptionPasswordNotFound { - return &DeleteEncryptionPasswordNotFound{} -} - -/* DeleteEncryptionPasswordNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type DeleteEncryptionPasswordNotFound struct { - Payload *models.Error -} - -func (o *DeleteEncryptionPasswordNotFound) Error() string { - return fmt.Sprintf("[DELETE /api/v1/encryptionPasswords/{id}][%d] deleteEncryptionPasswordNotFound %+v", 404, o.Payload) -} -func (o *DeleteEncryptionPasswordNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteEncryptionPasswordNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEncryptionPasswordInternalServerError creates a DeleteEncryptionPasswordInternalServerError with default headers values -func NewDeleteEncryptionPasswordInternalServerError() *DeleteEncryptionPasswordInternalServerError { - return &DeleteEncryptionPasswordInternalServerError{} -} - -/* DeleteEncryptionPasswordInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type DeleteEncryptionPasswordInternalServerError struct { - Payload *models.Error -} - -func (o *DeleteEncryptionPasswordInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /api/v1/encryptionPasswords/{id}][%d] deleteEncryptionPasswordInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteEncryptionPasswordInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteEncryptionPasswordInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/encryption/encryption_client.go b/client/encryption/encryption_client.go deleted file mode 100644 index 8a347ad..0000000 --- a/client/encryption/encryption_client.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new encryption API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for encryption API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateEncryptionPassword(params *CreateEncryptionPasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEncryptionPasswordCreated, error) - - DeleteEncryptionPassword(params *DeleteEncryptionPasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEncryptionPasswordNoContent, error) - - GetAllEncryptionPasswords(params *GetAllEncryptionPasswordsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllEncryptionPasswordsOK, error) - - GetEncryptionPassword(params *GetEncryptionPasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEncryptionPasswordOK, error) - - UpdateEncryptionPassword(params *UpdateEncryptionPasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEncryptionPasswordOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateEncryptionPassword adds encryption password - - The HTTP POST request to the `/api/v1/encryptionPasswords` path allows you to add an encryption password. -*/ -func (a *Client) CreateEncryptionPassword(params *CreateEncryptionPasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEncryptionPasswordCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateEncryptionPasswordParams() - } - op := &runtime.ClientOperation{ - ID: "CreateEncryptionPassword", - Method: "POST", - PathPattern: "/api/v1/encryptionPasswords", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateEncryptionPasswordReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateEncryptionPasswordCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateEncryptionPassword: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteEncryptionPassword removes encryption password - - The HTTP DELETE request to the `/api/v1/encryptionPasswords/{id}` path allows you to remove an encryption password that has the specified `id`. -*/ -func (a *Client) DeleteEncryptionPassword(params *DeleteEncryptionPasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEncryptionPasswordNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteEncryptionPasswordParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteEncryptionPassword", - Method: "DELETE", - PathPattern: "/api/v1/encryptionPasswords/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteEncryptionPasswordReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteEncryptionPasswordNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteEncryptionPassword: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllEncryptionPasswords gets all encryption passwords - - The HTTP GET request to the `/api/v1/encryptionPasswords` path allows you to get an array of all passwords that are used for data encryption. -*/ -func (a *Client) GetAllEncryptionPasswords(params *GetAllEncryptionPasswordsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllEncryptionPasswordsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllEncryptionPasswordsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllEncryptionPasswords", - Method: "GET", - PathPattern: "/api/v1/encryptionPasswords", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllEncryptionPasswordsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllEncryptionPasswordsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllEncryptionPasswords: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetEncryptionPassword gets encryption password - - The HTTP GET request to the `/api/v1/encryptionPasswords/{id}` path allows you to get an encryption password that has the specified `id`. -*/ -func (a *Client) GetEncryptionPassword(params *GetEncryptionPasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEncryptionPasswordOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetEncryptionPasswordParams() - } - op := &runtime.ClientOperation{ - ID: "GetEncryptionPassword", - Method: "GET", - PathPattern: "/api/v1/encryptionPasswords/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetEncryptionPasswordReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetEncryptionPasswordOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetEncryptionPassword: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateEncryptionPassword edits encryption password - - The HTTP PUT request to the `/api/v1/encryptionPasswords/{id}` path allows you to edit an encryption password that has the specified `id`. -*/ -func (a *Client) UpdateEncryptionPassword(params *UpdateEncryptionPasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEncryptionPasswordOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateEncryptionPasswordParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateEncryptionPassword", - Method: "PUT", - PathPattern: "/api/v1/encryptionPasswords/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateEncryptionPasswordReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateEncryptionPasswordOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateEncryptionPassword: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/encryption/get_all_encryption_passwords_parameters.go b/client/encryption/get_all_encryption_passwords_parameters.go deleted file mode 100644 index 0a073bb..0000000 --- a/client/encryption/get_all_encryption_passwords_parameters.go +++ /dev/null @@ -1,305 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllEncryptionPasswordsParams creates a new GetAllEncryptionPasswordsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllEncryptionPasswordsParams() *GetAllEncryptionPasswordsParams { - return &GetAllEncryptionPasswordsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllEncryptionPasswordsParamsWithTimeout creates a new GetAllEncryptionPasswordsParams object -// with the ability to set a timeout on a request. -func NewGetAllEncryptionPasswordsParamsWithTimeout(timeout time.Duration) *GetAllEncryptionPasswordsParams { - return &GetAllEncryptionPasswordsParams{ - timeout: timeout, - } -} - -// NewGetAllEncryptionPasswordsParamsWithContext creates a new GetAllEncryptionPasswordsParams object -// with the ability to set a context for a request. -func NewGetAllEncryptionPasswordsParamsWithContext(ctx context.Context) *GetAllEncryptionPasswordsParams { - return &GetAllEncryptionPasswordsParams{ - Context: ctx, - } -} - -// NewGetAllEncryptionPasswordsParamsWithHTTPClient creates a new GetAllEncryptionPasswordsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllEncryptionPasswordsParamsWithHTTPClient(client *http.Client) *GetAllEncryptionPasswordsParams { - return &GetAllEncryptionPasswordsParams{ - HTTPClient: client, - } -} - -/* GetAllEncryptionPasswordsParams contains all the parameters to send to the API endpoint - for the get all encryption passwords operation. - - Typically these are written to a http.Request. -*/ -type GetAllEncryptionPasswordsParams struct { - - /* Limit. - - Maximum number of passwords to return. - - Format: int32 - */ - Limit *int32 - - /* OrderAsc. - - Sorts passwords in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts passwords by one of the password parameters. - */ - OrderColumn *string - - /* Skip. - - Number of passwords to skip. - - Format: int32 - */ - Skip *int32 - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all encryption passwords params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllEncryptionPasswordsParams) WithDefaults() *GetAllEncryptionPasswordsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all encryption passwords params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllEncryptionPasswordsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllEncryptionPasswordsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) WithTimeout(timeout time.Duration) *GetAllEncryptionPasswordsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) WithContext(ctx context.Context) *GetAllEncryptionPasswordsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) WithHTTPClient(client *http.Client) *GetAllEncryptionPasswordsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) WithLimit(limit *int32) *GetAllEncryptionPasswordsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithOrderAsc adds the orderAsc to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) WithOrderAsc(orderAsc *bool) *GetAllEncryptionPasswordsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) WithOrderColumn(orderColumn *string) *GetAllEncryptionPasswordsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) WithSkip(skip *int32) *GetAllEncryptionPasswordsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithXAPIVersion adds the xAPIVersion to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) WithXAPIVersion(xAPIVersion string) *GetAllEncryptionPasswordsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all encryption passwords params -func (o *GetAllEncryptionPasswordsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllEncryptionPasswordsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/encryption/get_all_encryption_passwords_responses.go b/client/encryption/get_all_encryption_passwords_responses.go deleted file mode 100644 index 8e94abc..0000000 --- a/client/encryption/get_all_encryption_passwords_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllEncryptionPasswordsReader is a Reader for the GetAllEncryptionPasswords structure. -type GetAllEncryptionPasswordsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllEncryptionPasswordsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllEncryptionPasswordsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllEncryptionPasswordsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllEncryptionPasswordsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllEncryptionPasswordsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllEncryptionPasswordsOK creates a GetAllEncryptionPasswordsOK with default headers values -func NewGetAllEncryptionPasswordsOK() *GetAllEncryptionPasswordsOK { - return &GetAllEncryptionPasswordsOK{} -} - -/* GetAllEncryptionPasswordsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllEncryptionPasswordsOK struct { - Payload *models.EncryptionPasswordsResult -} - -func (o *GetAllEncryptionPasswordsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords][%d] getAllEncryptionPasswordsOK %+v", 200, o.Payload) -} -func (o *GetAllEncryptionPasswordsOK) GetPayload() *models.EncryptionPasswordsResult { - return o.Payload -} - -func (o *GetAllEncryptionPasswordsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.EncryptionPasswordsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllEncryptionPasswordsUnauthorized creates a GetAllEncryptionPasswordsUnauthorized with default headers values -func NewGetAllEncryptionPasswordsUnauthorized() *GetAllEncryptionPasswordsUnauthorized { - return &GetAllEncryptionPasswordsUnauthorized{} -} - -/* GetAllEncryptionPasswordsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllEncryptionPasswordsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllEncryptionPasswordsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords][%d] getAllEncryptionPasswordsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllEncryptionPasswordsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllEncryptionPasswordsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllEncryptionPasswordsForbidden creates a GetAllEncryptionPasswordsForbidden with default headers values -func NewGetAllEncryptionPasswordsForbidden() *GetAllEncryptionPasswordsForbidden { - return &GetAllEncryptionPasswordsForbidden{} -} - -/* GetAllEncryptionPasswordsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllEncryptionPasswordsForbidden struct { - Payload *models.Error -} - -func (o *GetAllEncryptionPasswordsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords][%d] getAllEncryptionPasswordsForbidden %+v", 403, o.Payload) -} -func (o *GetAllEncryptionPasswordsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllEncryptionPasswordsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllEncryptionPasswordsInternalServerError creates a GetAllEncryptionPasswordsInternalServerError with default headers values -func NewGetAllEncryptionPasswordsInternalServerError() *GetAllEncryptionPasswordsInternalServerError { - return &GetAllEncryptionPasswordsInternalServerError{} -} - -/* GetAllEncryptionPasswordsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllEncryptionPasswordsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllEncryptionPasswordsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords][%d] getAllEncryptionPasswordsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllEncryptionPasswordsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllEncryptionPasswordsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/encryption/get_encryption_password_parameters.go b/client/encryption/get_encryption_password_parameters.go deleted file mode 100644 index 458bac9..0000000 --- a/client/encryption/get_encryption_password_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetEncryptionPasswordParams creates a new GetEncryptionPasswordParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetEncryptionPasswordParams() *GetEncryptionPasswordParams { - return &GetEncryptionPasswordParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetEncryptionPasswordParamsWithTimeout creates a new GetEncryptionPasswordParams object -// with the ability to set a timeout on a request. -func NewGetEncryptionPasswordParamsWithTimeout(timeout time.Duration) *GetEncryptionPasswordParams { - return &GetEncryptionPasswordParams{ - timeout: timeout, - } -} - -// NewGetEncryptionPasswordParamsWithContext creates a new GetEncryptionPasswordParams object -// with the ability to set a context for a request. -func NewGetEncryptionPasswordParamsWithContext(ctx context.Context) *GetEncryptionPasswordParams { - return &GetEncryptionPasswordParams{ - Context: ctx, - } -} - -// NewGetEncryptionPasswordParamsWithHTTPClient creates a new GetEncryptionPasswordParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetEncryptionPasswordParamsWithHTTPClient(client *http.Client) *GetEncryptionPasswordParams { - return &GetEncryptionPasswordParams{ - HTTPClient: client, - } -} - -/* GetEncryptionPasswordParams contains all the parameters to send to the API endpoint - for the get encryption password operation. - - Typically these are written to a http.Request. -*/ -type GetEncryptionPasswordParams struct { - - /* ID. - - ID of the encryption password. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get encryption password params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetEncryptionPasswordParams) WithDefaults() *GetEncryptionPasswordParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get encryption password params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetEncryptionPasswordParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetEncryptionPasswordParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get encryption password params -func (o *GetEncryptionPasswordParams) WithTimeout(timeout time.Duration) *GetEncryptionPasswordParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get encryption password params -func (o *GetEncryptionPasswordParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get encryption password params -func (o *GetEncryptionPasswordParams) WithContext(ctx context.Context) *GetEncryptionPasswordParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get encryption password params -func (o *GetEncryptionPasswordParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get encryption password params -func (o *GetEncryptionPasswordParams) WithHTTPClient(client *http.Client) *GetEncryptionPasswordParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get encryption password params -func (o *GetEncryptionPasswordParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get encryption password params -func (o *GetEncryptionPasswordParams) WithID(id strfmt.UUID) *GetEncryptionPasswordParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get encryption password params -func (o *GetEncryptionPasswordParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get encryption password params -func (o *GetEncryptionPasswordParams) WithXAPIVersion(xAPIVersion string) *GetEncryptionPasswordParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get encryption password params -func (o *GetEncryptionPasswordParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetEncryptionPasswordParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/encryption/get_encryption_password_responses.go b/client/encryption/get_encryption_password_responses.go deleted file mode 100644 index 3146bd0..0000000 --- a/client/encryption/get_encryption_password_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetEncryptionPasswordReader is a Reader for the GetEncryptionPassword structure. -type GetEncryptionPasswordReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetEncryptionPasswordReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetEncryptionPasswordOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetEncryptionPasswordUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetEncryptionPasswordForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetEncryptionPasswordNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetEncryptionPasswordInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetEncryptionPasswordOK creates a GetEncryptionPasswordOK with default headers values -func NewGetEncryptionPasswordOK() *GetEncryptionPasswordOK { - return &GetEncryptionPasswordOK{} -} - -/* GetEncryptionPasswordOK describes a response with status code 200, with default header values. - -OK -*/ -type GetEncryptionPasswordOK struct { - Payload *models.EncryptionPasswordModel -} - -func (o *GetEncryptionPasswordOK) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords/{id}][%d] getEncryptionPasswordOK %+v", 200, o.Payload) -} -func (o *GetEncryptionPasswordOK) GetPayload() *models.EncryptionPasswordModel { - return o.Payload -} - -func (o *GetEncryptionPasswordOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.EncryptionPasswordModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetEncryptionPasswordUnauthorized creates a GetEncryptionPasswordUnauthorized with default headers values -func NewGetEncryptionPasswordUnauthorized() *GetEncryptionPasswordUnauthorized { - return &GetEncryptionPasswordUnauthorized{} -} - -/* GetEncryptionPasswordUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetEncryptionPasswordUnauthorized struct { - Payload *models.Error -} - -func (o *GetEncryptionPasswordUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords/{id}][%d] getEncryptionPasswordUnauthorized %+v", 401, o.Payload) -} -func (o *GetEncryptionPasswordUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetEncryptionPasswordUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetEncryptionPasswordForbidden creates a GetEncryptionPasswordForbidden with default headers values -func NewGetEncryptionPasswordForbidden() *GetEncryptionPasswordForbidden { - return &GetEncryptionPasswordForbidden{} -} - -/* GetEncryptionPasswordForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetEncryptionPasswordForbidden struct { - Payload *models.Error -} - -func (o *GetEncryptionPasswordForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords/{id}][%d] getEncryptionPasswordForbidden %+v", 403, o.Payload) -} -func (o *GetEncryptionPasswordForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetEncryptionPasswordForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetEncryptionPasswordNotFound creates a GetEncryptionPasswordNotFound with default headers values -func NewGetEncryptionPasswordNotFound() *GetEncryptionPasswordNotFound { - return &GetEncryptionPasswordNotFound{} -} - -/* GetEncryptionPasswordNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetEncryptionPasswordNotFound struct { - Payload *models.Error -} - -func (o *GetEncryptionPasswordNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords/{id}][%d] getEncryptionPasswordNotFound %+v", 404, o.Payload) -} -func (o *GetEncryptionPasswordNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetEncryptionPasswordNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetEncryptionPasswordInternalServerError creates a GetEncryptionPasswordInternalServerError with default headers values -func NewGetEncryptionPasswordInternalServerError() *GetEncryptionPasswordInternalServerError { - return &GetEncryptionPasswordInternalServerError{} -} - -/* GetEncryptionPasswordInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetEncryptionPasswordInternalServerError struct { - Payload *models.Error -} - -func (o *GetEncryptionPasswordInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/encryptionPasswords/{id}][%d] getEncryptionPasswordInternalServerError %+v", 500, o.Payload) -} -func (o *GetEncryptionPasswordInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetEncryptionPasswordInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/encryption/update_encryption_password_parameters.go b/client/encryption/update_encryption_password_parameters.go deleted file mode 100644 index fc33dc2..0000000 --- a/client/encryption/update_encryption_password_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateEncryptionPasswordParams creates a new UpdateEncryptionPasswordParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateEncryptionPasswordParams() *UpdateEncryptionPasswordParams { - return &UpdateEncryptionPasswordParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateEncryptionPasswordParamsWithTimeout creates a new UpdateEncryptionPasswordParams object -// with the ability to set a timeout on a request. -func NewUpdateEncryptionPasswordParamsWithTimeout(timeout time.Duration) *UpdateEncryptionPasswordParams { - return &UpdateEncryptionPasswordParams{ - timeout: timeout, - } -} - -// NewUpdateEncryptionPasswordParamsWithContext creates a new UpdateEncryptionPasswordParams object -// with the ability to set a context for a request. -func NewUpdateEncryptionPasswordParamsWithContext(ctx context.Context) *UpdateEncryptionPasswordParams { - return &UpdateEncryptionPasswordParams{ - Context: ctx, - } -} - -// NewUpdateEncryptionPasswordParamsWithHTTPClient creates a new UpdateEncryptionPasswordParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateEncryptionPasswordParamsWithHTTPClient(client *http.Client) *UpdateEncryptionPasswordParams { - return &UpdateEncryptionPasswordParams{ - HTTPClient: client, - } -} - -/* UpdateEncryptionPasswordParams contains all the parameters to send to the API endpoint - for the update encryption password operation. - - Typically these are written to a http.Request. -*/ -type UpdateEncryptionPasswordParams struct { - - // Body. - Body *models.EncryptionPasswordModel - - /* ID. - - ID of the encryption password. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update encryption password params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateEncryptionPasswordParams) WithDefaults() *UpdateEncryptionPasswordParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update encryption password params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateEncryptionPasswordParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateEncryptionPasswordParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update encryption password params -func (o *UpdateEncryptionPasswordParams) WithTimeout(timeout time.Duration) *UpdateEncryptionPasswordParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update encryption password params -func (o *UpdateEncryptionPasswordParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update encryption password params -func (o *UpdateEncryptionPasswordParams) WithContext(ctx context.Context) *UpdateEncryptionPasswordParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update encryption password params -func (o *UpdateEncryptionPasswordParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update encryption password params -func (o *UpdateEncryptionPasswordParams) WithHTTPClient(client *http.Client) *UpdateEncryptionPasswordParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update encryption password params -func (o *UpdateEncryptionPasswordParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update encryption password params -func (o *UpdateEncryptionPasswordParams) WithBody(body *models.EncryptionPasswordModel) *UpdateEncryptionPasswordParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update encryption password params -func (o *UpdateEncryptionPasswordParams) SetBody(body *models.EncryptionPasswordModel) { - o.Body = body -} - -// WithID adds the id to the update encryption password params -func (o *UpdateEncryptionPasswordParams) WithID(id strfmt.UUID) *UpdateEncryptionPasswordParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update encryption password params -func (o *UpdateEncryptionPasswordParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the update encryption password params -func (o *UpdateEncryptionPasswordParams) WithXAPIVersion(xAPIVersion string) *UpdateEncryptionPasswordParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update encryption password params -func (o *UpdateEncryptionPasswordParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateEncryptionPasswordParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/encryption/update_encryption_password_responses.go b/client/encryption/update_encryption_password_responses.go deleted file mode 100644 index 5d8ce78..0000000 --- a/client/encryption/update_encryption_password_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package encryption - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateEncryptionPasswordReader is a Reader for the UpdateEncryptionPassword structure. -type UpdateEncryptionPasswordReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateEncryptionPasswordReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateEncryptionPasswordOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateEncryptionPasswordBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateEncryptionPasswordUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateEncryptionPasswordForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateEncryptionPasswordNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateEncryptionPasswordInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateEncryptionPasswordOK creates a UpdateEncryptionPasswordOK with default headers values -func NewUpdateEncryptionPasswordOK() *UpdateEncryptionPasswordOK { - return &UpdateEncryptionPasswordOK{} -} - -/* UpdateEncryptionPasswordOK describes a response with status code 200, with default header values. - -Password has been updated. -*/ -type UpdateEncryptionPasswordOK struct { - Payload *models.EncryptionPasswordModel -} - -func (o *UpdateEncryptionPasswordOK) Error() string { - return fmt.Sprintf("[PUT /api/v1/encryptionPasswords/{id}][%d] updateEncryptionPasswordOK %+v", 200, o.Payload) -} -func (o *UpdateEncryptionPasswordOK) GetPayload() *models.EncryptionPasswordModel { - return o.Payload -} - -func (o *UpdateEncryptionPasswordOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.EncryptionPasswordModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEncryptionPasswordBadRequest creates a UpdateEncryptionPasswordBadRequest with default headers values -func NewUpdateEncryptionPasswordBadRequest() *UpdateEncryptionPasswordBadRequest { - return &UpdateEncryptionPasswordBadRequest{} -} - -/* UpdateEncryptionPasswordBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateEncryptionPasswordBadRequest struct { - Payload *models.Error -} - -func (o *UpdateEncryptionPasswordBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/encryptionPasswords/{id}][%d] updateEncryptionPasswordBadRequest %+v", 400, o.Payload) -} -func (o *UpdateEncryptionPasswordBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateEncryptionPasswordBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEncryptionPasswordUnauthorized creates a UpdateEncryptionPasswordUnauthorized with default headers values -func NewUpdateEncryptionPasswordUnauthorized() *UpdateEncryptionPasswordUnauthorized { - return &UpdateEncryptionPasswordUnauthorized{} -} - -/* UpdateEncryptionPasswordUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateEncryptionPasswordUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateEncryptionPasswordUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/encryptionPasswords/{id}][%d] updateEncryptionPasswordUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateEncryptionPasswordUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateEncryptionPasswordUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEncryptionPasswordForbidden creates a UpdateEncryptionPasswordForbidden with default headers values -func NewUpdateEncryptionPasswordForbidden() *UpdateEncryptionPasswordForbidden { - return &UpdateEncryptionPasswordForbidden{} -} - -/* UpdateEncryptionPasswordForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateEncryptionPasswordForbidden struct { - Payload *models.Error -} - -func (o *UpdateEncryptionPasswordForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/encryptionPasswords/{id}][%d] updateEncryptionPasswordForbidden %+v", 403, o.Payload) -} -func (o *UpdateEncryptionPasswordForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateEncryptionPasswordForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEncryptionPasswordNotFound creates a UpdateEncryptionPasswordNotFound with default headers values -func NewUpdateEncryptionPasswordNotFound() *UpdateEncryptionPasswordNotFound { - return &UpdateEncryptionPasswordNotFound{} -} - -/* UpdateEncryptionPasswordNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type UpdateEncryptionPasswordNotFound struct { - Payload *models.Error -} - -func (o *UpdateEncryptionPasswordNotFound) Error() string { - return fmt.Sprintf("[PUT /api/v1/encryptionPasswords/{id}][%d] updateEncryptionPasswordNotFound %+v", 404, o.Payload) -} -func (o *UpdateEncryptionPasswordNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateEncryptionPasswordNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEncryptionPasswordInternalServerError creates a UpdateEncryptionPasswordInternalServerError with default headers values -func NewUpdateEncryptionPasswordInternalServerError() *UpdateEncryptionPasswordInternalServerError { - return &UpdateEncryptionPasswordInternalServerError{} -} - -/* UpdateEncryptionPasswordInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateEncryptionPasswordInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateEncryptionPasswordInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/encryptionPasswords/{id}][%d] updateEncryptionPasswordInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateEncryptionPasswordInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateEncryptionPasswordInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/general_options/general_options_client.go b/client/general_options/general_options_client.go deleted file mode 100644 index c0babe8..0000000 --- a/client/general_options/general_options_client.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package general_options - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new general options API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for general options API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetGeneralOptions(params *GetGeneralOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetGeneralOptionsOK, error) - - UpdateGeneralOptions(params *UpdateGeneralOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateGeneralOptionsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetGeneralOptions gets general options - - The HTTP GET request to the `/api/v1/generalOptions` path allows you to get general options of Veeam Backup & Replication. -*/ -func (a *Client) GetGeneralOptions(params *GetGeneralOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetGeneralOptionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetGeneralOptionsParams() - } - op := &runtime.ClientOperation{ - ID: "GetGeneralOptions", - Method: "GET", - PathPattern: "/api/v1/generalOptions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetGeneralOptionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetGeneralOptionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetGeneralOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateGeneralOptions edits general options - - The HTTP PUT request to the `/api/v1/generalOptions` path allows you to edit general options of Veeam Backup & Replication. -*/ -func (a *Client) UpdateGeneralOptions(params *UpdateGeneralOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateGeneralOptionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateGeneralOptionsParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateGeneralOptions", - Method: "PUT", - PathPattern: "/api/v1/generalOptions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateGeneralOptionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateGeneralOptionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateGeneralOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/general_options/get_general_options_parameters.go b/client/general_options/get_general_options_parameters.go deleted file mode 100644 index eec2db0..0000000 --- a/client/general_options/get_general_options_parameters.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package general_options - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetGeneralOptionsParams creates a new GetGeneralOptionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetGeneralOptionsParams() *GetGeneralOptionsParams { - return &GetGeneralOptionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetGeneralOptionsParamsWithTimeout creates a new GetGeneralOptionsParams object -// with the ability to set a timeout on a request. -func NewGetGeneralOptionsParamsWithTimeout(timeout time.Duration) *GetGeneralOptionsParams { - return &GetGeneralOptionsParams{ - timeout: timeout, - } -} - -// NewGetGeneralOptionsParamsWithContext creates a new GetGeneralOptionsParams object -// with the ability to set a context for a request. -func NewGetGeneralOptionsParamsWithContext(ctx context.Context) *GetGeneralOptionsParams { - return &GetGeneralOptionsParams{ - Context: ctx, - } -} - -// NewGetGeneralOptionsParamsWithHTTPClient creates a new GetGeneralOptionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetGeneralOptionsParamsWithHTTPClient(client *http.Client) *GetGeneralOptionsParams { - return &GetGeneralOptionsParams{ - HTTPClient: client, - } -} - -/* GetGeneralOptionsParams contains all the parameters to send to the API endpoint - for the get general options operation. - - Typically these are written to a http.Request. -*/ -type GetGeneralOptionsParams struct { - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get general options params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetGeneralOptionsParams) WithDefaults() *GetGeneralOptionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get general options params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetGeneralOptionsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetGeneralOptionsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get general options params -func (o *GetGeneralOptionsParams) WithTimeout(timeout time.Duration) *GetGeneralOptionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get general options params -func (o *GetGeneralOptionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get general options params -func (o *GetGeneralOptionsParams) WithContext(ctx context.Context) *GetGeneralOptionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get general options params -func (o *GetGeneralOptionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get general options params -func (o *GetGeneralOptionsParams) WithHTTPClient(client *http.Client) *GetGeneralOptionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get general options params -func (o *GetGeneralOptionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXAPIVersion adds the xAPIVersion to the get general options params -func (o *GetGeneralOptionsParams) WithXAPIVersion(xAPIVersion string) *GetGeneralOptionsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get general options params -func (o *GetGeneralOptionsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetGeneralOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/general_options/get_general_options_responses.go b/client/general_options/get_general_options_responses.go deleted file mode 100644 index 9c7e3ff..0000000 --- a/client/general_options/get_general_options_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package general_options - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetGeneralOptionsReader is a Reader for the GetGeneralOptions structure. -type GetGeneralOptionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetGeneralOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetGeneralOptionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetGeneralOptionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetGeneralOptionsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetGeneralOptionsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetGeneralOptionsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetGeneralOptionsOK creates a GetGeneralOptionsOK with default headers values -func NewGetGeneralOptionsOK() *GetGeneralOptionsOK { - return &GetGeneralOptionsOK{} -} - -/* GetGeneralOptionsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetGeneralOptionsOK struct { - Payload *models.GeneralOptionsModel -} - -func (o *GetGeneralOptionsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/generalOptions][%d] getGeneralOptionsOK %+v", 200, o.Payload) -} -func (o *GetGeneralOptionsOK) GetPayload() *models.GeneralOptionsModel { - return o.Payload -} - -func (o *GetGeneralOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GeneralOptionsModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetGeneralOptionsUnauthorized creates a GetGeneralOptionsUnauthorized with default headers values -func NewGetGeneralOptionsUnauthorized() *GetGeneralOptionsUnauthorized { - return &GetGeneralOptionsUnauthorized{} -} - -/* GetGeneralOptionsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetGeneralOptionsUnauthorized struct { - Payload *models.Error -} - -func (o *GetGeneralOptionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/generalOptions][%d] getGeneralOptionsUnauthorized %+v", 401, o.Payload) -} -func (o *GetGeneralOptionsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetGeneralOptionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetGeneralOptionsForbidden creates a GetGeneralOptionsForbidden with default headers values -func NewGetGeneralOptionsForbidden() *GetGeneralOptionsForbidden { - return &GetGeneralOptionsForbidden{} -} - -/* GetGeneralOptionsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetGeneralOptionsForbidden struct { - Payload *models.Error -} - -func (o *GetGeneralOptionsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/generalOptions][%d] getGeneralOptionsForbidden %+v", 403, o.Payload) -} -func (o *GetGeneralOptionsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetGeneralOptionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetGeneralOptionsNotFound creates a GetGeneralOptionsNotFound with default headers values -func NewGetGeneralOptionsNotFound() *GetGeneralOptionsNotFound { - return &GetGeneralOptionsNotFound{} -} - -/* GetGeneralOptionsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetGeneralOptionsNotFound struct { - Payload *models.Error -} - -func (o *GetGeneralOptionsNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/generalOptions][%d] getGeneralOptionsNotFound %+v", 404, o.Payload) -} -func (o *GetGeneralOptionsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetGeneralOptionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetGeneralOptionsInternalServerError creates a GetGeneralOptionsInternalServerError with default headers values -func NewGetGeneralOptionsInternalServerError() *GetGeneralOptionsInternalServerError { - return &GetGeneralOptionsInternalServerError{} -} - -/* GetGeneralOptionsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetGeneralOptionsInternalServerError struct { - Payload *models.Error -} - -func (o *GetGeneralOptionsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/generalOptions][%d] getGeneralOptionsInternalServerError %+v", 500, o.Payload) -} -func (o *GetGeneralOptionsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetGeneralOptionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/general_options/update_general_options_parameters.go b/client/general_options/update_general_options_parameters.go deleted file mode 100644 index 3946b53..0000000 --- a/client/general_options/update_general_options_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package general_options - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateGeneralOptionsParams creates a new UpdateGeneralOptionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateGeneralOptionsParams() *UpdateGeneralOptionsParams { - return &UpdateGeneralOptionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateGeneralOptionsParamsWithTimeout creates a new UpdateGeneralOptionsParams object -// with the ability to set a timeout on a request. -func NewUpdateGeneralOptionsParamsWithTimeout(timeout time.Duration) *UpdateGeneralOptionsParams { - return &UpdateGeneralOptionsParams{ - timeout: timeout, - } -} - -// NewUpdateGeneralOptionsParamsWithContext creates a new UpdateGeneralOptionsParams object -// with the ability to set a context for a request. -func NewUpdateGeneralOptionsParamsWithContext(ctx context.Context) *UpdateGeneralOptionsParams { - return &UpdateGeneralOptionsParams{ - Context: ctx, - } -} - -// NewUpdateGeneralOptionsParamsWithHTTPClient creates a new UpdateGeneralOptionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateGeneralOptionsParamsWithHTTPClient(client *http.Client) *UpdateGeneralOptionsParams { - return &UpdateGeneralOptionsParams{ - HTTPClient: client, - } -} - -/* UpdateGeneralOptionsParams contains all the parameters to send to the API endpoint - for the update general options operation. - - Typically these are written to a http.Request. -*/ -type UpdateGeneralOptionsParams struct { - - // Body. - Body *models.GeneralOptionsModel - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update general options params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateGeneralOptionsParams) WithDefaults() *UpdateGeneralOptionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update general options params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateGeneralOptionsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateGeneralOptionsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update general options params -func (o *UpdateGeneralOptionsParams) WithTimeout(timeout time.Duration) *UpdateGeneralOptionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update general options params -func (o *UpdateGeneralOptionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update general options params -func (o *UpdateGeneralOptionsParams) WithContext(ctx context.Context) *UpdateGeneralOptionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update general options params -func (o *UpdateGeneralOptionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update general options params -func (o *UpdateGeneralOptionsParams) WithHTTPClient(client *http.Client) *UpdateGeneralOptionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update general options params -func (o *UpdateGeneralOptionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update general options params -func (o *UpdateGeneralOptionsParams) WithBody(body *models.GeneralOptionsModel) *UpdateGeneralOptionsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update general options params -func (o *UpdateGeneralOptionsParams) SetBody(body *models.GeneralOptionsModel) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the update general options params -func (o *UpdateGeneralOptionsParams) WithXAPIVersion(xAPIVersion string) *UpdateGeneralOptionsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update general options params -func (o *UpdateGeneralOptionsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateGeneralOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/general_options/update_general_options_responses.go b/client/general_options/update_general_options_responses.go deleted file mode 100644 index 54e6e01..0000000 --- a/client/general_options/update_general_options_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package general_options - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateGeneralOptionsReader is a Reader for the UpdateGeneralOptions structure. -type UpdateGeneralOptionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateGeneralOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateGeneralOptionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateGeneralOptionsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateGeneralOptionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateGeneralOptionsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateGeneralOptionsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateGeneralOptionsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateGeneralOptionsOK creates a UpdateGeneralOptionsOK with default headers values -func NewUpdateGeneralOptionsOK() *UpdateGeneralOptionsOK { - return &UpdateGeneralOptionsOK{} -} - -/* UpdateGeneralOptionsOK describes a response with status code 200, with default header values. - -General options have been updated. -*/ -type UpdateGeneralOptionsOK struct { - Payload *models.GeneralOptionsModel -} - -func (o *UpdateGeneralOptionsOK) Error() string { - return fmt.Sprintf("[PUT /api/v1/generalOptions][%d] updateGeneralOptionsOK %+v", 200, o.Payload) -} -func (o *UpdateGeneralOptionsOK) GetPayload() *models.GeneralOptionsModel { - return o.Payload -} - -func (o *UpdateGeneralOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GeneralOptionsModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateGeneralOptionsBadRequest creates a UpdateGeneralOptionsBadRequest with default headers values -func NewUpdateGeneralOptionsBadRequest() *UpdateGeneralOptionsBadRequest { - return &UpdateGeneralOptionsBadRequest{} -} - -/* UpdateGeneralOptionsBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateGeneralOptionsBadRequest struct { - Payload *models.Error -} - -func (o *UpdateGeneralOptionsBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/generalOptions][%d] updateGeneralOptionsBadRequest %+v", 400, o.Payload) -} -func (o *UpdateGeneralOptionsBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateGeneralOptionsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateGeneralOptionsUnauthorized creates a UpdateGeneralOptionsUnauthorized with default headers values -func NewUpdateGeneralOptionsUnauthorized() *UpdateGeneralOptionsUnauthorized { - return &UpdateGeneralOptionsUnauthorized{} -} - -/* UpdateGeneralOptionsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateGeneralOptionsUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateGeneralOptionsUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/generalOptions][%d] updateGeneralOptionsUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateGeneralOptionsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateGeneralOptionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateGeneralOptionsForbidden creates a UpdateGeneralOptionsForbidden with default headers values -func NewUpdateGeneralOptionsForbidden() *UpdateGeneralOptionsForbidden { - return &UpdateGeneralOptionsForbidden{} -} - -/* UpdateGeneralOptionsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateGeneralOptionsForbidden struct { - Payload *models.Error -} - -func (o *UpdateGeneralOptionsForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/generalOptions][%d] updateGeneralOptionsForbidden %+v", 403, o.Payload) -} -func (o *UpdateGeneralOptionsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateGeneralOptionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateGeneralOptionsNotFound creates a UpdateGeneralOptionsNotFound with default headers values -func NewUpdateGeneralOptionsNotFound() *UpdateGeneralOptionsNotFound { - return &UpdateGeneralOptionsNotFound{} -} - -/* UpdateGeneralOptionsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type UpdateGeneralOptionsNotFound struct { - Payload *models.Error -} - -func (o *UpdateGeneralOptionsNotFound) Error() string { - return fmt.Sprintf("[PUT /api/v1/generalOptions][%d] updateGeneralOptionsNotFound %+v", 404, o.Payload) -} -func (o *UpdateGeneralOptionsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateGeneralOptionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateGeneralOptionsInternalServerError creates a UpdateGeneralOptionsInternalServerError with default headers values -func NewUpdateGeneralOptionsInternalServerError() *UpdateGeneralOptionsInternalServerError { - return &UpdateGeneralOptionsInternalServerError{} -} - -/* UpdateGeneralOptionsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateGeneralOptionsInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateGeneralOptionsInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/generalOptions][%d] updateGeneralOptionsInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateGeneralOptionsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateGeneralOptionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/inventory_browser/get_all_inventory_vmware_hosts_parameters.go b/client/inventory_browser/get_all_inventory_vmware_hosts_parameters.go deleted file mode 100644 index 5a75733..0000000 --- a/client/inventory_browser/get_all_inventory_vmware_hosts_parameters.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package inventory_browser - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllInventoryVmwareHostsParams creates a new GetAllInventoryVmwareHostsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllInventoryVmwareHostsParams() *GetAllInventoryVmwareHostsParams { - return &GetAllInventoryVmwareHostsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllInventoryVmwareHostsParamsWithTimeout creates a new GetAllInventoryVmwareHostsParams object -// with the ability to set a timeout on a request. -func NewGetAllInventoryVmwareHostsParamsWithTimeout(timeout time.Duration) *GetAllInventoryVmwareHostsParams { - return &GetAllInventoryVmwareHostsParams{ - timeout: timeout, - } -} - -// NewGetAllInventoryVmwareHostsParamsWithContext creates a new GetAllInventoryVmwareHostsParams object -// with the ability to set a context for a request. -func NewGetAllInventoryVmwareHostsParamsWithContext(ctx context.Context) *GetAllInventoryVmwareHostsParams { - return &GetAllInventoryVmwareHostsParams{ - Context: ctx, - } -} - -// NewGetAllInventoryVmwareHostsParamsWithHTTPClient creates a new GetAllInventoryVmwareHostsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllInventoryVmwareHostsParamsWithHTTPClient(client *http.Client) *GetAllInventoryVmwareHostsParams { - return &GetAllInventoryVmwareHostsParams{ - HTTPClient: client, - } -} - -/* GetAllInventoryVmwareHostsParams contains all the parameters to send to the API endpoint - for the get all inventory vmware hosts operation. - - Typically these are written to a http.Request. -*/ -type GetAllInventoryVmwareHostsParams struct { - - /* Limit. - - Maximum number of VMware vSphere servers to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters VMware vSphere servers by the `nameFilter` pattern. The pattern can match any VMware vSphere server parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts VMware vSphere servers in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts VMware vSphere servers by one of the VMware vSphere server parameters. - */ - OrderColumn *string - - /* Skip. - - Number of VMware vSphere servers to skip. - - Format: int32 - */ - Skip *int32 - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all inventory vmware hosts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllInventoryVmwareHostsParams) WithDefaults() *GetAllInventoryVmwareHostsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all inventory vmware hosts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllInventoryVmwareHostsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllInventoryVmwareHostsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithTimeout(timeout time.Duration) *GetAllInventoryVmwareHostsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithContext(ctx context.Context) *GetAllInventoryVmwareHostsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithHTTPClient(client *http.Client) *GetAllInventoryVmwareHostsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithLimit(limit *int32) *GetAllInventoryVmwareHostsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithNameFilter(nameFilter *string) *GetAllInventoryVmwareHostsParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithOrderAsc(orderAsc *bool) *GetAllInventoryVmwareHostsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithOrderColumn(orderColumn *string) *GetAllInventoryVmwareHostsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithSkip(skip *int32) *GetAllInventoryVmwareHostsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithXAPIVersion adds the xAPIVersion to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) WithXAPIVersion(xAPIVersion string) *GetAllInventoryVmwareHostsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all inventory vmware hosts params -func (o *GetAllInventoryVmwareHostsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllInventoryVmwareHostsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/inventory_browser/get_all_inventory_vmware_hosts_responses.go b/client/inventory_browser/get_all_inventory_vmware_hosts_responses.go deleted file mode 100644 index d95f3af..0000000 --- a/client/inventory_browser/get_all_inventory_vmware_hosts_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package inventory_browser - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllInventoryVmwareHostsReader is a Reader for the GetAllInventoryVmwareHosts structure. -type GetAllInventoryVmwareHostsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllInventoryVmwareHostsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllInventoryVmwareHostsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllInventoryVmwareHostsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllInventoryVmwareHostsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllInventoryVmwareHostsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllInventoryVmwareHostsOK creates a GetAllInventoryVmwareHostsOK with default headers values -func NewGetAllInventoryVmwareHostsOK() *GetAllInventoryVmwareHostsOK { - return &GetAllInventoryVmwareHostsOK{} -} - -/* GetAllInventoryVmwareHostsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllInventoryVmwareHostsOK struct { - Payload *models.ViRootsResult -} - -func (o *GetAllInventoryVmwareHostsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts][%d] getAllInventoryVmwareHostsOK %+v", 200, o.Payload) -} -func (o *GetAllInventoryVmwareHostsOK) GetPayload() *models.ViRootsResult { - return o.Payload -} - -func (o *GetAllInventoryVmwareHostsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ViRootsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllInventoryVmwareHostsUnauthorized creates a GetAllInventoryVmwareHostsUnauthorized with default headers values -func NewGetAllInventoryVmwareHostsUnauthorized() *GetAllInventoryVmwareHostsUnauthorized { - return &GetAllInventoryVmwareHostsUnauthorized{} -} - -/* GetAllInventoryVmwareHostsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllInventoryVmwareHostsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllInventoryVmwareHostsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts][%d] getAllInventoryVmwareHostsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllInventoryVmwareHostsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllInventoryVmwareHostsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllInventoryVmwareHostsForbidden creates a GetAllInventoryVmwareHostsForbidden with default headers values -func NewGetAllInventoryVmwareHostsForbidden() *GetAllInventoryVmwareHostsForbidden { - return &GetAllInventoryVmwareHostsForbidden{} -} - -/* GetAllInventoryVmwareHostsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllInventoryVmwareHostsForbidden struct { - Payload *models.Error -} - -func (o *GetAllInventoryVmwareHostsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts][%d] getAllInventoryVmwareHostsForbidden %+v", 403, o.Payload) -} -func (o *GetAllInventoryVmwareHostsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllInventoryVmwareHostsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllInventoryVmwareHostsInternalServerError creates a GetAllInventoryVmwareHostsInternalServerError with default headers values -func NewGetAllInventoryVmwareHostsInternalServerError() *GetAllInventoryVmwareHostsInternalServerError { - return &GetAllInventoryVmwareHostsInternalServerError{} -} - -/* GetAllInventoryVmwareHostsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllInventoryVmwareHostsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllInventoryVmwareHostsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts][%d] getAllInventoryVmwareHostsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllInventoryVmwareHostsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllInventoryVmwareHostsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/inventory_browser/get_vmware_host_object_parameters.go b/client/inventory_browser/get_vmware_host_object_parameters.go deleted file mode 100644 index 8c0d297..0000000 --- a/client/inventory_browser/get_vmware_host_object_parameters.go +++ /dev/null @@ -1,497 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package inventory_browser - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetVmwareHostObjectParams creates a new GetVmwareHostObjectParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetVmwareHostObjectParams() *GetVmwareHostObjectParams { - return &GetVmwareHostObjectParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetVmwareHostObjectParamsWithTimeout creates a new GetVmwareHostObjectParams object -// with the ability to set a timeout on a request. -func NewGetVmwareHostObjectParamsWithTimeout(timeout time.Duration) *GetVmwareHostObjectParams { - return &GetVmwareHostObjectParams{ - timeout: timeout, - } -} - -// NewGetVmwareHostObjectParamsWithContext creates a new GetVmwareHostObjectParams object -// with the ability to set a context for a request. -func NewGetVmwareHostObjectParamsWithContext(ctx context.Context) *GetVmwareHostObjectParams { - return &GetVmwareHostObjectParams{ - Context: ctx, - } -} - -// NewGetVmwareHostObjectParamsWithHTTPClient creates a new GetVmwareHostObjectParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetVmwareHostObjectParamsWithHTTPClient(client *http.Client) *GetVmwareHostObjectParams { - return &GetVmwareHostObjectParams{ - HTTPClient: client, - } -} - -/* GetVmwareHostObjectParams contains all the parameters to send to the API endpoint - for the get vmware host object operation. - - Typically these are written to a http.Request. -*/ -type GetVmwareHostObjectParams struct { - - /* HierarchyTypeFilter. - - Filters objects by hierarchy type. - */ - HierarchyTypeFilter *string - - /* Limit. - - Maximum number of objects to return. - - Format: int32 - */ - Limit *int32 - - /* Name. - - Name of the VMware vSphere server. - */ - Name string - - /* NameFilter. - - Filters objects by the `nameFilter` pattern. The pattern can match any object parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* ObjectIDFilter. - - Filters objects by object ID. - */ - ObjectIDFilter *string - - /* OrderAsc. - - Sorts objects in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts objects by one of the object parameters. - */ - OrderColumn *string - - /* ParentContainerNameFilter. - - Filters objects by name of the parent container. - */ - ParentContainerNameFilter *string - - /* Skip. - - Number of objects to skip. - - Format: int32 - */ - Skip *int32 - - /* TypeFilter. - - Filters objects by virtual infrastructure type. - */ - TypeFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get vmware host object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVmwareHostObjectParams) WithDefaults() *GetVmwareHostObjectParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get vmware host object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVmwareHostObjectParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetVmwareHostObjectParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithTimeout(timeout time.Duration) *GetVmwareHostObjectParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithContext(ctx context.Context) *GetVmwareHostObjectParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithHTTPClient(client *http.Client) *GetVmwareHostObjectParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHierarchyTypeFilter adds the hierarchyTypeFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithHierarchyTypeFilter(hierarchyTypeFilter *string) *GetVmwareHostObjectParams { - o.SetHierarchyTypeFilter(hierarchyTypeFilter) - return o -} - -// SetHierarchyTypeFilter adds the hierarchyTypeFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetHierarchyTypeFilter(hierarchyTypeFilter *string) { - o.HierarchyTypeFilter = hierarchyTypeFilter -} - -// WithLimit adds the limit to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithLimit(limit *int32) *GetVmwareHostObjectParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithName adds the name to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithName(name string) *GetVmwareHostObjectParams { - o.SetName(name) - return o -} - -// SetName adds the name to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetName(name string) { - o.Name = name -} - -// WithNameFilter adds the nameFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithNameFilter(nameFilter *string) *GetVmwareHostObjectParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithObjectIDFilter adds the objectIDFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithObjectIDFilter(objectIDFilter *string) *GetVmwareHostObjectParams { - o.SetObjectIDFilter(objectIDFilter) - return o -} - -// SetObjectIDFilter adds the objectIdFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetObjectIDFilter(objectIDFilter *string) { - o.ObjectIDFilter = objectIDFilter -} - -// WithOrderAsc adds the orderAsc to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithOrderAsc(orderAsc *bool) *GetVmwareHostObjectParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithOrderColumn(orderColumn *string) *GetVmwareHostObjectParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithParentContainerNameFilter adds the parentContainerNameFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithParentContainerNameFilter(parentContainerNameFilter *string) *GetVmwareHostObjectParams { - o.SetParentContainerNameFilter(parentContainerNameFilter) - return o -} - -// SetParentContainerNameFilter adds the parentContainerNameFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetParentContainerNameFilter(parentContainerNameFilter *string) { - o.ParentContainerNameFilter = parentContainerNameFilter -} - -// WithSkip adds the skip to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithSkip(skip *int32) *GetVmwareHostObjectParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithTypeFilter adds the typeFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithTypeFilter(typeFilter *string) *GetVmwareHostObjectParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get vmware host object params -func (o *GetVmwareHostObjectParams) WithXAPIVersion(xAPIVersion string) *GetVmwareHostObjectParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get vmware host object params -func (o *GetVmwareHostObjectParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetVmwareHostObjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.HierarchyTypeFilter != nil { - - // query param hierarchyTypeFilter - var qrHierarchyTypeFilter string - - if o.HierarchyTypeFilter != nil { - qrHierarchyTypeFilter = *o.HierarchyTypeFilter - } - qHierarchyTypeFilter := qrHierarchyTypeFilter - if qHierarchyTypeFilter != "" { - - if err := r.SetQueryParam("hierarchyTypeFilter", qHierarchyTypeFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - // path param name - if err := r.SetPathParam("name", o.Name); err != nil { - return err - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.ObjectIDFilter != nil { - - // query param objectIdFilter - var qrObjectIDFilter string - - if o.ObjectIDFilter != nil { - qrObjectIDFilter = *o.ObjectIDFilter - } - qObjectIDFilter := qrObjectIDFilter - if qObjectIDFilter != "" { - - if err := r.SetQueryParam("objectIdFilter", qObjectIDFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.ParentContainerNameFilter != nil { - - // query param parentContainerNameFilter - var qrParentContainerNameFilter string - - if o.ParentContainerNameFilter != nil { - qrParentContainerNameFilter = *o.ParentContainerNameFilter - } - qParentContainerNameFilter := qrParentContainerNameFilter - if qParentContainerNameFilter != "" { - - if err := r.SetQueryParam("parentContainerNameFilter", qParentContainerNameFilter); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/inventory_browser/get_vmware_host_object_responses.go b/client/inventory_browser/get_vmware_host_object_responses.go deleted file mode 100644 index 74225e2..0000000 --- a/client/inventory_browser/get_vmware_host_object_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package inventory_browser - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetVmwareHostObjectReader is a Reader for the GetVmwareHostObject structure. -type GetVmwareHostObjectReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetVmwareHostObjectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetVmwareHostObjectOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetVmwareHostObjectUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetVmwareHostObjectForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetVmwareHostObjectNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetVmwareHostObjectInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetVmwareHostObjectOK creates a GetVmwareHostObjectOK with default headers values -func NewGetVmwareHostObjectOK() *GetVmwareHostObjectOK { - return &GetVmwareHostObjectOK{} -} - -/* GetVmwareHostObjectOK describes a response with status code 200, with default header values. - -OK -*/ -type GetVmwareHostObjectOK struct { - Payload *models.VCenterInventoryResult -} - -func (o *GetVmwareHostObjectOK) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts/{name}][%d] getVmwareHostObjectOK %+v", 200, o.Payload) -} -func (o *GetVmwareHostObjectOK) GetPayload() *models.VCenterInventoryResult { - return o.Payload -} - -func (o *GetVmwareHostObjectOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VCenterInventoryResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetVmwareHostObjectUnauthorized creates a GetVmwareHostObjectUnauthorized with default headers values -func NewGetVmwareHostObjectUnauthorized() *GetVmwareHostObjectUnauthorized { - return &GetVmwareHostObjectUnauthorized{} -} - -/* GetVmwareHostObjectUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetVmwareHostObjectUnauthorized struct { - Payload *models.Error -} - -func (o *GetVmwareHostObjectUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts/{name}][%d] getVmwareHostObjectUnauthorized %+v", 401, o.Payload) -} -func (o *GetVmwareHostObjectUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetVmwareHostObjectUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetVmwareHostObjectForbidden creates a GetVmwareHostObjectForbidden with default headers values -func NewGetVmwareHostObjectForbidden() *GetVmwareHostObjectForbidden { - return &GetVmwareHostObjectForbidden{} -} - -/* GetVmwareHostObjectForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetVmwareHostObjectForbidden struct { - Payload *models.Error -} - -func (o *GetVmwareHostObjectForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts/{name}][%d] getVmwareHostObjectForbidden %+v", 403, o.Payload) -} -func (o *GetVmwareHostObjectForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetVmwareHostObjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetVmwareHostObjectNotFound creates a GetVmwareHostObjectNotFound with default headers values -func NewGetVmwareHostObjectNotFound() *GetVmwareHostObjectNotFound { - return &GetVmwareHostObjectNotFound{} -} - -/* GetVmwareHostObjectNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetVmwareHostObjectNotFound struct { - Payload *models.Error -} - -func (o *GetVmwareHostObjectNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts/{name}][%d] getVmwareHostObjectNotFound %+v", 404, o.Payload) -} -func (o *GetVmwareHostObjectNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetVmwareHostObjectNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetVmwareHostObjectInternalServerError creates a GetVmwareHostObjectInternalServerError with default headers values -func NewGetVmwareHostObjectInternalServerError() *GetVmwareHostObjectInternalServerError { - return &GetVmwareHostObjectInternalServerError{} -} - -/* GetVmwareHostObjectInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetVmwareHostObjectInternalServerError struct { - Payload *models.Error -} - -func (o *GetVmwareHostObjectInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/inventory/vmware/hosts/{name}][%d] getVmwareHostObjectInternalServerError %+v", 500, o.Payload) -} -func (o *GetVmwareHostObjectInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetVmwareHostObjectInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/inventory_browser/inventory_browser_client.go b/client/inventory_browser/inventory_browser_client.go deleted file mode 100644 index b35b3ea..0000000 --- a/client/inventory_browser/inventory_browser_client.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package inventory_browser - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new inventory browser API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for inventory browser API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetAllInventoryVmwareHosts(params *GetAllInventoryVmwareHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllInventoryVmwareHostsOK, error) - - GetVmwareHostObject(params *GetVmwareHostObjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVmwareHostObjectOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAllInventoryVmwareHosts gets all v mware v sphere servers - - The HTTP GET request to the `/api/v1/inventory/vmware/hosts` path allows you to get an array of all VMware vSphere servers added to the backup infrastructure. -*/ -func (a *Client) GetAllInventoryVmwareHosts(params *GetAllInventoryVmwareHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllInventoryVmwareHostsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllInventoryVmwareHostsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllInventoryVmwareHosts", - Method: "GET", - PathPattern: "/api/v1/inventory/vmware/hosts", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllInventoryVmwareHostsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllInventoryVmwareHostsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllInventoryVmwareHosts: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetVmwareHostObject gets v mware v sphere server objects - - The HTTP GET request to the `/api/v1/inventory/vmware/hosts/{name}` path allows you to get an array of virtual infrastructure objects of the VMware vSphere server that has the specified `name`. -*/ -func (a *Client) GetVmwareHostObject(params *GetVmwareHostObjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVmwareHostObjectOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetVmwareHostObjectParams() - } - op := &runtime.ClientOperation{ - ID: "GetVmwareHostObject", - Method: "GET", - PathPattern: "/api/v1/inventory/vmware/hosts/{name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetVmwareHostObjectReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetVmwareHostObjectOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetVmwareHostObject: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/jobs/create_job_parameters.go b/client/jobs/create_job_parameters.go deleted file mode 100644 index bb2db71..0000000 --- a/client/jobs/create_job_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewCreateJobParams creates a new CreateJobParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateJobParams() *CreateJobParams { - return &CreateJobParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateJobParamsWithTimeout creates a new CreateJobParams object -// with the ability to set a timeout on a request. -func NewCreateJobParamsWithTimeout(timeout time.Duration) *CreateJobParams { - return &CreateJobParams{ - timeout: timeout, - } -} - -// NewCreateJobParamsWithContext creates a new CreateJobParams object -// with the ability to set a context for a request. -func NewCreateJobParamsWithContext(ctx context.Context) *CreateJobParams { - return &CreateJobParams{ - Context: ctx, - } -} - -// NewCreateJobParamsWithHTTPClient creates a new CreateJobParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateJobParamsWithHTTPClient(client *http.Client) *CreateJobParams { - return &CreateJobParams{ - HTTPClient: client, - } -} - -/* CreateJobParams contains all the parameters to send to the API endpoint - for the create job operation. - - Typically these are written to a http.Request. -*/ -type CreateJobParams struct { - - // Body. - Body *models.JobSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateJobParams) WithDefaults() *CreateJobParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateJobParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := CreateJobParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create job params -func (o *CreateJobParams) WithTimeout(timeout time.Duration) *CreateJobParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create job params -func (o *CreateJobParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create job params -func (o *CreateJobParams) WithContext(ctx context.Context) *CreateJobParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create job params -func (o *CreateJobParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create job params -func (o *CreateJobParams) WithHTTPClient(client *http.Client) *CreateJobParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create job params -func (o *CreateJobParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create job params -func (o *CreateJobParams) WithBody(body *models.JobSpec) *CreateJobParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create job params -func (o *CreateJobParams) SetBody(body *models.JobSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the create job params -func (o *CreateJobParams) WithXAPIVersion(xAPIVersion string) *CreateJobParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the create job params -func (o *CreateJobParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/create_job_responses.go b/client/jobs/create_job_responses.go deleted file mode 100644 index a6c6847..0000000 --- a/client/jobs/create_job_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// CreateJobReader is a Reader for the CreateJob structure. -type CreateJobReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateJobCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateJobBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateJobUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateJobForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateJobInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateJobCreated creates a CreateJobCreated with default headers values -func NewCreateJobCreated() *CreateJobCreated { - return &CreateJobCreated{} -} - -/* CreateJobCreated describes a response with status code 201, with default header values. - -Job has been created. -*/ -type CreateJobCreated struct { - Payload *models.JobModel -} - -func (o *CreateJobCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs][%d] createJobCreated %+v", 201, o.Payload) -} -func (o *CreateJobCreated) GetPayload() *models.JobModel { - return o.Payload -} - -func (o *CreateJobCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateJobBadRequest creates a CreateJobBadRequest with default headers values -func NewCreateJobBadRequest() *CreateJobBadRequest { - return &CreateJobBadRequest{} -} - -/* CreateJobBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type CreateJobBadRequest struct { - Payload *models.Error -} - -func (o *CreateJobBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs][%d] createJobBadRequest %+v", 400, o.Payload) -} -func (o *CreateJobBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateJobUnauthorized creates a CreateJobUnauthorized with default headers values -func NewCreateJobUnauthorized() *CreateJobUnauthorized { - return &CreateJobUnauthorized{} -} - -/* CreateJobUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type CreateJobUnauthorized struct { - Payload *models.Error -} - -func (o *CreateJobUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs][%d] createJobUnauthorized %+v", 401, o.Payload) -} -func (o *CreateJobUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateJobForbidden creates a CreateJobForbidden with default headers values -func NewCreateJobForbidden() *CreateJobForbidden { - return &CreateJobForbidden{} -} - -/* CreateJobForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type CreateJobForbidden struct { - Payload *models.Error -} - -func (o *CreateJobForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs][%d] createJobForbidden %+v", 403, o.Payload) -} -func (o *CreateJobForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateJobInternalServerError creates a CreateJobInternalServerError with default headers values -func NewCreateJobInternalServerError() *CreateJobInternalServerError { - return &CreateJobInternalServerError{} -} - -/* CreateJobInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type CreateJobInternalServerError struct { - Payload *models.Error -} - -func (o *CreateJobInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs][%d] createJobInternalServerError %+v", 500, o.Payload) -} -func (o *CreateJobInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateJobInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/delete_job_parameters.go b/client/jobs/delete_job_parameters.go deleted file mode 100644 index d73e137..0000000 --- a/client/jobs/delete_job_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteJobParams creates a new DeleteJobParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteJobParams() *DeleteJobParams { - return &DeleteJobParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteJobParamsWithTimeout creates a new DeleteJobParams object -// with the ability to set a timeout on a request. -func NewDeleteJobParamsWithTimeout(timeout time.Duration) *DeleteJobParams { - return &DeleteJobParams{ - timeout: timeout, - } -} - -// NewDeleteJobParamsWithContext creates a new DeleteJobParams object -// with the ability to set a context for a request. -func NewDeleteJobParamsWithContext(ctx context.Context) *DeleteJobParams { - return &DeleteJobParams{ - Context: ctx, - } -} - -// NewDeleteJobParamsWithHTTPClient creates a new DeleteJobParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteJobParamsWithHTTPClient(client *http.Client) *DeleteJobParams { - return &DeleteJobParams{ - HTTPClient: client, - } -} - -/* DeleteJobParams contains all the parameters to send to the API endpoint - for the delete job operation. - - Typically these are written to a http.Request. -*/ -type DeleteJobParams struct { - - // ID. - // - // Format: uuid - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJobParams) WithDefaults() *DeleteJobParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJobParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := DeleteJobParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the delete job params -func (o *DeleteJobParams) WithTimeout(timeout time.Duration) *DeleteJobParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete job params -func (o *DeleteJobParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete job params -func (o *DeleteJobParams) WithContext(ctx context.Context) *DeleteJobParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete job params -func (o *DeleteJobParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete job params -func (o *DeleteJobParams) WithHTTPClient(client *http.Client) *DeleteJobParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete job params -func (o *DeleteJobParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete job params -func (o *DeleteJobParams) WithID(id strfmt.UUID) *DeleteJobParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete job params -func (o *DeleteJobParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the delete job params -func (o *DeleteJobParams) WithXAPIVersion(xAPIVersion string) *DeleteJobParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the delete job params -func (o *DeleteJobParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/delete_job_responses.go b/client/jobs/delete_job_responses.go deleted file mode 100644 index 4c0d52b..0000000 --- a/client/jobs/delete_job_responses.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// DeleteJobReader is a Reader for the DeleteJob structure. -type DeleteJobReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteJobNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteJobUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteJobForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteJobNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteJobInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteJobNoContent creates a DeleteJobNoContent with default headers values -func NewDeleteJobNoContent() *DeleteJobNoContent { - return &DeleteJobNoContent{} -} - -/* DeleteJobNoContent describes a response with status code 204, with default header values. - -Removed. -*/ -type DeleteJobNoContent struct { - Payload models.EmptySuccessResponse -} - -func (o *DeleteJobNoContent) Error() string { - return fmt.Sprintf("[DELETE /api/v1/jobs/{id}][%d] deleteJobNoContent %+v", 204, o.Payload) -} -func (o *DeleteJobNoContent) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *DeleteJobNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteJobUnauthorized creates a DeleteJobUnauthorized with default headers values -func NewDeleteJobUnauthorized() *DeleteJobUnauthorized { - return &DeleteJobUnauthorized{} -} - -/* DeleteJobUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type DeleteJobUnauthorized struct { - Payload *models.Error -} - -func (o *DeleteJobUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /api/v1/jobs/{id}][%d] deleteJobUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteJobUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteJobForbidden creates a DeleteJobForbidden with default headers values -func NewDeleteJobForbidden() *DeleteJobForbidden { - return &DeleteJobForbidden{} -} - -/* DeleteJobForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type DeleteJobForbidden struct { - Payload *models.Error -} - -func (o *DeleteJobForbidden) Error() string { - return fmt.Sprintf("[DELETE /api/v1/jobs/{id}][%d] deleteJobForbidden %+v", 403, o.Payload) -} -func (o *DeleteJobForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteJobNotFound creates a DeleteJobNotFound with default headers values -func NewDeleteJobNotFound() *DeleteJobNotFound { - return &DeleteJobNotFound{} -} - -/* DeleteJobNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type DeleteJobNotFound struct { - Payload *models.Error -} - -func (o *DeleteJobNotFound) Error() string { - return fmt.Sprintf("[DELETE /api/v1/jobs/{id}][%d] deleteJobNotFound %+v", 404, o.Payload) -} -func (o *DeleteJobNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteJobInternalServerError creates a DeleteJobInternalServerError with default headers values -func NewDeleteJobInternalServerError() *DeleteJobInternalServerError { - return &DeleteJobInternalServerError{} -} - -/* DeleteJobInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type DeleteJobInternalServerError struct { - Payload *models.Error -} - -func (o *DeleteJobInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /api/v1/jobs/{id}][%d] deleteJobInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteJobInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteJobInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/disable_job_parameters.go b/client/jobs/disable_job_parameters.go deleted file mode 100644 index f50b4b9..0000000 --- a/client/jobs/disable_job_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDisableJobParams creates a new DisableJobParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDisableJobParams() *DisableJobParams { - return &DisableJobParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDisableJobParamsWithTimeout creates a new DisableJobParams object -// with the ability to set a timeout on a request. -func NewDisableJobParamsWithTimeout(timeout time.Duration) *DisableJobParams { - return &DisableJobParams{ - timeout: timeout, - } -} - -// NewDisableJobParamsWithContext creates a new DisableJobParams object -// with the ability to set a context for a request. -func NewDisableJobParamsWithContext(ctx context.Context) *DisableJobParams { - return &DisableJobParams{ - Context: ctx, - } -} - -// NewDisableJobParamsWithHTTPClient creates a new DisableJobParams object -// with the ability to set a custom HTTPClient for a request. -func NewDisableJobParamsWithHTTPClient(client *http.Client) *DisableJobParams { - return &DisableJobParams{ - HTTPClient: client, - } -} - -/* DisableJobParams contains all the parameters to send to the API endpoint - for the disable job operation. - - Typically these are written to a http.Request. -*/ -type DisableJobParams struct { - - // ID. - // - // Format: uuid - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the disable job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisableJobParams) WithDefaults() *DisableJobParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the disable job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisableJobParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := DisableJobParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the disable job params -func (o *DisableJobParams) WithTimeout(timeout time.Duration) *DisableJobParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the disable job params -func (o *DisableJobParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the disable job params -func (o *DisableJobParams) WithContext(ctx context.Context) *DisableJobParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the disable job params -func (o *DisableJobParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the disable job params -func (o *DisableJobParams) WithHTTPClient(client *http.Client) *DisableJobParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the disable job params -func (o *DisableJobParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the disable job params -func (o *DisableJobParams) WithID(id strfmt.UUID) *DisableJobParams { - o.SetID(id) - return o -} - -// SetID adds the id to the disable job params -func (o *DisableJobParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the disable job params -func (o *DisableJobParams) WithXAPIVersion(xAPIVersion string) *DisableJobParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the disable job params -func (o *DisableJobParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *DisableJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/disable_job_responses.go b/client/jobs/disable_job_responses.go deleted file mode 100644 index 864848d..0000000 --- a/client/jobs/disable_job_responses.go +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// DisableJobReader is a Reader for the DisableJob structure. -type DisableJobReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DisableJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDisableJobOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDisableJobBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDisableJobUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDisableJobForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDisableJobNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDisableJobInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDisableJobOK creates a DisableJobOK with default headers values -func NewDisableJobOK() *DisableJobOK { - return &DisableJobOK{} -} - -/* DisableJobOK describes a response with status code 200, with default header values. - -Job has been disabled. -*/ -type DisableJobOK struct { - Payload models.EmptySuccessResponse -} - -func (o *DisableJobOK) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/disable][%d] disableJobOK %+v", 200, o.Payload) -} -func (o *DisableJobOK) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *DisableJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableJobBadRequest creates a DisableJobBadRequest with default headers values -func NewDisableJobBadRequest() *DisableJobBadRequest { - return &DisableJobBadRequest{} -} - -/* DisableJobBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type DisableJobBadRequest struct { - Payload *models.Error -} - -func (o *DisableJobBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/disable][%d] disableJobBadRequest %+v", 400, o.Payload) -} -func (o *DisableJobBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableJobUnauthorized creates a DisableJobUnauthorized with default headers values -func NewDisableJobUnauthorized() *DisableJobUnauthorized { - return &DisableJobUnauthorized{} -} - -/* DisableJobUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type DisableJobUnauthorized struct { - Payload *models.Error -} - -func (o *DisableJobUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/disable][%d] disableJobUnauthorized %+v", 401, o.Payload) -} -func (o *DisableJobUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableJobForbidden creates a DisableJobForbidden with default headers values -func NewDisableJobForbidden() *DisableJobForbidden { - return &DisableJobForbidden{} -} - -/* DisableJobForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type DisableJobForbidden struct { - Payload *models.Error -} - -func (o *DisableJobForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/disable][%d] disableJobForbidden %+v", 403, o.Payload) -} -func (o *DisableJobForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableJobNotFound creates a DisableJobNotFound with default headers values -func NewDisableJobNotFound() *DisableJobNotFound { - return &DisableJobNotFound{} -} - -/* DisableJobNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type DisableJobNotFound struct { - Payload *models.Error -} - -func (o *DisableJobNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/disable][%d] disableJobNotFound %+v", 404, o.Payload) -} -func (o *DisableJobNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableJobInternalServerError creates a DisableJobInternalServerError with default headers values -func NewDisableJobInternalServerError() *DisableJobInternalServerError { - return &DisableJobInternalServerError{} -} - -/* DisableJobInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type DisableJobInternalServerError struct { - Payload *models.Error -} - -func (o *DisableJobInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/disable][%d] disableJobInternalServerError %+v", 500, o.Payload) -} -func (o *DisableJobInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableJobInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/enable_job_parameters.go b/client/jobs/enable_job_parameters.go deleted file mode 100644 index 04fa3cc..0000000 --- a/client/jobs/enable_job_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnableJobParams creates a new EnableJobParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnableJobParams() *EnableJobParams { - return &EnableJobParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnableJobParamsWithTimeout creates a new EnableJobParams object -// with the ability to set a timeout on a request. -func NewEnableJobParamsWithTimeout(timeout time.Duration) *EnableJobParams { - return &EnableJobParams{ - timeout: timeout, - } -} - -// NewEnableJobParamsWithContext creates a new EnableJobParams object -// with the ability to set a context for a request. -func NewEnableJobParamsWithContext(ctx context.Context) *EnableJobParams { - return &EnableJobParams{ - Context: ctx, - } -} - -// NewEnableJobParamsWithHTTPClient creates a new EnableJobParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnableJobParamsWithHTTPClient(client *http.Client) *EnableJobParams { - return &EnableJobParams{ - HTTPClient: client, - } -} - -/* EnableJobParams contains all the parameters to send to the API endpoint - for the enable job operation. - - Typically these are written to a http.Request. -*/ -type EnableJobParams struct { - - // ID. - // - // Format: uuid - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enable job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnableJobParams) WithDefaults() *EnableJobParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enable job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnableJobParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := EnableJobParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the enable job params -func (o *EnableJobParams) WithTimeout(timeout time.Duration) *EnableJobParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enable job params -func (o *EnableJobParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enable job params -func (o *EnableJobParams) WithContext(ctx context.Context) *EnableJobParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enable job params -func (o *EnableJobParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enable job params -func (o *EnableJobParams) WithHTTPClient(client *http.Client) *EnableJobParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enable job params -func (o *EnableJobParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the enable job params -func (o *EnableJobParams) WithID(id strfmt.UUID) *EnableJobParams { - o.SetID(id) - return o -} - -// SetID adds the id to the enable job params -func (o *EnableJobParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the enable job params -func (o *EnableJobParams) WithXAPIVersion(xAPIVersion string) *EnableJobParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the enable job params -func (o *EnableJobParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *EnableJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/enable_job_responses.go b/client/jobs/enable_job_responses.go deleted file mode 100644 index 2ce225a..0000000 --- a/client/jobs/enable_job_responses.go +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// EnableJobReader is a Reader for the EnableJob structure. -type EnableJobReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnableJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewEnableJobOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewEnableJobBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewEnableJobUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewEnableJobForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewEnableJobNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewEnableJobInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnableJobOK creates a EnableJobOK with default headers values -func NewEnableJobOK() *EnableJobOK { - return &EnableJobOK{} -} - -/* EnableJobOK describes a response with status code 200, with default header values. - -Job has been enabled. -*/ -type EnableJobOK struct { - Payload models.EmptySuccessResponse -} - -func (o *EnableJobOK) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/enable][%d] enableJobOK %+v", 200, o.Payload) -} -func (o *EnableJobOK) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *EnableJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableJobBadRequest creates a EnableJobBadRequest with default headers values -func NewEnableJobBadRequest() *EnableJobBadRequest { - return &EnableJobBadRequest{} -} - -/* EnableJobBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type EnableJobBadRequest struct { - Payload *models.Error -} - -func (o *EnableJobBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/enable][%d] enableJobBadRequest %+v", 400, o.Payload) -} -func (o *EnableJobBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableJobUnauthorized creates a EnableJobUnauthorized with default headers values -func NewEnableJobUnauthorized() *EnableJobUnauthorized { - return &EnableJobUnauthorized{} -} - -/* EnableJobUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type EnableJobUnauthorized struct { - Payload *models.Error -} - -func (o *EnableJobUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/enable][%d] enableJobUnauthorized %+v", 401, o.Payload) -} -func (o *EnableJobUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableJobForbidden creates a EnableJobForbidden with default headers values -func NewEnableJobForbidden() *EnableJobForbidden { - return &EnableJobForbidden{} -} - -/* EnableJobForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type EnableJobForbidden struct { - Payload *models.Error -} - -func (o *EnableJobForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/enable][%d] enableJobForbidden %+v", 403, o.Payload) -} -func (o *EnableJobForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableJobNotFound creates a EnableJobNotFound with default headers values -func NewEnableJobNotFound() *EnableJobNotFound { - return &EnableJobNotFound{} -} - -/* EnableJobNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type EnableJobNotFound struct { - Payload *models.Error -} - -func (o *EnableJobNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/enable][%d] enableJobNotFound %+v", 404, o.Payload) -} -func (o *EnableJobNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableJobInternalServerError creates a EnableJobInternalServerError with default headers values -func NewEnableJobInternalServerError() *EnableJobInternalServerError { - return &EnableJobInternalServerError{} -} - -/* EnableJobInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type EnableJobInternalServerError struct { - Payload *models.Error -} - -func (o *EnableJobInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/enable][%d] enableJobInternalServerError %+v", 500, o.Payload) -} -func (o *EnableJobInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableJobInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/get_all_jobs_parameters.go b/client/jobs/get_all_jobs_parameters.go deleted file mode 100644 index fe4b835..0000000 --- a/client/jobs/get_all_jobs_parameters.go +++ /dev/null @@ -1,373 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllJobsParams creates a new GetAllJobsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllJobsParams() *GetAllJobsParams { - return &GetAllJobsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllJobsParamsWithTimeout creates a new GetAllJobsParams object -// with the ability to set a timeout on a request. -func NewGetAllJobsParamsWithTimeout(timeout time.Duration) *GetAllJobsParams { - return &GetAllJobsParams{ - timeout: timeout, - } -} - -// NewGetAllJobsParamsWithContext creates a new GetAllJobsParams object -// with the ability to set a context for a request. -func NewGetAllJobsParamsWithContext(ctx context.Context) *GetAllJobsParams { - return &GetAllJobsParams{ - Context: ctx, - } -} - -// NewGetAllJobsParamsWithHTTPClient creates a new GetAllJobsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllJobsParamsWithHTTPClient(client *http.Client) *GetAllJobsParams { - return &GetAllJobsParams{ - HTTPClient: client, - } -} - -/* GetAllJobsParams contains all the parameters to send to the API endpoint - for the get all jobs operation. - - Typically these are written to a http.Request. -*/ -type GetAllJobsParams struct { - - /* Limit. - - Maximum number of jobs to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters jobs by the `nameFilter` pattern. The pattern can match any job parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts jobs in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts jobs by one of the job parameters. - */ - OrderColumn *string - - /* Skip. - - Number of jobs to skip. - - Format: int32 - */ - Skip *int32 - - /* TypeFilter. - - Filters jobs by job type. - */ - TypeFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all jobs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllJobsParams) WithDefaults() *GetAllJobsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all jobs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllJobsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllJobsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all jobs params -func (o *GetAllJobsParams) WithTimeout(timeout time.Duration) *GetAllJobsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all jobs params -func (o *GetAllJobsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all jobs params -func (o *GetAllJobsParams) WithContext(ctx context.Context) *GetAllJobsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all jobs params -func (o *GetAllJobsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all jobs params -func (o *GetAllJobsParams) WithHTTPClient(client *http.Client) *GetAllJobsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all jobs params -func (o *GetAllJobsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get all jobs params -func (o *GetAllJobsParams) WithLimit(limit *int32) *GetAllJobsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all jobs params -func (o *GetAllJobsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all jobs params -func (o *GetAllJobsParams) WithNameFilter(nameFilter *string) *GetAllJobsParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all jobs params -func (o *GetAllJobsParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all jobs params -func (o *GetAllJobsParams) WithOrderAsc(orderAsc *bool) *GetAllJobsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all jobs params -func (o *GetAllJobsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all jobs params -func (o *GetAllJobsParams) WithOrderColumn(orderColumn *string) *GetAllJobsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all jobs params -func (o *GetAllJobsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all jobs params -func (o *GetAllJobsParams) WithSkip(skip *int32) *GetAllJobsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all jobs params -func (o *GetAllJobsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithTypeFilter adds the typeFilter to the get all jobs params -func (o *GetAllJobsParams) WithTypeFilter(typeFilter *string) *GetAllJobsParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all jobs params -func (o *GetAllJobsParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all jobs params -func (o *GetAllJobsParams) WithXAPIVersion(xAPIVersion string) *GetAllJobsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all jobs params -func (o *GetAllJobsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/get_all_jobs_responses.go b/client/jobs/get_all_jobs_responses.go deleted file mode 100644 index 57045cf..0000000 --- a/client/jobs/get_all_jobs_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllJobsReader is a Reader for the GetAllJobs structure. -type GetAllJobsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllJobsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllJobsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllJobsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllJobsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllJobsOK creates a GetAllJobsOK with default headers values -func NewGetAllJobsOK() *GetAllJobsOK { - return &GetAllJobsOK{} -} - -/* GetAllJobsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllJobsOK struct { - Payload *models.JobsResult -} - -func (o *GetAllJobsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs][%d] getAllJobsOK %+v", 200, o.Payload) -} -func (o *GetAllJobsOK) GetPayload() *models.JobsResult { - return o.Payload -} - -func (o *GetAllJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllJobsUnauthorized creates a GetAllJobsUnauthorized with default headers values -func NewGetAllJobsUnauthorized() *GetAllJobsUnauthorized { - return &GetAllJobsUnauthorized{} -} - -/* GetAllJobsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllJobsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllJobsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs][%d] getAllJobsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllJobsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllJobsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllJobsForbidden creates a GetAllJobsForbidden with default headers values -func NewGetAllJobsForbidden() *GetAllJobsForbidden { - return &GetAllJobsForbidden{} -} - -/* GetAllJobsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllJobsForbidden struct { - Payload *models.Error -} - -func (o *GetAllJobsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs][%d] getAllJobsForbidden %+v", 403, o.Payload) -} -func (o *GetAllJobsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllJobsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllJobsInternalServerError creates a GetAllJobsInternalServerError with default headers values -func NewGetAllJobsInternalServerError() *GetAllJobsInternalServerError { - return &GetAllJobsInternalServerError{} -} - -/* GetAllJobsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllJobsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllJobsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs][%d] getAllJobsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllJobsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllJobsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/get_all_jobs_states_parameters.go b/client/jobs/get_all_jobs_states_parameters.go deleted file mode 100644 index 4e54d8d..0000000 --- a/client/jobs/get_all_jobs_states_parameters.go +++ /dev/null @@ -1,687 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllJobsStatesParams creates a new GetAllJobsStatesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllJobsStatesParams() *GetAllJobsStatesParams { - return &GetAllJobsStatesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllJobsStatesParamsWithTimeout creates a new GetAllJobsStatesParams object -// with the ability to set a timeout on a request. -func NewGetAllJobsStatesParamsWithTimeout(timeout time.Duration) *GetAllJobsStatesParams { - return &GetAllJobsStatesParams{ - timeout: timeout, - } -} - -// NewGetAllJobsStatesParamsWithContext creates a new GetAllJobsStatesParams object -// with the ability to set a context for a request. -func NewGetAllJobsStatesParamsWithContext(ctx context.Context) *GetAllJobsStatesParams { - return &GetAllJobsStatesParams{ - Context: ctx, - } -} - -// NewGetAllJobsStatesParamsWithHTTPClient creates a new GetAllJobsStatesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllJobsStatesParamsWithHTTPClient(client *http.Client) *GetAllJobsStatesParams { - return &GetAllJobsStatesParams{ - HTTPClient: client, - } -} - -/* GetAllJobsStatesParams contains all the parameters to send to the API endpoint - for the get all jobs states operation. - - Typically these are written to a http.Request. -*/ -type GetAllJobsStatesParams struct { - - /* IDFilter. - - Filters job states by job ID. - - Format: uuid - */ - IDFilter *strfmt.UUID - - /* IsHighPriorityJobFilter. - - If *true*, Returns job states for jobs with high priority. - */ - IsHighPriorityJobFilter *bool - - /* LastResultFilter. - - Filters job states by status with which jobs must finish. - */ - LastResultFilter *string - - /* LastRunAfterFilter. - - Returns job states for jobs that have run after the specified date and time. - - Format: date-time - */ - LastRunAfterFilter *strfmt.DateTime - - /* LastRunBeforeFilter. - - Returns job states for jobs that have not run after the specified date and time. - - Format: date-time - */ - LastRunBeforeFilter *strfmt.DateTime - - /* Limit. - - Maximum number of job states to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters job states by the `nameFilter` pattern. The pattern can match any state parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* ObjectsCountFilter. - - Filters job states by number of objects processed by the job. - */ - ObjectsCountFilter *int64 - - /* OrderAsc. - - Sorts job states in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts job states by one of the state parameters. - */ - OrderColumn *string - - /* RepositoryIDFilter. - - Filters job states by repository ID. - - Format: uuid - */ - RepositoryIDFilter *strfmt.UUID - - /* Skip. - - Number of job states to skip. - - Format: int32 - */ - Skip *int32 - - /* StatusFilter. - - Filters job states by current status of the job. - */ - StatusFilter *string - - /* TypeFilter. - - Filters job states by job type. - */ - TypeFilter *string - - /* WorkloadFilter. - - Filters job states by workloads that jobs must process. - */ - WorkloadFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all jobs states params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllJobsStatesParams) WithDefaults() *GetAllJobsStatesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all jobs states params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllJobsStatesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllJobsStatesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all jobs states params -func (o *GetAllJobsStatesParams) WithTimeout(timeout time.Duration) *GetAllJobsStatesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all jobs states params -func (o *GetAllJobsStatesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all jobs states params -func (o *GetAllJobsStatesParams) WithContext(ctx context.Context) *GetAllJobsStatesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all jobs states params -func (o *GetAllJobsStatesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all jobs states params -func (o *GetAllJobsStatesParams) WithHTTPClient(client *http.Client) *GetAllJobsStatesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all jobs states params -func (o *GetAllJobsStatesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIDFilter adds the iDFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithIDFilter(iDFilter *strfmt.UUID) *GetAllJobsStatesParams { - o.SetIDFilter(iDFilter) - return o -} - -// SetIDFilter adds the idFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetIDFilter(iDFilter *strfmt.UUID) { - o.IDFilter = iDFilter -} - -// WithIsHighPriorityJobFilter adds the isHighPriorityJobFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithIsHighPriorityJobFilter(isHighPriorityJobFilter *bool) *GetAllJobsStatesParams { - o.SetIsHighPriorityJobFilter(isHighPriorityJobFilter) - return o -} - -// SetIsHighPriorityJobFilter adds the isHighPriorityJobFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetIsHighPriorityJobFilter(isHighPriorityJobFilter *bool) { - o.IsHighPriorityJobFilter = isHighPriorityJobFilter -} - -// WithLastResultFilter adds the lastResultFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithLastResultFilter(lastResultFilter *string) *GetAllJobsStatesParams { - o.SetLastResultFilter(lastResultFilter) - return o -} - -// SetLastResultFilter adds the lastResultFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetLastResultFilter(lastResultFilter *string) { - o.LastResultFilter = lastResultFilter -} - -// WithLastRunAfterFilter adds the lastRunAfterFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithLastRunAfterFilter(lastRunAfterFilter *strfmt.DateTime) *GetAllJobsStatesParams { - o.SetLastRunAfterFilter(lastRunAfterFilter) - return o -} - -// SetLastRunAfterFilter adds the lastRunAfterFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetLastRunAfterFilter(lastRunAfterFilter *strfmt.DateTime) { - o.LastRunAfterFilter = lastRunAfterFilter -} - -// WithLastRunBeforeFilter adds the lastRunBeforeFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithLastRunBeforeFilter(lastRunBeforeFilter *strfmt.DateTime) *GetAllJobsStatesParams { - o.SetLastRunBeforeFilter(lastRunBeforeFilter) - return o -} - -// SetLastRunBeforeFilter adds the lastRunBeforeFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetLastRunBeforeFilter(lastRunBeforeFilter *strfmt.DateTime) { - o.LastRunBeforeFilter = lastRunBeforeFilter -} - -// WithLimit adds the limit to the get all jobs states params -func (o *GetAllJobsStatesParams) WithLimit(limit *int32) *GetAllJobsStatesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all jobs states params -func (o *GetAllJobsStatesParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithNameFilter(nameFilter *string) *GetAllJobsStatesParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithObjectsCountFilter adds the objectsCountFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithObjectsCountFilter(objectsCountFilter *int64) *GetAllJobsStatesParams { - o.SetObjectsCountFilter(objectsCountFilter) - return o -} - -// SetObjectsCountFilter adds the objectsCountFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetObjectsCountFilter(objectsCountFilter *int64) { - o.ObjectsCountFilter = objectsCountFilter -} - -// WithOrderAsc adds the orderAsc to the get all jobs states params -func (o *GetAllJobsStatesParams) WithOrderAsc(orderAsc *bool) *GetAllJobsStatesParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all jobs states params -func (o *GetAllJobsStatesParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all jobs states params -func (o *GetAllJobsStatesParams) WithOrderColumn(orderColumn *string) *GetAllJobsStatesParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all jobs states params -func (o *GetAllJobsStatesParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithRepositoryIDFilter adds the repositoryIDFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithRepositoryIDFilter(repositoryIDFilter *strfmt.UUID) *GetAllJobsStatesParams { - o.SetRepositoryIDFilter(repositoryIDFilter) - return o -} - -// SetRepositoryIDFilter adds the repositoryIdFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetRepositoryIDFilter(repositoryIDFilter *strfmt.UUID) { - o.RepositoryIDFilter = repositoryIDFilter -} - -// WithSkip adds the skip to the get all jobs states params -func (o *GetAllJobsStatesParams) WithSkip(skip *int32) *GetAllJobsStatesParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all jobs states params -func (o *GetAllJobsStatesParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithStatusFilter adds the statusFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithStatusFilter(statusFilter *string) *GetAllJobsStatesParams { - o.SetStatusFilter(statusFilter) - return o -} - -// SetStatusFilter adds the statusFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetStatusFilter(statusFilter *string) { - o.StatusFilter = statusFilter -} - -// WithTypeFilter adds the typeFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithTypeFilter(typeFilter *string) *GetAllJobsStatesParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithWorkloadFilter adds the workloadFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) WithWorkloadFilter(workloadFilter *string) *GetAllJobsStatesParams { - o.SetWorkloadFilter(workloadFilter) - return o -} - -// SetWorkloadFilter adds the workloadFilter to the get all jobs states params -func (o *GetAllJobsStatesParams) SetWorkloadFilter(workloadFilter *string) { - o.WorkloadFilter = workloadFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all jobs states params -func (o *GetAllJobsStatesParams) WithXAPIVersion(xAPIVersion string) *GetAllJobsStatesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all jobs states params -func (o *GetAllJobsStatesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllJobsStatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.IDFilter != nil { - - // query param idFilter - var qrIDFilter strfmt.UUID - - if o.IDFilter != nil { - qrIDFilter = *o.IDFilter - } - qIDFilter := qrIDFilter.String() - if qIDFilter != "" { - - if err := r.SetQueryParam("idFilter", qIDFilter); err != nil { - return err - } - } - } - - if o.IsHighPriorityJobFilter != nil { - - // query param isHighPriorityJobFilter - var qrIsHighPriorityJobFilter bool - - if o.IsHighPriorityJobFilter != nil { - qrIsHighPriorityJobFilter = *o.IsHighPriorityJobFilter - } - qIsHighPriorityJobFilter := swag.FormatBool(qrIsHighPriorityJobFilter) - if qIsHighPriorityJobFilter != "" { - - if err := r.SetQueryParam("isHighPriorityJobFilter", qIsHighPriorityJobFilter); err != nil { - return err - } - } - } - - if o.LastResultFilter != nil { - - // query param lastResultFilter - var qrLastResultFilter string - - if o.LastResultFilter != nil { - qrLastResultFilter = *o.LastResultFilter - } - qLastResultFilter := qrLastResultFilter - if qLastResultFilter != "" { - - if err := r.SetQueryParam("lastResultFilter", qLastResultFilter); err != nil { - return err - } - } - } - - if o.LastRunAfterFilter != nil { - - // query param lastRunAfterFilter - var qrLastRunAfterFilter strfmt.DateTime - - if o.LastRunAfterFilter != nil { - qrLastRunAfterFilter = *o.LastRunAfterFilter - } - qLastRunAfterFilter := qrLastRunAfterFilter.String() - if qLastRunAfterFilter != "" { - - if err := r.SetQueryParam("lastRunAfterFilter", qLastRunAfterFilter); err != nil { - return err - } - } - } - - if o.LastRunBeforeFilter != nil { - - // query param lastRunBeforeFilter - var qrLastRunBeforeFilter strfmt.DateTime - - if o.LastRunBeforeFilter != nil { - qrLastRunBeforeFilter = *o.LastRunBeforeFilter - } - qLastRunBeforeFilter := qrLastRunBeforeFilter.String() - if qLastRunBeforeFilter != "" { - - if err := r.SetQueryParam("lastRunBeforeFilter", qLastRunBeforeFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.ObjectsCountFilter != nil { - - // query param objectsCountFilter - var qrObjectsCountFilter int64 - - if o.ObjectsCountFilter != nil { - qrObjectsCountFilter = *o.ObjectsCountFilter - } - qObjectsCountFilter := swag.FormatInt64(qrObjectsCountFilter) - if qObjectsCountFilter != "" { - - if err := r.SetQueryParam("objectsCountFilter", qObjectsCountFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.RepositoryIDFilter != nil { - - // query param repositoryIdFilter - var qrRepositoryIDFilter strfmt.UUID - - if o.RepositoryIDFilter != nil { - qrRepositoryIDFilter = *o.RepositoryIDFilter - } - qRepositoryIDFilter := qrRepositoryIDFilter.String() - if qRepositoryIDFilter != "" { - - if err := r.SetQueryParam("repositoryIdFilter", qRepositoryIDFilter); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.StatusFilter != nil { - - // query param statusFilter - var qrStatusFilter string - - if o.StatusFilter != nil { - qrStatusFilter = *o.StatusFilter - } - qStatusFilter := qrStatusFilter - if qStatusFilter != "" { - - if err := r.SetQueryParam("statusFilter", qStatusFilter); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - if o.WorkloadFilter != nil { - - // query param workloadFilter - var qrWorkloadFilter string - - if o.WorkloadFilter != nil { - qrWorkloadFilter = *o.WorkloadFilter - } - qWorkloadFilter := qrWorkloadFilter - if qWorkloadFilter != "" { - - if err := r.SetQueryParam("workloadFilter", qWorkloadFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/get_all_jobs_states_responses.go b/client/jobs/get_all_jobs_states_responses.go deleted file mode 100644 index a3754e7..0000000 --- a/client/jobs/get_all_jobs_states_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllJobsStatesReader is a Reader for the GetAllJobsStates structure. -type GetAllJobsStatesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllJobsStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllJobsStatesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllJobsStatesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllJobsStatesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllJobsStatesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllJobsStatesOK creates a GetAllJobsStatesOK with default headers values -func NewGetAllJobsStatesOK() *GetAllJobsStatesOK { - return &GetAllJobsStatesOK{} -} - -/* GetAllJobsStatesOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllJobsStatesOK struct { - Payload *models.JobStatesResult -} - -func (o *GetAllJobsStatesOK) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/states][%d] getAllJobsStatesOK %+v", 200, o.Payload) -} -func (o *GetAllJobsStatesOK) GetPayload() *models.JobStatesResult { - return o.Payload -} - -func (o *GetAllJobsStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobStatesResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllJobsStatesUnauthorized creates a GetAllJobsStatesUnauthorized with default headers values -func NewGetAllJobsStatesUnauthorized() *GetAllJobsStatesUnauthorized { - return &GetAllJobsStatesUnauthorized{} -} - -/* GetAllJobsStatesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllJobsStatesUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllJobsStatesUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/states][%d] getAllJobsStatesUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllJobsStatesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllJobsStatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllJobsStatesForbidden creates a GetAllJobsStatesForbidden with default headers values -func NewGetAllJobsStatesForbidden() *GetAllJobsStatesForbidden { - return &GetAllJobsStatesForbidden{} -} - -/* GetAllJobsStatesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllJobsStatesForbidden struct { - Payload *models.Error -} - -func (o *GetAllJobsStatesForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/states][%d] getAllJobsStatesForbidden %+v", 403, o.Payload) -} -func (o *GetAllJobsStatesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllJobsStatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllJobsStatesInternalServerError creates a GetAllJobsStatesInternalServerError with default headers values -func NewGetAllJobsStatesInternalServerError() *GetAllJobsStatesInternalServerError { - return &GetAllJobsStatesInternalServerError{} -} - -/* GetAllJobsStatesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllJobsStatesInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllJobsStatesInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/states][%d] getAllJobsStatesInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllJobsStatesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllJobsStatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/get_job_parameters.go b/client/jobs/get_job_parameters.go deleted file mode 100644 index 50b7b39..0000000 --- a/client/jobs/get_job_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetJobParams creates a new GetJobParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetJobParams() *GetJobParams { - return &GetJobParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetJobParamsWithTimeout creates a new GetJobParams object -// with the ability to set a timeout on a request. -func NewGetJobParamsWithTimeout(timeout time.Duration) *GetJobParams { - return &GetJobParams{ - timeout: timeout, - } -} - -// NewGetJobParamsWithContext creates a new GetJobParams object -// with the ability to set a context for a request. -func NewGetJobParamsWithContext(ctx context.Context) *GetJobParams { - return &GetJobParams{ - Context: ctx, - } -} - -// NewGetJobParamsWithHTTPClient creates a new GetJobParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetJobParamsWithHTTPClient(client *http.Client) *GetJobParams { - return &GetJobParams{ - HTTPClient: client, - } -} - -/* GetJobParams contains all the parameters to send to the API endpoint - for the get job operation. - - Typically these are written to a http.Request. -*/ -type GetJobParams struct { - - // ID. - // - // Format: uuid - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJobParams) WithDefaults() *GetJobParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJobParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetJobParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get job params -func (o *GetJobParams) WithTimeout(timeout time.Duration) *GetJobParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get job params -func (o *GetJobParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get job params -func (o *GetJobParams) WithContext(ctx context.Context) *GetJobParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get job params -func (o *GetJobParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get job params -func (o *GetJobParams) WithHTTPClient(client *http.Client) *GetJobParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get job params -func (o *GetJobParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get job params -func (o *GetJobParams) WithID(id strfmt.UUID) *GetJobParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get job params -func (o *GetJobParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get job params -func (o *GetJobParams) WithXAPIVersion(xAPIVersion string) *GetJobParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get job params -func (o *GetJobParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/get_job_responses.go b/client/jobs/get_job_responses.go deleted file mode 100644 index 5737969..0000000 --- a/client/jobs/get_job_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetJobReader is a Reader for the GetJob structure. -type GetJobReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetJobOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetJobUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetJobForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetJobNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetJobInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetJobOK creates a GetJobOK with default headers values -func NewGetJobOK() *GetJobOK { - return &GetJobOK{} -} - -/* GetJobOK describes a response with status code 200, with default header values. - -OK -*/ -type GetJobOK struct { - Payload *models.JobModel -} - -func (o *GetJobOK) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/{id}][%d] getJobOK %+v", 200, o.Payload) -} -func (o *GetJobOK) GetPayload() *models.JobModel { - return o.Payload -} - -func (o *GetJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetJobUnauthorized creates a GetJobUnauthorized with default headers values -func NewGetJobUnauthorized() *GetJobUnauthorized { - return &GetJobUnauthorized{} -} - -/* GetJobUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetJobUnauthorized struct { - Payload *models.Error -} - -func (o *GetJobUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/{id}][%d] getJobUnauthorized %+v", 401, o.Payload) -} -func (o *GetJobUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetJobForbidden creates a GetJobForbidden with default headers values -func NewGetJobForbidden() *GetJobForbidden { - return &GetJobForbidden{} -} - -/* GetJobForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetJobForbidden struct { - Payload *models.Error -} - -func (o *GetJobForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/{id}][%d] getJobForbidden %+v", 403, o.Payload) -} -func (o *GetJobForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetJobNotFound creates a GetJobNotFound with default headers values -func NewGetJobNotFound() *GetJobNotFound { - return &GetJobNotFound{} -} - -/* GetJobNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetJobNotFound struct { - Payload *models.Error -} - -func (o *GetJobNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/{id}][%d] getJobNotFound %+v", 404, o.Payload) -} -func (o *GetJobNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetJobInternalServerError creates a GetJobInternalServerError with default headers values -func NewGetJobInternalServerError() *GetJobInternalServerError { - return &GetJobInternalServerError{} -} - -/* GetJobInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetJobInternalServerError struct { - Payload *models.Error -} - -func (o *GetJobInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/jobs/{id}][%d] getJobInternalServerError %+v", 500, o.Payload) -} -func (o *GetJobInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetJobInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/jobs_client.go b/client/jobs/jobs_client.go deleted file mode 100644 index 76a820a..0000000 --- a/client/jobs/jobs_client.go +++ /dev/null @@ -1,469 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new jobs API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for jobs API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateJob(params *CreateJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateJobCreated, error) - - DeleteJob(params *DeleteJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteJobNoContent, error) - - DisableJob(params *DisableJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableJobOK, error) - - EnableJob(params *EnableJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableJobOK, error) - - GetAllJobs(params *GetAllJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllJobsOK, error) - - GetAllJobsStates(params *GetAllJobsStatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllJobsStatesOK, error) - - GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobOK, error) - - StartJob(params *StartJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartJobCreated, error) - - StopJob(params *StopJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopJobCreated, error) - - UpdateJob(params *UpdateJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateJobOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateJob creates job - - The HTTP POST request to the `/api/v1/jobs` path allows you to create a new job that has the specified parameters. -*/ -func (a *Client) CreateJob(params *CreateJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateJobCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateJobParams() - } - op := &runtime.ClientOperation{ - ID: "CreateJob", - Method: "POST", - PathPattern: "/api/v1/jobs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateJobReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateJobCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteJob deletes job - - The HTTP DELETE request to the `/api/v1/jobs/{id}` path allows you to delete a job that has the specified `id`. -*/ -func (a *Client) DeleteJob(params *DeleteJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteJobNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteJobParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteJob", - Method: "DELETE", - PathPattern: "/api/v1/jobs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteJobReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteJobNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DisableJob disables job - - The HTTP POST request to the `/api/v1/jobs/{id}/disable` path allows you to disable a job that has the specified `id`. -*/ -func (a *Client) DisableJob(params *DisableJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableJobOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDisableJobParams() - } - op := &runtime.ClientOperation{ - ID: "DisableJob", - Method: "POST", - PathPattern: "/api/v1/jobs/{id}/disable", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DisableJobReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DisableJobOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DisableJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnableJob enables job - - The HTTP POST request to the `/api/v1/jobs/{id}/enable` path allows you to enable a job that has the specified `id`. -*/ -func (a *Client) EnableJob(params *EnableJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableJobOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnableJobParams() - } - op := &runtime.ClientOperation{ - ID: "EnableJob", - Method: "POST", - PathPattern: "/api/v1/jobs/{id}/enable", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &EnableJobReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnableJobOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for EnableJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllJobs gets all jobs - - The HTTP GET request to the `/api/v1/jobs` path allows you to get an array of all jobs coordinated by the backup server. -*/ -func (a *Client) GetAllJobs(params *GetAllJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllJobsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllJobsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllJobs", - Method: "GET", - PathPattern: "/api/v1/jobs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllJobsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllJobsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllJobsStates gets all job states - - The HTTP GET request to the `/api/v1/jobs/states` path allows you to get an array of all job states. The states include brief job information that you can also find under the **Jobs** node in the Veeam Backup & Replication console. -*/ -func (a *Client) GetAllJobsStates(params *GetAllJobsStatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllJobsStatesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllJobsStatesParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllJobsStates", - Method: "GET", - PathPattern: "/api/v1/jobs/states", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllJobsStatesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllJobsStatesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllJobsStates: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetJob gets job - - The HTTP GET request to the `/api/v1/jobs/{id}` path allows you to get a job that has the specified `id`. -*/ -func (a *Client) GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetJobOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetJobParams() - } - op := &runtime.ClientOperation{ - ID: "GetJob", - Method: "GET", - PathPattern: "/api/v1/jobs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetJobReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetJobOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - StartJob starts job - - The HTTP POST request to the `/api/v1/jobs/{id}/start` path allows you to start a job that has the specified `id`. -*/ -func (a *Client) StartJob(params *StartJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StartJobCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewStartJobParams() - } - op := &runtime.ClientOperation{ - ID: "StartJob", - Method: "POST", - PathPattern: "/api/v1/jobs/{id}/start", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &StartJobReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*StartJobCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for StartJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - StopJob stops job - - The HTTP POST request to the `/api/v1/jobs/{id}/stop` path allows you to stop a job that has the specified `id`. -*/ -func (a *Client) StopJob(params *StopJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopJobCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewStopJobParams() - } - op := &runtime.ClientOperation{ - ID: "StopJob", - Method: "POST", - PathPattern: "/api/v1/jobs/{id}/stop", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &StopJobReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*StopJobCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for StopJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateJob edits job - - The HTTP PUT request to the `/api/v1/jobs/{id}` path allows you to edit a job that has the specified `id`. -*/ -func (a *Client) UpdateJob(params *UpdateJobParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateJobOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateJobParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateJob", - Method: "PUT", - PathPattern: "/api/v1/jobs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateJobReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateJobOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateJob: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/jobs/start_job_parameters.go b/client/jobs/start_job_parameters.go deleted file mode 100644 index fcbda8d..0000000 --- a/client/jobs/start_job_parameters.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewStartJobParams creates a new StartJobParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewStartJobParams() *StartJobParams { - return &StartJobParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStartJobParamsWithTimeout creates a new StartJobParams object -// with the ability to set a timeout on a request. -func NewStartJobParamsWithTimeout(timeout time.Duration) *StartJobParams { - return &StartJobParams{ - timeout: timeout, - } -} - -// NewStartJobParamsWithContext creates a new StartJobParams object -// with the ability to set a context for a request. -func NewStartJobParamsWithContext(ctx context.Context) *StartJobParams { - return &StartJobParams{ - Context: ctx, - } -} - -// NewStartJobParamsWithHTTPClient creates a new StartJobParams object -// with the ability to set a custom HTTPClient for a request. -func NewStartJobParamsWithHTTPClient(client *http.Client) *StartJobParams { - return &StartJobParams{ - HTTPClient: client, - } -} - -/* StartJobParams contains all the parameters to send to the API endpoint - for the start job operation. - - Typically these are written to a http.Request. -*/ -type StartJobParams struct { - - // Body. - Body *models.JobStartSpec - - // ID. - // - // Format: uuid - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the start job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartJobParams) WithDefaults() *StartJobParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the start job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StartJobParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := StartJobParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the start job params -func (o *StartJobParams) WithTimeout(timeout time.Duration) *StartJobParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the start job params -func (o *StartJobParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the start job params -func (o *StartJobParams) WithContext(ctx context.Context) *StartJobParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the start job params -func (o *StartJobParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the start job params -func (o *StartJobParams) WithHTTPClient(client *http.Client) *StartJobParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the start job params -func (o *StartJobParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the start job params -func (o *StartJobParams) WithBody(body *models.JobStartSpec) *StartJobParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the start job params -func (o *StartJobParams) SetBody(body *models.JobStartSpec) { - o.Body = body -} - -// WithID adds the id to the start job params -func (o *StartJobParams) WithID(id strfmt.UUID) *StartJobParams { - o.SetID(id) - return o -} - -// SetID adds the id to the start job params -func (o *StartJobParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the start job params -func (o *StartJobParams) WithXAPIVersion(xAPIVersion string) *StartJobParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the start job params -func (o *StartJobParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *StartJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/start_job_responses.go b/client/jobs/start_job_responses.go deleted file mode 100644 index f96ba38..0000000 --- a/client/jobs/start_job_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// StartJobReader is a Reader for the StartJob structure. -type StartJobReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StartJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewStartJobCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewStartJobBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewStartJobUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewStartJobForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewStartJobNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewStartJobInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewStartJobCreated creates a StartJobCreated with default headers values -func NewStartJobCreated() *StartJobCreated { - return &StartJobCreated{} -} - -/* StartJobCreated describes a response with status code 201, with default header values. - -Job session has been started. -*/ -type StartJobCreated struct { - Payload *models.SessionModel -} - -func (o *StartJobCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/start][%d] startJobCreated %+v", 201, o.Payload) -} -func (o *StartJobCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *StartJobCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartJobBadRequest creates a StartJobBadRequest with default headers values -func NewStartJobBadRequest() *StartJobBadRequest { - return &StartJobBadRequest{} -} - -/* StartJobBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type StartJobBadRequest struct { - Payload *models.Error -} - -func (o *StartJobBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/start][%d] startJobBadRequest %+v", 400, o.Payload) -} -func (o *StartJobBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartJobUnauthorized creates a StartJobUnauthorized with default headers values -func NewStartJobUnauthorized() *StartJobUnauthorized { - return &StartJobUnauthorized{} -} - -/* StartJobUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type StartJobUnauthorized struct { - Payload *models.Error -} - -func (o *StartJobUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/start][%d] startJobUnauthorized %+v", 401, o.Payload) -} -func (o *StartJobUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartJobForbidden creates a StartJobForbidden with default headers values -func NewStartJobForbidden() *StartJobForbidden { - return &StartJobForbidden{} -} - -/* StartJobForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type StartJobForbidden struct { - Payload *models.Error -} - -func (o *StartJobForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/start][%d] startJobForbidden %+v", 403, o.Payload) -} -func (o *StartJobForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartJobNotFound creates a StartJobNotFound with default headers values -func NewStartJobNotFound() *StartJobNotFound { - return &StartJobNotFound{} -} - -/* StartJobNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type StartJobNotFound struct { - Payload *models.Error -} - -func (o *StartJobNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/start][%d] startJobNotFound %+v", 404, o.Payload) -} -func (o *StartJobNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStartJobInternalServerError creates a StartJobInternalServerError with default headers values -func NewStartJobInternalServerError() *StartJobInternalServerError { - return &StartJobInternalServerError{} -} - -/* StartJobInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type StartJobInternalServerError struct { - Payload *models.Error -} - -func (o *StartJobInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/start][%d] startJobInternalServerError %+v", 500, o.Payload) -} -func (o *StartJobInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *StartJobInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/stop_job_parameters.go b/client/jobs/stop_job_parameters.go deleted file mode 100644 index 662772a..0000000 --- a/client/jobs/stop_job_parameters.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewStopJobParams creates a new StopJobParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewStopJobParams() *StopJobParams { - return &StopJobParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStopJobParamsWithTimeout creates a new StopJobParams object -// with the ability to set a timeout on a request. -func NewStopJobParamsWithTimeout(timeout time.Duration) *StopJobParams { - return &StopJobParams{ - timeout: timeout, - } -} - -// NewStopJobParamsWithContext creates a new StopJobParams object -// with the ability to set a context for a request. -func NewStopJobParamsWithContext(ctx context.Context) *StopJobParams { - return &StopJobParams{ - Context: ctx, - } -} - -// NewStopJobParamsWithHTTPClient creates a new StopJobParams object -// with the ability to set a custom HTTPClient for a request. -func NewStopJobParamsWithHTTPClient(client *http.Client) *StopJobParams { - return &StopJobParams{ - HTTPClient: client, - } -} - -/* StopJobParams contains all the parameters to send to the API endpoint - for the stop job operation. - - Typically these are written to a http.Request. -*/ -type StopJobParams struct { - - // Body. - Body *models.JobStopSpec - - // ID. - // - // Format: uuid - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the stop job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StopJobParams) WithDefaults() *StopJobParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the stop job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StopJobParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := StopJobParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the stop job params -func (o *StopJobParams) WithTimeout(timeout time.Duration) *StopJobParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the stop job params -func (o *StopJobParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the stop job params -func (o *StopJobParams) WithContext(ctx context.Context) *StopJobParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the stop job params -func (o *StopJobParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the stop job params -func (o *StopJobParams) WithHTTPClient(client *http.Client) *StopJobParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the stop job params -func (o *StopJobParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the stop job params -func (o *StopJobParams) WithBody(body *models.JobStopSpec) *StopJobParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the stop job params -func (o *StopJobParams) SetBody(body *models.JobStopSpec) { - o.Body = body -} - -// WithID adds the id to the stop job params -func (o *StopJobParams) WithID(id strfmt.UUID) *StopJobParams { - o.SetID(id) - return o -} - -// SetID adds the id to the stop job params -func (o *StopJobParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the stop job params -func (o *StopJobParams) WithXAPIVersion(xAPIVersion string) *StopJobParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the stop job params -func (o *StopJobParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *StopJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/stop_job_responses.go b/client/jobs/stop_job_responses.go deleted file mode 100644 index da90cd6..0000000 --- a/client/jobs/stop_job_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// StopJobReader is a Reader for the StopJob structure. -type StopJobReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StopJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewStopJobCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewStopJobBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewStopJobUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewStopJobForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewStopJobNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewStopJobInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewStopJobCreated creates a StopJobCreated with default headers values -func NewStopJobCreated() *StopJobCreated { - return &StopJobCreated{} -} - -/* StopJobCreated describes a response with status code 201, with default header values. - -Job session has been stopped. -*/ -type StopJobCreated struct { - Payload *models.SessionModel -} - -func (o *StopJobCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/stop][%d] stopJobCreated %+v", 201, o.Payload) -} -func (o *StopJobCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *StopJobCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopJobBadRequest creates a StopJobBadRequest with default headers values -func NewStopJobBadRequest() *StopJobBadRequest { - return &StopJobBadRequest{} -} - -/* StopJobBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type StopJobBadRequest struct { - Payload *models.Error -} - -func (o *StopJobBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/stop][%d] stopJobBadRequest %+v", 400, o.Payload) -} -func (o *StopJobBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopJobUnauthorized creates a StopJobUnauthorized with default headers values -func NewStopJobUnauthorized() *StopJobUnauthorized { - return &StopJobUnauthorized{} -} - -/* StopJobUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type StopJobUnauthorized struct { - Payload *models.Error -} - -func (o *StopJobUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/stop][%d] stopJobUnauthorized %+v", 401, o.Payload) -} -func (o *StopJobUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopJobForbidden creates a StopJobForbidden with default headers values -func NewStopJobForbidden() *StopJobForbidden { - return &StopJobForbidden{} -} - -/* StopJobForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type StopJobForbidden struct { - Payload *models.Error -} - -func (o *StopJobForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/stop][%d] stopJobForbidden %+v", 403, o.Payload) -} -func (o *StopJobForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopJobNotFound creates a StopJobNotFound with default headers values -func NewStopJobNotFound() *StopJobNotFound { - return &StopJobNotFound{} -} - -/* StopJobNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type StopJobNotFound struct { - Payload *models.Error -} - -func (o *StopJobNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/stop][%d] stopJobNotFound %+v", 404, o.Payload) -} -func (o *StopJobNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopJobInternalServerError creates a StopJobInternalServerError with default headers values -func NewStopJobInternalServerError() *StopJobInternalServerError { - return &StopJobInternalServerError{} -} - -/* StopJobInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type StopJobInternalServerError struct { - Payload *models.Error -} - -func (o *StopJobInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/jobs/{id}/stop][%d] stopJobInternalServerError %+v", 500, o.Payload) -} -func (o *StopJobInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopJobInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/jobs/update_job_parameters.go b/client/jobs/update_job_parameters.go deleted file mode 100644 index 22de9ec..0000000 --- a/client/jobs/update_job_parameters.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateJobParams creates a new UpdateJobParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateJobParams() *UpdateJobParams { - return &UpdateJobParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateJobParamsWithTimeout creates a new UpdateJobParams object -// with the ability to set a timeout on a request. -func NewUpdateJobParamsWithTimeout(timeout time.Duration) *UpdateJobParams { - return &UpdateJobParams{ - timeout: timeout, - } -} - -// NewUpdateJobParamsWithContext creates a new UpdateJobParams object -// with the ability to set a context for a request. -func NewUpdateJobParamsWithContext(ctx context.Context) *UpdateJobParams { - return &UpdateJobParams{ - Context: ctx, - } -} - -// NewUpdateJobParamsWithHTTPClient creates a new UpdateJobParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateJobParamsWithHTTPClient(client *http.Client) *UpdateJobParams { - return &UpdateJobParams{ - HTTPClient: client, - } -} - -/* UpdateJobParams contains all the parameters to send to the API endpoint - for the update job operation. - - Typically these are written to a http.Request. -*/ -type UpdateJobParams struct { - - // Body. - Body *models.JobModel - - // ID. - // - // Format: uuid - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJobParams) WithDefaults() *UpdateJobParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update job params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJobParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateJobParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update job params -func (o *UpdateJobParams) WithTimeout(timeout time.Duration) *UpdateJobParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update job params -func (o *UpdateJobParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update job params -func (o *UpdateJobParams) WithContext(ctx context.Context) *UpdateJobParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update job params -func (o *UpdateJobParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update job params -func (o *UpdateJobParams) WithHTTPClient(client *http.Client) *UpdateJobParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update job params -func (o *UpdateJobParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update job params -func (o *UpdateJobParams) WithBody(body *models.JobModel) *UpdateJobParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update job params -func (o *UpdateJobParams) SetBody(body *models.JobModel) { - o.Body = body -} - -// WithID adds the id to the update job params -func (o *UpdateJobParams) WithID(id strfmt.UUID) *UpdateJobParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update job params -func (o *UpdateJobParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the update job params -func (o *UpdateJobParams) WithXAPIVersion(xAPIVersion string) *UpdateJobParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update job params -func (o *UpdateJobParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateJobParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/jobs/update_job_responses.go b/client/jobs/update_job_responses.go deleted file mode 100644 index 2a10fb6..0000000 --- a/client/jobs/update_job_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package jobs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateJobReader is a Reader for the UpdateJob structure. -type UpdateJobReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateJobReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateJobOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateJobBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateJobUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateJobForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateJobNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateJobInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateJobOK creates a UpdateJobOK with default headers values -func NewUpdateJobOK() *UpdateJobOK { - return &UpdateJobOK{} -} - -/* UpdateJobOK describes a response with status code 200, with default header values. - -Job has been updated. -*/ -type UpdateJobOK struct { - Payload *models.JobModel -} - -func (o *UpdateJobOK) Error() string { - return fmt.Sprintf("[PUT /api/v1/jobs/{id}][%d] updateJobOK %+v", 200, o.Payload) -} -func (o *UpdateJobOK) GetPayload() *models.JobModel { - return o.Payload -} - -func (o *UpdateJobOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JobModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateJobBadRequest creates a UpdateJobBadRequest with default headers values -func NewUpdateJobBadRequest() *UpdateJobBadRequest { - return &UpdateJobBadRequest{} -} - -/* UpdateJobBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateJobBadRequest struct { - Payload *models.Error -} - -func (o *UpdateJobBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/jobs/{id}][%d] updateJobBadRequest %+v", 400, o.Payload) -} -func (o *UpdateJobBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateJobBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateJobUnauthorized creates a UpdateJobUnauthorized with default headers values -func NewUpdateJobUnauthorized() *UpdateJobUnauthorized { - return &UpdateJobUnauthorized{} -} - -/* UpdateJobUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateJobUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateJobUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/jobs/{id}][%d] updateJobUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateJobUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateJobUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateJobForbidden creates a UpdateJobForbidden with default headers values -func NewUpdateJobForbidden() *UpdateJobForbidden { - return &UpdateJobForbidden{} -} - -/* UpdateJobForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateJobForbidden struct { - Payload *models.Error -} - -func (o *UpdateJobForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/jobs/{id}][%d] updateJobForbidden %+v", 403, o.Payload) -} -func (o *UpdateJobForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateJobForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateJobNotFound creates a UpdateJobNotFound with default headers values -func NewUpdateJobNotFound() *UpdateJobNotFound { - return &UpdateJobNotFound{} -} - -/* UpdateJobNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type UpdateJobNotFound struct { - Payload *models.Error -} - -func (o *UpdateJobNotFound) Error() string { - return fmt.Sprintf("[PUT /api/v1/jobs/{id}][%d] updateJobNotFound %+v", 404, o.Payload) -} -func (o *UpdateJobNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateJobNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateJobInternalServerError creates a UpdateJobInternalServerError with default headers values -func NewUpdateJobInternalServerError() *UpdateJobInternalServerError { - return &UpdateJobInternalServerError{} -} - -/* UpdateJobInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateJobInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateJobInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/jobs/{id}][%d] updateJobInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateJobInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateJobInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/login/create_authorization_code_parameters.go b/client/login/create_authorization_code_parameters.go deleted file mode 100644 index 118520e..0000000 --- a/client/login/create_authorization_code_parameters.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package login - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCreateAuthorizationCodeParams creates a new CreateAuthorizationCodeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateAuthorizationCodeParams() *CreateAuthorizationCodeParams { - return &CreateAuthorizationCodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateAuthorizationCodeParamsWithTimeout creates a new CreateAuthorizationCodeParams object -// with the ability to set a timeout on a request. -func NewCreateAuthorizationCodeParamsWithTimeout(timeout time.Duration) *CreateAuthorizationCodeParams { - return &CreateAuthorizationCodeParams{ - timeout: timeout, - } -} - -// NewCreateAuthorizationCodeParamsWithContext creates a new CreateAuthorizationCodeParams object -// with the ability to set a context for a request. -func NewCreateAuthorizationCodeParamsWithContext(ctx context.Context) *CreateAuthorizationCodeParams { - return &CreateAuthorizationCodeParams{ - Context: ctx, - } -} - -// NewCreateAuthorizationCodeParamsWithHTTPClient creates a new CreateAuthorizationCodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateAuthorizationCodeParamsWithHTTPClient(client *http.Client) *CreateAuthorizationCodeParams { - return &CreateAuthorizationCodeParams{ - HTTPClient: client, - } -} - -/* CreateAuthorizationCodeParams contains all the parameters to send to the API endpoint - for the create authorization code operation. - - Typically these are written to a http.Request. -*/ -type CreateAuthorizationCodeParams struct { - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create authorization code params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateAuthorizationCodeParams) WithDefaults() *CreateAuthorizationCodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create authorization code params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateAuthorizationCodeParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := CreateAuthorizationCodeParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create authorization code params -func (o *CreateAuthorizationCodeParams) WithTimeout(timeout time.Duration) *CreateAuthorizationCodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create authorization code params -func (o *CreateAuthorizationCodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create authorization code params -func (o *CreateAuthorizationCodeParams) WithContext(ctx context.Context) *CreateAuthorizationCodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create authorization code params -func (o *CreateAuthorizationCodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create authorization code params -func (o *CreateAuthorizationCodeParams) WithHTTPClient(client *http.Client) *CreateAuthorizationCodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create authorization code params -func (o *CreateAuthorizationCodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXAPIVersion adds the xAPIVersion to the create authorization code params -func (o *CreateAuthorizationCodeParams) WithXAPIVersion(xAPIVersion string) *CreateAuthorizationCodeParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the create authorization code params -func (o *CreateAuthorizationCodeParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateAuthorizationCodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/login/create_authorization_code_responses.go b/client/login/create_authorization_code_responses.go deleted file mode 100644 index 07f88f4..0000000 --- a/client/login/create_authorization_code_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package login - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// CreateAuthorizationCodeReader is a Reader for the CreateAuthorizationCode structure. -type CreateAuthorizationCodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateAuthorizationCodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateAuthorizationCodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewCreateAuthorizationCodeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateAuthorizationCodeForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateAuthorizationCodeInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateAuthorizationCodeOK creates a CreateAuthorizationCodeOK with default headers values -func NewCreateAuthorizationCodeOK() *CreateAuthorizationCodeOK { - return &CreateAuthorizationCodeOK{} -} - -/* CreateAuthorizationCodeOK describes a response with status code 200, with default header values. - -OK -*/ -type CreateAuthorizationCodeOK struct { - Payload *models.AuthorizationCodeModel -} - -func (o *CreateAuthorizationCodeOK) Error() string { - return fmt.Sprintf("[POST /api/oauth2/authorization_code][%d] createAuthorizationCodeOK %+v", 200, o.Payload) -} -func (o *CreateAuthorizationCodeOK) GetPayload() *models.AuthorizationCodeModel { - return o.Payload -} - -func (o *CreateAuthorizationCodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.AuthorizationCodeModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateAuthorizationCodeUnauthorized creates a CreateAuthorizationCodeUnauthorized with default headers values -func NewCreateAuthorizationCodeUnauthorized() *CreateAuthorizationCodeUnauthorized { - return &CreateAuthorizationCodeUnauthorized{} -} - -/* CreateAuthorizationCodeUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type CreateAuthorizationCodeUnauthorized struct { - Payload *models.Error -} - -func (o *CreateAuthorizationCodeUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/oauth2/authorization_code][%d] createAuthorizationCodeUnauthorized %+v", 401, o.Payload) -} -func (o *CreateAuthorizationCodeUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateAuthorizationCodeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateAuthorizationCodeForbidden creates a CreateAuthorizationCodeForbidden with default headers values -func NewCreateAuthorizationCodeForbidden() *CreateAuthorizationCodeForbidden { - return &CreateAuthorizationCodeForbidden{} -} - -/* CreateAuthorizationCodeForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type CreateAuthorizationCodeForbidden struct { - Payload *models.Error -} - -func (o *CreateAuthorizationCodeForbidden) Error() string { - return fmt.Sprintf("[POST /api/oauth2/authorization_code][%d] createAuthorizationCodeForbidden %+v", 403, o.Payload) -} -func (o *CreateAuthorizationCodeForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateAuthorizationCodeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateAuthorizationCodeInternalServerError creates a CreateAuthorizationCodeInternalServerError with default headers values -func NewCreateAuthorizationCodeInternalServerError() *CreateAuthorizationCodeInternalServerError { - return &CreateAuthorizationCodeInternalServerError{} -} - -/* CreateAuthorizationCodeInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type CreateAuthorizationCodeInternalServerError struct { - Payload *models.Error -} - -func (o *CreateAuthorizationCodeInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/oauth2/authorization_code][%d] createAuthorizationCodeInternalServerError %+v", 500, o.Payload) -} -func (o *CreateAuthorizationCodeInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateAuthorizationCodeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/login/create_token_parameters.go b/client/login/create_token_parameters.go deleted file mode 100644 index 9dfd275..0000000 --- a/client/login/create_token_parameters.go +++ /dev/null @@ -1,364 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package login - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewCreateTokenParams creates a new CreateTokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateTokenParams() *CreateTokenParams { - return &CreateTokenParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateTokenParamsWithTimeout creates a new CreateTokenParams object -// with the ability to set a timeout on a request. -func NewCreateTokenParamsWithTimeout(timeout time.Duration) *CreateTokenParams { - return &CreateTokenParams{ - timeout: timeout, - } -} - -// NewCreateTokenParamsWithContext creates a new CreateTokenParams object -// with the ability to set a context for a request. -func NewCreateTokenParamsWithContext(ctx context.Context) *CreateTokenParams { - return &CreateTokenParams{ - Context: ctx, - } -} - -// NewCreateTokenParamsWithHTTPClient creates a new CreateTokenParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateTokenParamsWithHTTPClient(client *http.Client) *CreateTokenParams { - return &CreateTokenParams{ - HTTPClient: client, - } -} - -/* CreateTokenParams contains all the parameters to send to the API endpoint - for the create token operation. - - Typically these are written to a http.Request. -*/ -type CreateTokenParams struct { - - /* Code. - - Authorization code. Required if the `grant_type` value is `authorization_code`. - */ - Code *string - - /* GrantType. - - Authorization grant type. - - Available values: - - `password` — used to obtain an access token by providing a user name and password. - - `refresh_token` — used to refresh an expired or lost access token by providing a refresh token. - - `authorization_code` — used to obtain an access token by providing an authorization code. - - - Default: "password" - */ - GrantType string - - /* Password. - - Password. Required if the `grant_type` value is `password`. - - Format: password - */ - Password *strfmt.Password - - /* RefreshToken. - - Refresh token. Required if the `grant_type` value is `refresh_token`. - */ - RefreshToken *string - - /* UseShortTermRefresh. - - If *true*, a short-term refresh token is used. Lifetime of the short-term refresh token is the access token lifetime plus 15 minutes. - */ - UseShortTermRefresh *bool - - /* Username. - - User name. Required if the `grant_type` value is `password`. - */ - Username *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateTokenParams) WithDefaults() *CreateTokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateTokenParams) SetDefaults() { - var ( - grantTypeDefault = string("password") - - xAPIVersionDefault = string("1.0-rev1") - ) - - val := CreateTokenParams{ - GrantType: grantTypeDefault, - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create token params -func (o *CreateTokenParams) WithTimeout(timeout time.Duration) *CreateTokenParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create token params -func (o *CreateTokenParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create token params -func (o *CreateTokenParams) WithContext(ctx context.Context) *CreateTokenParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create token params -func (o *CreateTokenParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create token params -func (o *CreateTokenParams) WithHTTPClient(client *http.Client) *CreateTokenParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create token params -func (o *CreateTokenParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCode adds the code to the create token params -func (o *CreateTokenParams) WithCode(code *string) *CreateTokenParams { - o.SetCode(code) - return o -} - -// SetCode adds the code to the create token params -func (o *CreateTokenParams) SetCode(code *string) { - o.Code = code -} - -// WithGrantType adds the grantType to the create token params -func (o *CreateTokenParams) WithGrantType(grantType string) *CreateTokenParams { - o.SetGrantType(grantType) - return o -} - -// SetGrantType adds the grantType to the create token params -func (o *CreateTokenParams) SetGrantType(grantType string) { - o.GrantType = grantType -} - -// WithPassword adds the password to the create token params -func (o *CreateTokenParams) WithPassword(password *strfmt.Password) *CreateTokenParams { - o.SetPassword(password) - return o -} - -// SetPassword adds the password to the create token params -func (o *CreateTokenParams) SetPassword(password *strfmt.Password) { - o.Password = password -} - -// WithRefreshToken adds the refreshToken to the create token params -func (o *CreateTokenParams) WithRefreshToken(refreshToken *string) *CreateTokenParams { - o.SetRefreshToken(refreshToken) - return o -} - -// SetRefreshToken adds the refreshToken to the create token params -func (o *CreateTokenParams) SetRefreshToken(refreshToken *string) { - o.RefreshToken = refreshToken -} - -// WithUseShortTermRefresh adds the useShortTermRefresh to the create token params -func (o *CreateTokenParams) WithUseShortTermRefresh(useShortTermRefresh *bool) *CreateTokenParams { - o.SetUseShortTermRefresh(useShortTermRefresh) - return o -} - -// SetUseShortTermRefresh adds the useShortTermRefresh to the create token params -func (o *CreateTokenParams) SetUseShortTermRefresh(useShortTermRefresh *bool) { - o.UseShortTermRefresh = useShortTermRefresh -} - -// WithUsername adds the username to the create token params -func (o *CreateTokenParams) WithUsername(username *string) *CreateTokenParams { - o.SetUsername(username) - return o -} - -// SetUsername adds the username to the create token params -func (o *CreateTokenParams) SetUsername(username *string) { - o.Username = username -} - -// WithXAPIVersion adds the xAPIVersion to the create token params -func (o *CreateTokenParams) WithXAPIVersion(xAPIVersion string) *CreateTokenParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the create token params -func (o *CreateTokenParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Code != nil { - - // form param code - var frCode string - if o.Code != nil { - frCode = *o.Code - } - fCode := frCode - if fCode != "" { - if err := r.SetFormParam("code", fCode); err != nil { - return err - } - } - } - - // form param grant_type - frGrantType := o.GrantType - fGrantType := frGrantType - if fGrantType != "" { - if err := r.SetFormParam("grant_type", fGrantType); err != nil { - return err - } - } - - if o.Password != nil { - - // form param password - var frPassword strfmt.Password - if o.Password != nil { - frPassword = *o.Password - } - fPassword := frPassword.String() - if fPassword != "" { - if err := r.SetFormParam("password", fPassword); err != nil { - return err - } - } - } - - if o.RefreshToken != nil { - - // form param refresh_token - var frRefreshToken string - if o.RefreshToken != nil { - frRefreshToken = *o.RefreshToken - } - fRefreshToken := frRefreshToken - if fRefreshToken != "" { - if err := r.SetFormParam("refresh_token", fRefreshToken); err != nil { - return err - } - } - } - - if o.UseShortTermRefresh != nil { - - // form param use_short_term_refresh - var frUseShortTermRefresh bool - if o.UseShortTermRefresh != nil { - frUseShortTermRefresh = *o.UseShortTermRefresh - } - fUseShortTermRefresh := swag.FormatBool(frUseShortTermRefresh) - if fUseShortTermRefresh != "" { - if err := r.SetFormParam("use_short_term_refresh", fUseShortTermRefresh); err != nil { - return err - } - } - } - - if o.Username != nil { - - // form param username - var frUsername string - if o.Username != nil { - frUsername = *o.Username - } - fUsername := frUsername - if fUsername != "" { - if err := r.SetFormParam("username", fUsername); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/login/create_token_responses.go b/client/login/create_token_responses.go deleted file mode 100644 index 18377dc..0000000 --- a/client/login/create_token_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package login - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// CreateTokenReader is a Reader for the CreateToken structure. -type CreateTokenReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateTokenOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateTokenBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateTokenUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateTokenForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateTokenInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateTokenOK creates a CreateTokenOK with default headers values -func NewCreateTokenOK() *CreateTokenOK { - return &CreateTokenOK{} -} - -/* CreateTokenOK describes a response with status code 200, with default header values. - -OK -*/ -type CreateTokenOK struct { - Payload *models.TokenModel -} - -func (o *CreateTokenOK) Error() string { - return fmt.Sprintf("[POST /api/oauth2/token][%d] createTokenOK %+v", 200, o.Payload) -} -func (o *CreateTokenOK) GetPayload() *models.TokenModel { - return o.Payload -} - -func (o *CreateTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.TokenModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateTokenBadRequest creates a CreateTokenBadRequest with default headers values -func NewCreateTokenBadRequest() *CreateTokenBadRequest { - return &CreateTokenBadRequest{} -} - -/* CreateTokenBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type CreateTokenBadRequest struct { - Payload *models.Error -} - -func (o *CreateTokenBadRequest) Error() string { - return fmt.Sprintf("[POST /api/oauth2/token][%d] createTokenBadRequest %+v", 400, o.Payload) -} -func (o *CreateTokenBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateTokenBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateTokenUnauthorized creates a CreateTokenUnauthorized with default headers values -func NewCreateTokenUnauthorized() *CreateTokenUnauthorized { - return &CreateTokenUnauthorized{} -} - -/* CreateTokenUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type CreateTokenUnauthorized struct { - Payload *models.Error -} - -func (o *CreateTokenUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/oauth2/token][%d] createTokenUnauthorized %+v", 401, o.Payload) -} -func (o *CreateTokenUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateTokenUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateTokenForbidden creates a CreateTokenForbidden with default headers values -func NewCreateTokenForbidden() *CreateTokenForbidden { - return &CreateTokenForbidden{} -} - -/* CreateTokenForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type CreateTokenForbidden struct { - Payload *models.Error -} - -func (o *CreateTokenForbidden) Error() string { - return fmt.Sprintf("[POST /api/oauth2/token][%d] createTokenForbidden %+v", 403, o.Payload) -} -func (o *CreateTokenForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateTokenForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateTokenInternalServerError creates a CreateTokenInternalServerError with default headers values -func NewCreateTokenInternalServerError() *CreateTokenInternalServerError { - return &CreateTokenInternalServerError{} -} - -/* CreateTokenInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type CreateTokenInternalServerError struct { - Payload *models.Error -} - -func (o *CreateTokenInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/oauth2/token][%d] createTokenInternalServerError %+v", 500, o.Payload) -} -func (o *CreateTokenInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateTokenInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/login/login_client.go b/client/login/login_client.go deleted file mode 100644 index 14bafc6..0000000 --- a/client/login/login_client.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package login - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new login API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for login API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateAuthorizationCode(params *CreateAuthorizationCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthorizationCodeOK, error) - - CreateToken(params *CreateTokenParams, opts ...ClientOption) (*CreateTokenOK, error) - - Logout(params *LogoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LogoutOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateAuthorizationCode gets authorization code - - The HTTP POST request to the `/api/oauth2/authorization_code` path allows you to get an authorization code that is used to obtain an access token. For more information on authorization process, see [Requesting Authorization](https://helpcenter.veeam.com/docs/backup/vbr_rest/requesting_authorization.html). -*/ -func (a *Client) CreateAuthorizationCode(params *CreateAuthorizationCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthorizationCodeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateAuthorizationCodeParams() - } - op := &runtime.ClientOperation{ - ID: "CreateAuthorizationCode", - Method: "POST", - PathPattern: "/api/oauth2/authorization_code", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateAuthorizationCodeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateAuthorizationCodeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateAuthorizationCode: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateToken gets access token - - The HTTP POST request to the `/api/oauth2/token` path allows you to get an access token and a refresh token. -*/ -func (a *Client) CreateToken(params *CreateTokenParams, opts ...ClientOption) (*CreateTokenOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateTokenParams() - } - op := &runtime.ClientOperation{ - ID: "CreateToken", - Method: "POST", - PathPattern: "/api/oauth2/token", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateTokenReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateTokenOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateToken: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - Logout logs out - - The HTTP POST request to the `/api/oauth2/logout` path allows you to perform the logout operation. After you log out, access and refresh tokens are expired. - -*/ -func (a *Client) Logout(params *LogoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LogoutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewLogoutParams() - } - op := &runtime.ClientOperation{ - ID: "Logout", - Method: "POST", - PathPattern: "/api/oauth2/logout", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &LogoutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*LogoutOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Logout: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/login/logout_parameters.go b/client/login/logout_parameters.go deleted file mode 100644 index 20dccd0..0000000 --- a/client/login/logout_parameters.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package login - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewLogoutParams creates a new LogoutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewLogoutParams() *LogoutParams { - return &LogoutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewLogoutParamsWithTimeout creates a new LogoutParams object -// with the ability to set a timeout on a request. -func NewLogoutParamsWithTimeout(timeout time.Duration) *LogoutParams { - return &LogoutParams{ - timeout: timeout, - } -} - -// NewLogoutParamsWithContext creates a new LogoutParams object -// with the ability to set a context for a request. -func NewLogoutParamsWithContext(ctx context.Context) *LogoutParams { - return &LogoutParams{ - Context: ctx, - } -} - -// NewLogoutParamsWithHTTPClient creates a new LogoutParams object -// with the ability to set a custom HTTPClient for a request. -func NewLogoutParamsWithHTTPClient(client *http.Client) *LogoutParams { - return &LogoutParams{ - HTTPClient: client, - } -} - -/* LogoutParams contains all the parameters to send to the API endpoint - for the logout operation. - - Typically these are written to a http.Request. -*/ -type LogoutParams struct { - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the logout params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *LogoutParams) WithDefaults() *LogoutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the logout params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *LogoutParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := LogoutParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the logout params -func (o *LogoutParams) WithTimeout(timeout time.Duration) *LogoutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the logout params -func (o *LogoutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the logout params -func (o *LogoutParams) WithContext(ctx context.Context) *LogoutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the logout params -func (o *LogoutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the logout params -func (o *LogoutParams) WithHTTPClient(client *http.Client) *LogoutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the logout params -func (o *LogoutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXAPIVersion adds the xAPIVersion to the logout params -func (o *LogoutParams) WithXAPIVersion(xAPIVersion string) *LogoutParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the logout params -func (o *LogoutParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *LogoutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/login/logout_responses.go b/client/login/logout_responses.go deleted file mode 100644 index 307ce51..0000000 --- a/client/login/logout_responses.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package login - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// LogoutReader is a Reader for the Logout structure. -type LogoutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *LogoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewLogoutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewLogoutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewLogoutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewLogoutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewLogoutOK creates a LogoutOK with default headers values -func NewLogoutOK() *LogoutOK { - return &LogoutOK{} -} - -/* LogoutOK describes a response with status code 200, with default header values. - -OK -*/ -type LogoutOK struct { - Payload models.EmptySuccessResponse -} - -func (o *LogoutOK) Error() string { - return fmt.Sprintf("[POST /api/oauth2/logout][%d] logoutOK %+v", 200, o.Payload) -} -func (o *LogoutOK) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *LogoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewLogoutUnauthorized creates a LogoutUnauthorized with default headers values -func NewLogoutUnauthorized() *LogoutUnauthorized { - return &LogoutUnauthorized{} -} - -/* LogoutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type LogoutUnauthorized struct { - Payload *models.Error -} - -func (o *LogoutUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/oauth2/logout][%d] logoutUnauthorized %+v", 401, o.Payload) -} -func (o *LogoutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *LogoutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewLogoutForbidden creates a LogoutForbidden with default headers values -func NewLogoutForbidden() *LogoutForbidden { - return &LogoutForbidden{} -} - -/* LogoutForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type LogoutForbidden struct { - Payload *models.Error -} - -func (o *LogoutForbidden) Error() string { - return fmt.Sprintf("[POST /api/oauth2/logout][%d] logoutForbidden %+v", 403, o.Payload) -} -func (o *LogoutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *LogoutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewLogoutInternalServerError creates a LogoutInternalServerError with default headers values -func NewLogoutInternalServerError() *LogoutInternalServerError { - return &LogoutInternalServerError{} -} - -/* LogoutInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type LogoutInternalServerError struct { - Payload *models.Error -} - -func (o *LogoutInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/oauth2/logout][%d] logoutInternalServerError %+v", 500, o.Payload) -} -func (o *LogoutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *LogoutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/managed_servers/create_managed_server_parameters.go b/client/managed_servers/create_managed_server_parameters.go deleted file mode 100644 index 7994f24..0000000 --- a/client/managed_servers/create_managed_server_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewCreateManagedServerParams creates a new CreateManagedServerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateManagedServerParams() *CreateManagedServerParams { - return &CreateManagedServerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateManagedServerParamsWithTimeout creates a new CreateManagedServerParams object -// with the ability to set a timeout on a request. -func NewCreateManagedServerParamsWithTimeout(timeout time.Duration) *CreateManagedServerParams { - return &CreateManagedServerParams{ - timeout: timeout, - } -} - -// NewCreateManagedServerParamsWithContext creates a new CreateManagedServerParams object -// with the ability to set a context for a request. -func NewCreateManagedServerParamsWithContext(ctx context.Context) *CreateManagedServerParams { - return &CreateManagedServerParams{ - Context: ctx, - } -} - -// NewCreateManagedServerParamsWithHTTPClient creates a new CreateManagedServerParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateManagedServerParamsWithHTTPClient(client *http.Client) *CreateManagedServerParams { - return &CreateManagedServerParams{ - HTTPClient: client, - } -} - -/* CreateManagedServerParams contains all the parameters to send to the API endpoint - for the create managed server operation. - - Typically these are written to a http.Request. -*/ -type CreateManagedServerParams struct { - - // Body. - Body *models.ManagedServerSpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create managed server params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateManagedServerParams) WithDefaults() *CreateManagedServerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create managed server params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateManagedServerParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := CreateManagedServerParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create managed server params -func (o *CreateManagedServerParams) WithTimeout(timeout time.Duration) *CreateManagedServerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create managed server params -func (o *CreateManagedServerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create managed server params -func (o *CreateManagedServerParams) WithContext(ctx context.Context) *CreateManagedServerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create managed server params -func (o *CreateManagedServerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create managed server params -func (o *CreateManagedServerParams) WithHTTPClient(client *http.Client) *CreateManagedServerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create managed server params -func (o *CreateManagedServerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create managed server params -func (o *CreateManagedServerParams) WithBody(body *models.ManagedServerSpec) *CreateManagedServerParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create managed server params -func (o *CreateManagedServerParams) SetBody(body *models.ManagedServerSpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the create managed server params -func (o *CreateManagedServerParams) WithXAPIVersion(xAPIVersion string) *CreateManagedServerParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the create managed server params -func (o *CreateManagedServerParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateManagedServerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/managed_servers/create_managed_server_responses.go b/client/managed_servers/create_managed_server_responses.go deleted file mode 100644 index cf7f562..0000000 --- a/client/managed_servers/create_managed_server_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// CreateManagedServerReader is a Reader for the CreateManagedServer structure. -type CreateManagedServerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateManagedServerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateManagedServerCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateManagedServerBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateManagedServerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateManagedServerForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateManagedServerInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateManagedServerCreated creates a CreateManagedServerCreated with default headers values -func NewCreateManagedServerCreated() *CreateManagedServerCreated { - return &CreateManagedServerCreated{} -} - -/* CreateManagedServerCreated describes a response with status code 201, with default header values. - -Infrastructure session has been created to add the server. To check the progress, track the session `state`. -*/ -type CreateManagedServerCreated struct { - Payload *models.SessionModel -} - -func (o *CreateManagedServerCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/managedServers][%d] createManagedServerCreated %+v", 201, o.Payload) -} -func (o *CreateManagedServerCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *CreateManagedServerCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateManagedServerBadRequest creates a CreateManagedServerBadRequest with default headers values -func NewCreateManagedServerBadRequest() *CreateManagedServerBadRequest { - return &CreateManagedServerBadRequest{} -} - -/* CreateManagedServerBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type CreateManagedServerBadRequest struct { - Payload *models.Error -} - -func (o *CreateManagedServerBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/managedServers][%d] createManagedServerBadRequest %+v", 400, o.Payload) -} -func (o *CreateManagedServerBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateManagedServerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateManagedServerUnauthorized creates a CreateManagedServerUnauthorized with default headers values -func NewCreateManagedServerUnauthorized() *CreateManagedServerUnauthorized { - return &CreateManagedServerUnauthorized{} -} - -/* CreateManagedServerUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type CreateManagedServerUnauthorized struct { - Payload *models.Error -} - -func (o *CreateManagedServerUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/managedServers][%d] createManagedServerUnauthorized %+v", 401, o.Payload) -} -func (o *CreateManagedServerUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateManagedServerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateManagedServerForbidden creates a CreateManagedServerForbidden with default headers values -func NewCreateManagedServerForbidden() *CreateManagedServerForbidden { - return &CreateManagedServerForbidden{} -} - -/* CreateManagedServerForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type CreateManagedServerForbidden struct { - Payload *models.Error -} - -func (o *CreateManagedServerForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/managedServers][%d] createManagedServerForbidden %+v", 403, o.Payload) -} -func (o *CreateManagedServerForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateManagedServerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateManagedServerInternalServerError creates a CreateManagedServerInternalServerError with default headers values -func NewCreateManagedServerInternalServerError() *CreateManagedServerInternalServerError { - return &CreateManagedServerInternalServerError{} -} - -/* CreateManagedServerInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type CreateManagedServerInternalServerError struct { - Payload *models.Error -} - -func (o *CreateManagedServerInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/managedServers][%d] createManagedServerInternalServerError %+v", 500, o.Payload) -} -func (o *CreateManagedServerInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateManagedServerInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/managed_servers/delete_managed_server_parameters.go b/client/managed_servers/delete_managed_server_parameters.go deleted file mode 100644 index 7967f8c..0000000 --- a/client/managed_servers/delete_managed_server_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteManagedServerParams creates a new DeleteManagedServerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteManagedServerParams() *DeleteManagedServerParams { - return &DeleteManagedServerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteManagedServerParamsWithTimeout creates a new DeleteManagedServerParams object -// with the ability to set a timeout on a request. -func NewDeleteManagedServerParamsWithTimeout(timeout time.Duration) *DeleteManagedServerParams { - return &DeleteManagedServerParams{ - timeout: timeout, - } -} - -// NewDeleteManagedServerParamsWithContext creates a new DeleteManagedServerParams object -// with the ability to set a context for a request. -func NewDeleteManagedServerParamsWithContext(ctx context.Context) *DeleteManagedServerParams { - return &DeleteManagedServerParams{ - Context: ctx, - } -} - -// NewDeleteManagedServerParamsWithHTTPClient creates a new DeleteManagedServerParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteManagedServerParamsWithHTTPClient(client *http.Client) *DeleteManagedServerParams { - return &DeleteManagedServerParams{ - HTTPClient: client, - } -} - -/* DeleteManagedServerParams contains all the parameters to send to the API endpoint - for the delete managed server operation. - - Typically these are written to a http.Request. -*/ -type DeleteManagedServerParams struct { - - /* ID. - - ID of the managed server. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete managed server params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteManagedServerParams) WithDefaults() *DeleteManagedServerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete managed server params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteManagedServerParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := DeleteManagedServerParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the delete managed server params -func (o *DeleteManagedServerParams) WithTimeout(timeout time.Duration) *DeleteManagedServerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete managed server params -func (o *DeleteManagedServerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete managed server params -func (o *DeleteManagedServerParams) WithContext(ctx context.Context) *DeleteManagedServerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete managed server params -func (o *DeleteManagedServerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete managed server params -func (o *DeleteManagedServerParams) WithHTTPClient(client *http.Client) *DeleteManagedServerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete managed server params -func (o *DeleteManagedServerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete managed server params -func (o *DeleteManagedServerParams) WithID(id strfmt.UUID) *DeleteManagedServerParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete managed server params -func (o *DeleteManagedServerParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the delete managed server params -func (o *DeleteManagedServerParams) WithXAPIVersion(xAPIVersion string) *DeleteManagedServerParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the delete managed server params -func (o *DeleteManagedServerParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteManagedServerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/managed_servers/delete_managed_server_responses.go b/client/managed_servers/delete_managed_server_responses.go deleted file mode 100644 index fc7859e..0000000 --- a/client/managed_servers/delete_managed_server_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// DeleteManagedServerReader is a Reader for the DeleteManagedServer structure. -type DeleteManagedServerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteManagedServerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewDeleteManagedServerCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteManagedServerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteManagedServerForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteManagedServerNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteManagedServerInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteManagedServerCreated creates a DeleteManagedServerCreated with default headers values -func NewDeleteManagedServerCreated() *DeleteManagedServerCreated { - return &DeleteManagedServerCreated{} -} - -/* DeleteManagedServerCreated describes a response with status code 201, with default header values. - -Managed server has been removed. -*/ -type DeleteManagedServerCreated struct { - Payload *models.SessionModel -} - -func (o *DeleteManagedServerCreated) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/managedServers/{id}][%d] deleteManagedServerCreated %+v", 201, o.Payload) -} -func (o *DeleteManagedServerCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *DeleteManagedServerCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteManagedServerUnauthorized creates a DeleteManagedServerUnauthorized with default headers values -func NewDeleteManagedServerUnauthorized() *DeleteManagedServerUnauthorized { - return &DeleteManagedServerUnauthorized{} -} - -/* DeleteManagedServerUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type DeleteManagedServerUnauthorized struct { - Payload *models.Error -} - -func (o *DeleteManagedServerUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/managedServers/{id}][%d] deleteManagedServerUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteManagedServerUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteManagedServerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteManagedServerForbidden creates a DeleteManagedServerForbidden with default headers values -func NewDeleteManagedServerForbidden() *DeleteManagedServerForbidden { - return &DeleteManagedServerForbidden{} -} - -/* DeleteManagedServerForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type DeleteManagedServerForbidden struct { - Payload *models.Error -} - -func (o *DeleteManagedServerForbidden) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/managedServers/{id}][%d] deleteManagedServerForbidden %+v", 403, o.Payload) -} -func (o *DeleteManagedServerForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteManagedServerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteManagedServerNotFound creates a DeleteManagedServerNotFound with default headers values -func NewDeleteManagedServerNotFound() *DeleteManagedServerNotFound { - return &DeleteManagedServerNotFound{} -} - -/* DeleteManagedServerNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type DeleteManagedServerNotFound struct { - Payload *models.Error -} - -func (o *DeleteManagedServerNotFound) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/managedServers/{id}][%d] deleteManagedServerNotFound %+v", 404, o.Payload) -} -func (o *DeleteManagedServerNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteManagedServerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteManagedServerInternalServerError creates a DeleteManagedServerInternalServerError with default headers values -func NewDeleteManagedServerInternalServerError() *DeleteManagedServerInternalServerError { - return &DeleteManagedServerInternalServerError{} -} - -/* DeleteManagedServerInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type DeleteManagedServerInternalServerError struct { - Payload *models.Error -} - -func (o *DeleteManagedServerInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/managedServers/{id}][%d] deleteManagedServerInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteManagedServerInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteManagedServerInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/managed_servers/get_all_managed_servers_parameters.go b/client/managed_servers/get_all_managed_servers_parameters.go deleted file mode 100644 index ff190da..0000000 --- a/client/managed_servers/get_all_managed_servers_parameters.go +++ /dev/null @@ -1,407 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllManagedServersParams creates a new GetAllManagedServersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllManagedServersParams() *GetAllManagedServersParams { - return &GetAllManagedServersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllManagedServersParamsWithTimeout creates a new GetAllManagedServersParams object -// with the ability to set a timeout on a request. -func NewGetAllManagedServersParamsWithTimeout(timeout time.Duration) *GetAllManagedServersParams { - return &GetAllManagedServersParams{ - timeout: timeout, - } -} - -// NewGetAllManagedServersParamsWithContext creates a new GetAllManagedServersParams object -// with the ability to set a context for a request. -func NewGetAllManagedServersParamsWithContext(ctx context.Context) *GetAllManagedServersParams { - return &GetAllManagedServersParams{ - Context: ctx, - } -} - -// NewGetAllManagedServersParamsWithHTTPClient creates a new GetAllManagedServersParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllManagedServersParamsWithHTTPClient(client *http.Client) *GetAllManagedServersParams { - return &GetAllManagedServersParams{ - HTTPClient: client, - } -} - -/* GetAllManagedServersParams contains all the parameters to send to the API endpoint - for the get all managed servers operation. - - Typically these are written to a http.Request. -*/ -type GetAllManagedServersParams struct { - - /* Limit. - - Maximum number of servers to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters servers by the `nameFilter` pattern. The pattern can match any server parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts servers in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts servers by one of the server parameters. - */ - OrderColumn *string - - /* Skip. - - Number of servers to skip. - - Format: int32 - */ - Skip *int32 - - /* TypeFilter. - - Filters servers by server type. - */ - TypeFilter *string - - /* ViTypeFilter. - - Filters servers by the type of VMware vSphere server. - */ - ViTypeFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all managed servers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllManagedServersParams) WithDefaults() *GetAllManagedServersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all managed servers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllManagedServersParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllManagedServersParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all managed servers params -func (o *GetAllManagedServersParams) WithTimeout(timeout time.Duration) *GetAllManagedServersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all managed servers params -func (o *GetAllManagedServersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all managed servers params -func (o *GetAllManagedServersParams) WithContext(ctx context.Context) *GetAllManagedServersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all managed servers params -func (o *GetAllManagedServersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all managed servers params -func (o *GetAllManagedServersParams) WithHTTPClient(client *http.Client) *GetAllManagedServersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all managed servers params -func (o *GetAllManagedServersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get all managed servers params -func (o *GetAllManagedServersParams) WithLimit(limit *int32) *GetAllManagedServersParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all managed servers params -func (o *GetAllManagedServersParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all managed servers params -func (o *GetAllManagedServersParams) WithNameFilter(nameFilter *string) *GetAllManagedServersParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all managed servers params -func (o *GetAllManagedServersParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all managed servers params -func (o *GetAllManagedServersParams) WithOrderAsc(orderAsc *bool) *GetAllManagedServersParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all managed servers params -func (o *GetAllManagedServersParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all managed servers params -func (o *GetAllManagedServersParams) WithOrderColumn(orderColumn *string) *GetAllManagedServersParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all managed servers params -func (o *GetAllManagedServersParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all managed servers params -func (o *GetAllManagedServersParams) WithSkip(skip *int32) *GetAllManagedServersParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all managed servers params -func (o *GetAllManagedServersParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithTypeFilter adds the typeFilter to the get all managed servers params -func (o *GetAllManagedServersParams) WithTypeFilter(typeFilter *string) *GetAllManagedServersParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all managed servers params -func (o *GetAllManagedServersParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithViTypeFilter adds the viTypeFilter to the get all managed servers params -func (o *GetAllManagedServersParams) WithViTypeFilter(viTypeFilter *string) *GetAllManagedServersParams { - o.SetViTypeFilter(viTypeFilter) - return o -} - -// SetViTypeFilter adds the viTypeFilter to the get all managed servers params -func (o *GetAllManagedServersParams) SetViTypeFilter(viTypeFilter *string) { - o.ViTypeFilter = viTypeFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all managed servers params -func (o *GetAllManagedServersParams) WithXAPIVersion(xAPIVersion string) *GetAllManagedServersParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all managed servers params -func (o *GetAllManagedServersParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllManagedServersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - if o.ViTypeFilter != nil { - - // query param viTypeFilter - var qrViTypeFilter string - - if o.ViTypeFilter != nil { - qrViTypeFilter = *o.ViTypeFilter - } - qViTypeFilter := qrViTypeFilter - if qViTypeFilter != "" { - - if err := r.SetQueryParam("viTypeFilter", qViTypeFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/managed_servers/get_all_managed_servers_responses.go b/client/managed_servers/get_all_managed_servers_responses.go deleted file mode 100644 index 550ff76..0000000 --- a/client/managed_servers/get_all_managed_servers_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllManagedServersReader is a Reader for the GetAllManagedServers structure. -type GetAllManagedServersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllManagedServersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllManagedServersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllManagedServersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllManagedServersForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllManagedServersInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllManagedServersOK creates a GetAllManagedServersOK with default headers values -func NewGetAllManagedServersOK() *GetAllManagedServersOK { - return &GetAllManagedServersOK{} -} - -/* GetAllManagedServersOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllManagedServersOK struct { - Payload *models.ManagedServersResult -} - -func (o *GetAllManagedServersOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers][%d] getAllManagedServersOK %+v", 200, o.Payload) -} -func (o *GetAllManagedServersOK) GetPayload() *models.ManagedServersResult { - return o.Payload -} - -func (o *GetAllManagedServersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ManagedServersResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllManagedServersUnauthorized creates a GetAllManagedServersUnauthorized with default headers values -func NewGetAllManagedServersUnauthorized() *GetAllManagedServersUnauthorized { - return &GetAllManagedServersUnauthorized{} -} - -/* GetAllManagedServersUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllManagedServersUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllManagedServersUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers][%d] getAllManagedServersUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllManagedServersUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllManagedServersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllManagedServersForbidden creates a GetAllManagedServersForbidden with default headers values -func NewGetAllManagedServersForbidden() *GetAllManagedServersForbidden { - return &GetAllManagedServersForbidden{} -} - -/* GetAllManagedServersForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllManagedServersForbidden struct { - Payload *models.Error -} - -func (o *GetAllManagedServersForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers][%d] getAllManagedServersForbidden %+v", 403, o.Payload) -} -func (o *GetAllManagedServersForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllManagedServersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllManagedServersInternalServerError creates a GetAllManagedServersInternalServerError with default headers values -func NewGetAllManagedServersInternalServerError() *GetAllManagedServersInternalServerError { - return &GetAllManagedServersInternalServerError{} -} - -/* GetAllManagedServersInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllManagedServersInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllManagedServersInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers][%d] getAllManagedServersInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllManagedServersInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllManagedServersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/managed_servers/get_managed_server_parameters.go b/client/managed_servers/get_managed_server_parameters.go deleted file mode 100644 index 34bf1d7..0000000 --- a/client/managed_servers/get_managed_server_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetManagedServerParams creates a new GetManagedServerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetManagedServerParams() *GetManagedServerParams { - return &GetManagedServerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetManagedServerParamsWithTimeout creates a new GetManagedServerParams object -// with the ability to set a timeout on a request. -func NewGetManagedServerParamsWithTimeout(timeout time.Duration) *GetManagedServerParams { - return &GetManagedServerParams{ - timeout: timeout, - } -} - -// NewGetManagedServerParamsWithContext creates a new GetManagedServerParams object -// with the ability to set a context for a request. -func NewGetManagedServerParamsWithContext(ctx context.Context) *GetManagedServerParams { - return &GetManagedServerParams{ - Context: ctx, - } -} - -// NewGetManagedServerParamsWithHTTPClient creates a new GetManagedServerParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetManagedServerParamsWithHTTPClient(client *http.Client) *GetManagedServerParams { - return &GetManagedServerParams{ - HTTPClient: client, - } -} - -/* GetManagedServerParams contains all the parameters to send to the API endpoint - for the get managed server operation. - - Typically these are written to a http.Request. -*/ -type GetManagedServerParams struct { - - /* ID. - - ID of the managed server. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get managed server params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetManagedServerParams) WithDefaults() *GetManagedServerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get managed server params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetManagedServerParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetManagedServerParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get managed server params -func (o *GetManagedServerParams) WithTimeout(timeout time.Duration) *GetManagedServerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get managed server params -func (o *GetManagedServerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get managed server params -func (o *GetManagedServerParams) WithContext(ctx context.Context) *GetManagedServerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get managed server params -func (o *GetManagedServerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get managed server params -func (o *GetManagedServerParams) WithHTTPClient(client *http.Client) *GetManagedServerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get managed server params -func (o *GetManagedServerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get managed server params -func (o *GetManagedServerParams) WithID(id strfmt.UUID) *GetManagedServerParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get managed server params -func (o *GetManagedServerParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get managed server params -func (o *GetManagedServerParams) WithXAPIVersion(xAPIVersion string) *GetManagedServerParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get managed server params -func (o *GetManagedServerParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetManagedServerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/managed_servers/get_managed_server_responses.go b/client/managed_servers/get_managed_server_responses.go deleted file mode 100644 index 7e829dc..0000000 --- a/client/managed_servers/get_managed_server_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetManagedServerReader is a Reader for the GetManagedServer structure. -type GetManagedServerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetManagedServerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetManagedServerOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetManagedServerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetManagedServerForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetManagedServerNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetManagedServerInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetManagedServerOK creates a GetManagedServerOK with default headers values -func NewGetManagedServerOK() *GetManagedServerOK { - return &GetManagedServerOK{} -} - -/* GetManagedServerOK describes a response with status code 200, with default header values. - -OK -*/ -type GetManagedServerOK struct { - Payload *models.ManagedServerModel -} - -func (o *GetManagedServerOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers/{id}][%d] getManagedServerOK %+v", 200, o.Payload) -} -func (o *GetManagedServerOK) GetPayload() *models.ManagedServerModel { - return o.Payload -} - -func (o *GetManagedServerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ManagedServerModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetManagedServerUnauthorized creates a GetManagedServerUnauthorized with default headers values -func NewGetManagedServerUnauthorized() *GetManagedServerUnauthorized { - return &GetManagedServerUnauthorized{} -} - -/* GetManagedServerUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetManagedServerUnauthorized struct { - Payload *models.Error -} - -func (o *GetManagedServerUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers/{id}][%d] getManagedServerUnauthorized %+v", 401, o.Payload) -} -func (o *GetManagedServerUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetManagedServerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetManagedServerForbidden creates a GetManagedServerForbidden with default headers values -func NewGetManagedServerForbidden() *GetManagedServerForbidden { - return &GetManagedServerForbidden{} -} - -/* GetManagedServerForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetManagedServerForbidden struct { - Payload *models.Error -} - -func (o *GetManagedServerForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers/{id}][%d] getManagedServerForbidden %+v", 403, o.Payload) -} -func (o *GetManagedServerForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetManagedServerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetManagedServerNotFound creates a GetManagedServerNotFound with default headers values -func NewGetManagedServerNotFound() *GetManagedServerNotFound { - return &GetManagedServerNotFound{} -} - -/* GetManagedServerNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetManagedServerNotFound struct { - Payload *models.Error -} - -func (o *GetManagedServerNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers/{id}][%d] getManagedServerNotFound %+v", 404, o.Payload) -} -func (o *GetManagedServerNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetManagedServerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetManagedServerInternalServerError creates a GetManagedServerInternalServerError with default headers values -func NewGetManagedServerInternalServerError() *GetManagedServerInternalServerError { - return &GetManagedServerInternalServerError{} -} - -/* GetManagedServerInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetManagedServerInternalServerError struct { - Payload *models.Error -} - -func (o *GetManagedServerInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/managedServers/{id}][%d] getManagedServerInternalServerError %+v", 500, o.Payload) -} -func (o *GetManagedServerInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetManagedServerInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/managed_servers/managed_servers_client.go b/client/managed_servers/managed_servers_client.go deleted file mode 100644 index 8a4149d..0000000 --- a/client/managed_servers/managed_servers_client.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new managed servers API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for managed servers API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateManagedServer(params *CreateManagedServerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateManagedServerCreated, error) - - DeleteManagedServer(params *DeleteManagedServerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteManagedServerCreated, error) - - GetAllManagedServers(params *GetAllManagedServersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllManagedServersOK, error) - - GetManagedServer(params *GetManagedServerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetManagedServerOK, error) - - UpdateManagedServer(params *UpdateManagedServerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateManagedServerCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateManagedServer adds server - - The HTTP POST request to the `/api/v1/backupInfrastructure/managedServers` path allows you to add a server to the backup infrastructure. -*/ -func (a *Client) CreateManagedServer(params *CreateManagedServerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateManagedServerCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateManagedServerParams() - } - op := &runtime.ClientOperation{ - ID: "CreateManagedServer", - Method: "POST", - PathPattern: "/api/v1/backupInfrastructure/managedServers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateManagedServerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateManagedServerCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateManagedServer: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteManagedServer removes server - - The HTTP DELETE request to the `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to remove a managed server that has the specified `id` from the backup infrastructure. -*/ -func (a *Client) DeleteManagedServer(params *DeleteManagedServerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteManagedServerCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteManagedServerParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteManagedServer", - Method: "DELETE", - PathPattern: "/api/v1/backupInfrastructure/managedServers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteManagedServerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteManagedServerCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteManagedServer: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllManagedServers gets all servers - - The HTTP GET request to the `/api/v1/backupInfrastructure/managedServers` path allows you to get an array of all servers that are added to the backup infrastructure. -*/ -func (a *Client) GetAllManagedServers(params *GetAllManagedServersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllManagedServersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllManagedServersParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllManagedServers", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/managedServers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllManagedServersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllManagedServersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllManagedServers: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetManagedServer gets server - - The HTTP GET request to the `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to get a managed server that has the specified `id`. -*/ -func (a *Client) GetManagedServer(params *GetManagedServerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetManagedServerOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetManagedServerParams() - } - op := &runtime.ClientOperation{ - ID: "GetManagedServer", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/managedServers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetManagedServerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetManagedServerOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetManagedServer: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateManagedServer edits server - - The HTTP PUT request to the `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to edit a managed server that has the specified `id`. -*/ -func (a *Client) UpdateManagedServer(params *UpdateManagedServerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateManagedServerCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateManagedServerParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateManagedServer", - Method: "PUT", - PathPattern: "/api/v1/backupInfrastructure/managedServers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateManagedServerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateManagedServerCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateManagedServer: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/managed_servers/update_managed_server_parameters.go b/client/managed_servers/update_managed_server_parameters.go deleted file mode 100644 index d364fa7..0000000 --- a/client/managed_servers/update_managed_server_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateManagedServerParams creates a new UpdateManagedServerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateManagedServerParams() *UpdateManagedServerParams { - return &UpdateManagedServerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateManagedServerParamsWithTimeout creates a new UpdateManagedServerParams object -// with the ability to set a timeout on a request. -func NewUpdateManagedServerParamsWithTimeout(timeout time.Duration) *UpdateManagedServerParams { - return &UpdateManagedServerParams{ - timeout: timeout, - } -} - -// NewUpdateManagedServerParamsWithContext creates a new UpdateManagedServerParams object -// with the ability to set a context for a request. -func NewUpdateManagedServerParamsWithContext(ctx context.Context) *UpdateManagedServerParams { - return &UpdateManagedServerParams{ - Context: ctx, - } -} - -// NewUpdateManagedServerParamsWithHTTPClient creates a new UpdateManagedServerParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateManagedServerParamsWithHTTPClient(client *http.Client) *UpdateManagedServerParams { - return &UpdateManagedServerParams{ - HTTPClient: client, - } -} - -/* UpdateManagedServerParams contains all the parameters to send to the API endpoint - for the update managed server operation. - - Typically these are written to a http.Request. -*/ -type UpdateManagedServerParams struct { - - // Body. - Body *models.ManagedServerModel - - /* ID. - - ID of the managed server. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update managed server params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateManagedServerParams) WithDefaults() *UpdateManagedServerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update managed server params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateManagedServerParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateManagedServerParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update managed server params -func (o *UpdateManagedServerParams) WithTimeout(timeout time.Duration) *UpdateManagedServerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update managed server params -func (o *UpdateManagedServerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update managed server params -func (o *UpdateManagedServerParams) WithContext(ctx context.Context) *UpdateManagedServerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update managed server params -func (o *UpdateManagedServerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update managed server params -func (o *UpdateManagedServerParams) WithHTTPClient(client *http.Client) *UpdateManagedServerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update managed server params -func (o *UpdateManagedServerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update managed server params -func (o *UpdateManagedServerParams) WithBody(body *models.ManagedServerModel) *UpdateManagedServerParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update managed server params -func (o *UpdateManagedServerParams) SetBody(body *models.ManagedServerModel) { - o.Body = body -} - -// WithID adds the id to the update managed server params -func (o *UpdateManagedServerParams) WithID(id strfmt.UUID) *UpdateManagedServerParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update managed server params -func (o *UpdateManagedServerParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the update managed server params -func (o *UpdateManagedServerParams) WithXAPIVersion(xAPIVersion string) *UpdateManagedServerParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update managed server params -func (o *UpdateManagedServerParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateManagedServerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/managed_servers/update_managed_server_responses.go b/client/managed_servers/update_managed_server_responses.go deleted file mode 100644 index 9c7f22c..0000000 --- a/client/managed_servers/update_managed_server_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package managed_servers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateManagedServerReader is a Reader for the UpdateManagedServer structure. -type UpdateManagedServerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateManagedServerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewUpdateManagedServerCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateManagedServerBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateManagedServerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateManagedServerForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateManagedServerNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateManagedServerInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateManagedServerCreated creates a UpdateManagedServerCreated with default headers values -func NewUpdateManagedServerCreated() *UpdateManagedServerCreated { - return &UpdateManagedServerCreated{} -} - -/* UpdateManagedServerCreated describes a response with status code 201, with default header values. - -Infrastructure session has been created to edit the server. To check the progress, track the session `state`. -*/ -type UpdateManagedServerCreated struct { - Payload *models.SessionModel -} - -func (o *UpdateManagedServerCreated) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/managedServers/{id}][%d] updateManagedServerCreated %+v", 201, o.Payload) -} -func (o *UpdateManagedServerCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *UpdateManagedServerCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateManagedServerBadRequest creates a UpdateManagedServerBadRequest with default headers values -func NewUpdateManagedServerBadRequest() *UpdateManagedServerBadRequest { - return &UpdateManagedServerBadRequest{} -} - -/* UpdateManagedServerBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateManagedServerBadRequest struct { - Payload *models.Error -} - -func (o *UpdateManagedServerBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/managedServers/{id}][%d] updateManagedServerBadRequest %+v", 400, o.Payload) -} -func (o *UpdateManagedServerBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateManagedServerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateManagedServerUnauthorized creates a UpdateManagedServerUnauthorized with default headers values -func NewUpdateManagedServerUnauthorized() *UpdateManagedServerUnauthorized { - return &UpdateManagedServerUnauthorized{} -} - -/* UpdateManagedServerUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateManagedServerUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateManagedServerUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/managedServers/{id}][%d] updateManagedServerUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateManagedServerUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateManagedServerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateManagedServerForbidden creates a UpdateManagedServerForbidden with default headers values -func NewUpdateManagedServerForbidden() *UpdateManagedServerForbidden { - return &UpdateManagedServerForbidden{} -} - -/* UpdateManagedServerForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateManagedServerForbidden struct { - Payload *models.Error -} - -func (o *UpdateManagedServerForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/managedServers/{id}][%d] updateManagedServerForbidden %+v", 403, o.Payload) -} -func (o *UpdateManagedServerForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateManagedServerForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateManagedServerNotFound creates a UpdateManagedServerNotFound with default headers values -func NewUpdateManagedServerNotFound() *UpdateManagedServerNotFound { - return &UpdateManagedServerNotFound{} -} - -/* UpdateManagedServerNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type UpdateManagedServerNotFound struct { - Payload *models.Error -} - -func (o *UpdateManagedServerNotFound) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/managedServers/{id}][%d] updateManagedServerNotFound %+v", 404, o.Payload) -} -func (o *UpdateManagedServerNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateManagedServerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateManagedServerInternalServerError creates a UpdateManagedServerInternalServerError with default headers values -func NewUpdateManagedServerInternalServerError() *UpdateManagedServerInternalServerError { - return &UpdateManagedServerInternalServerError{} -} - -/* UpdateManagedServerInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateManagedServerInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateManagedServerInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/managedServers/{id}][%d] updateManagedServerInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateManagedServerInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateManagedServerInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/object_restore_points/get_all_object_restore_points_parameters.go b/client/object_restore_points/get_all_object_restore_points_parameters.go deleted file mode 100644 index 0536e2c..0000000 --- a/client/object_restore_points/get_all_object_restore_points_parameters.go +++ /dev/null @@ -1,553 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_restore_points - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllObjectRestorePointsParams creates a new GetAllObjectRestorePointsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllObjectRestorePointsParams() *GetAllObjectRestorePointsParams { - return &GetAllObjectRestorePointsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllObjectRestorePointsParamsWithTimeout creates a new GetAllObjectRestorePointsParams object -// with the ability to set a timeout on a request. -func NewGetAllObjectRestorePointsParamsWithTimeout(timeout time.Duration) *GetAllObjectRestorePointsParams { - return &GetAllObjectRestorePointsParams{ - timeout: timeout, - } -} - -// NewGetAllObjectRestorePointsParamsWithContext creates a new GetAllObjectRestorePointsParams object -// with the ability to set a context for a request. -func NewGetAllObjectRestorePointsParamsWithContext(ctx context.Context) *GetAllObjectRestorePointsParams { - return &GetAllObjectRestorePointsParams{ - Context: ctx, - } -} - -// NewGetAllObjectRestorePointsParamsWithHTTPClient creates a new GetAllObjectRestorePointsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllObjectRestorePointsParamsWithHTTPClient(client *http.Client) *GetAllObjectRestorePointsParams { - return &GetAllObjectRestorePointsParams{ - HTTPClient: client, - } -} - -/* GetAllObjectRestorePointsParams contains all the parameters to send to the API endpoint - for the get all object restore points operation. - - Typically these are written to a http.Request. -*/ -type GetAllObjectRestorePointsParams struct { - - /* BackupIDFilter. - - Filters restore points by backup ID. - - Format: uuid - */ - BackupIDFilter *strfmt.UUID - - /* BackupObjectIDFilter. - - Filters restore points by backup object ID. - - Format: uuid - */ - BackupObjectIDFilter *strfmt.UUID - - /* CreatedAfterFilter. - - Returns restore points that are created after the specified date and time. - - Format: date-time - */ - CreatedAfterFilter *strfmt.DateTime - - /* CreatedBeforeFilter. - - Returns restore points that are created before the specified date and time. - - Format: date-time - */ - CreatedBeforeFilter *strfmt.DateTime - - /* Limit. - - Maximum number of restore points to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters restore points by the `nameFilter` pattern. The pattern can match any restore point parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts restore points in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts restore points by one of the restore point parameters. - */ - OrderColumn *string - - /* PlatformIDFilter. - - Filters restore points by ID of the backup object platform. - - Format: uuid - */ - PlatformIDFilter *strfmt.UUID - - /* PlatformNameFilter. - - Filters restore points by name of the backup object platform. - */ - PlatformNameFilter *string - - /* Skip. - - Number of restore points to skip. - - Format: int32 - */ - Skip *int32 - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all object restore points params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllObjectRestorePointsParams) WithDefaults() *GetAllObjectRestorePointsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all object restore points params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllObjectRestorePointsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllObjectRestorePointsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithTimeout(timeout time.Duration) *GetAllObjectRestorePointsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithContext(ctx context.Context) *GetAllObjectRestorePointsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithHTTPClient(client *http.Client) *GetAllObjectRestorePointsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBackupIDFilter adds the backupIDFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithBackupIDFilter(backupIDFilter *strfmt.UUID) *GetAllObjectRestorePointsParams { - o.SetBackupIDFilter(backupIDFilter) - return o -} - -// SetBackupIDFilter adds the backupIdFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetBackupIDFilter(backupIDFilter *strfmt.UUID) { - o.BackupIDFilter = backupIDFilter -} - -// WithBackupObjectIDFilter adds the backupObjectIDFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithBackupObjectIDFilter(backupObjectIDFilter *strfmt.UUID) *GetAllObjectRestorePointsParams { - o.SetBackupObjectIDFilter(backupObjectIDFilter) - return o -} - -// SetBackupObjectIDFilter adds the backupObjectIdFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetBackupObjectIDFilter(backupObjectIDFilter *strfmt.UUID) { - o.BackupObjectIDFilter = backupObjectIDFilter -} - -// WithCreatedAfterFilter adds the createdAfterFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithCreatedAfterFilter(createdAfterFilter *strfmt.DateTime) *GetAllObjectRestorePointsParams { - o.SetCreatedAfterFilter(createdAfterFilter) - return o -} - -// SetCreatedAfterFilter adds the createdAfterFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetCreatedAfterFilter(createdAfterFilter *strfmt.DateTime) { - o.CreatedAfterFilter = createdAfterFilter -} - -// WithCreatedBeforeFilter adds the createdBeforeFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithCreatedBeforeFilter(createdBeforeFilter *strfmt.DateTime) *GetAllObjectRestorePointsParams { - o.SetCreatedBeforeFilter(createdBeforeFilter) - return o -} - -// SetCreatedBeforeFilter adds the createdBeforeFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetCreatedBeforeFilter(createdBeforeFilter *strfmt.DateTime) { - o.CreatedBeforeFilter = createdBeforeFilter -} - -// WithLimit adds the limit to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithLimit(limit *int32) *GetAllObjectRestorePointsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithNameFilter(nameFilter *string) *GetAllObjectRestorePointsParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithOrderAsc(orderAsc *bool) *GetAllObjectRestorePointsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithOrderColumn(orderColumn *string) *GetAllObjectRestorePointsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithPlatformIDFilter adds the platformIDFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithPlatformIDFilter(platformIDFilter *strfmt.UUID) *GetAllObjectRestorePointsParams { - o.SetPlatformIDFilter(platformIDFilter) - return o -} - -// SetPlatformIDFilter adds the platformIdFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetPlatformIDFilter(platformIDFilter *strfmt.UUID) { - o.PlatformIDFilter = platformIDFilter -} - -// WithPlatformNameFilter adds the platformNameFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithPlatformNameFilter(platformNameFilter *string) *GetAllObjectRestorePointsParams { - o.SetPlatformNameFilter(platformNameFilter) - return o -} - -// SetPlatformNameFilter adds the platformNameFilter to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetPlatformNameFilter(platformNameFilter *string) { - o.PlatformNameFilter = platformNameFilter -} - -// WithSkip adds the skip to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithSkip(skip *int32) *GetAllObjectRestorePointsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithXAPIVersion adds the xAPIVersion to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) WithXAPIVersion(xAPIVersion string) *GetAllObjectRestorePointsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all object restore points params -func (o *GetAllObjectRestorePointsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllObjectRestorePointsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.BackupIDFilter != nil { - - // query param backupIdFilter - var qrBackupIDFilter strfmt.UUID - - if o.BackupIDFilter != nil { - qrBackupIDFilter = *o.BackupIDFilter - } - qBackupIDFilter := qrBackupIDFilter.String() - if qBackupIDFilter != "" { - - if err := r.SetQueryParam("backupIdFilter", qBackupIDFilter); err != nil { - return err - } - } - } - - if o.BackupObjectIDFilter != nil { - - // query param backupObjectIdFilter - var qrBackupObjectIDFilter strfmt.UUID - - if o.BackupObjectIDFilter != nil { - qrBackupObjectIDFilter = *o.BackupObjectIDFilter - } - qBackupObjectIDFilter := qrBackupObjectIDFilter.String() - if qBackupObjectIDFilter != "" { - - if err := r.SetQueryParam("backupObjectIdFilter", qBackupObjectIDFilter); err != nil { - return err - } - } - } - - if o.CreatedAfterFilter != nil { - - // query param createdAfterFilter - var qrCreatedAfterFilter strfmt.DateTime - - if o.CreatedAfterFilter != nil { - qrCreatedAfterFilter = *o.CreatedAfterFilter - } - qCreatedAfterFilter := qrCreatedAfterFilter.String() - if qCreatedAfterFilter != "" { - - if err := r.SetQueryParam("createdAfterFilter", qCreatedAfterFilter); err != nil { - return err - } - } - } - - if o.CreatedBeforeFilter != nil { - - // query param createdBeforeFilter - var qrCreatedBeforeFilter strfmt.DateTime - - if o.CreatedBeforeFilter != nil { - qrCreatedBeforeFilter = *o.CreatedBeforeFilter - } - qCreatedBeforeFilter := qrCreatedBeforeFilter.String() - if qCreatedBeforeFilter != "" { - - if err := r.SetQueryParam("createdBeforeFilter", qCreatedBeforeFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.PlatformIDFilter != nil { - - // query param platformIdFilter - var qrPlatformIDFilter strfmt.UUID - - if o.PlatformIDFilter != nil { - qrPlatformIDFilter = *o.PlatformIDFilter - } - qPlatformIDFilter := qrPlatformIDFilter.String() - if qPlatformIDFilter != "" { - - if err := r.SetQueryParam("platformIdFilter", qPlatformIDFilter); err != nil { - return err - } - } - } - - if o.PlatformNameFilter != nil { - - // query param platformNameFilter - var qrPlatformNameFilter string - - if o.PlatformNameFilter != nil { - qrPlatformNameFilter = *o.PlatformNameFilter - } - qPlatformNameFilter := qrPlatformNameFilter - if qPlatformNameFilter != "" { - - if err := r.SetQueryParam("platformNameFilter", qPlatformNameFilter); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/object_restore_points/get_all_object_restore_points_responses.go b/client/object_restore_points/get_all_object_restore_points_responses.go deleted file mode 100644 index 25f407e..0000000 --- a/client/object_restore_points/get_all_object_restore_points_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_restore_points - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllObjectRestorePointsReader is a Reader for the GetAllObjectRestorePoints structure. -type GetAllObjectRestorePointsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllObjectRestorePointsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllObjectRestorePointsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllObjectRestorePointsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllObjectRestorePointsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllObjectRestorePointsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllObjectRestorePointsOK creates a GetAllObjectRestorePointsOK with default headers values -func NewGetAllObjectRestorePointsOK() *GetAllObjectRestorePointsOK { - return &GetAllObjectRestorePointsOK{} -} - -/* GetAllObjectRestorePointsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllObjectRestorePointsOK struct { - Payload *models.ObjectRestorePointsResult -} - -func (o *GetAllObjectRestorePointsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints][%d] getAllObjectRestorePointsOK %+v", 200, o.Payload) -} -func (o *GetAllObjectRestorePointsOK) GetPayload() *models.ObjectRestorePointsResult { - return o.Payload -} - -func (o *GetAllObjectRestorePointsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ObjectRestorePointsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllObjectRestorePointsUnauthorized creates a GetAllObjectRestorePointsUnauthorized with default headers values -func NewGetAllObjectRestorePointsUnauthorized() *GetAllObjectRestorePointsUnauthorized { - return &GetAllObjectRestorePointsUnauthorized{} -} - -/* GetAllObjectRestorePointsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllObjectRestorePointsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllObjectRestorePointsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints][%d] getAllObjectRestorePointsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllObjectRestorePointsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllObjectRestorePointsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllObjectRestorePointsForbidden creates a GetAllObjectRestorePointsForbidden with default headers values -func NewGetAllObjectRestorePointsForbidden() *GetAllObjectRestorePointsForbidden { - return &GetAllObjectRestorePointsForbidden{} -} - -/* GetAllObjectRestorePointsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllObjectRestorePointsForbidden struct { - Payload *models.Error -} - -func (o *GetAllObjectRestorePointsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints][%d] getAllObjectRestorePointsForbidden %+v", 403, o.Payload) -} -func (o *GetAllObjectRestorePointsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllObjectRestorePointsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllObjectRestorePointsInternalServerError creates a GetAllObjectRestorePointsInternalServerError with default headers values -func NewGetAllObjectRestorePointsInternalServerError() *GetAllObjectRestorePointsInternalServerError { - return &GetAllObjectRestorePointsInternalServerError{} -} - -/* GetAllObjectRestorePointsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllObjectRestorePointsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllObjectRestorePointsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints][%d] getAllObjectRestorePointsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllObjectRestorePointsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllObjectRestorePointsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/object_restore_points/get_object_restore_point_disks_parameters.go b/client/object_restore_points/get_object_restore_point_disks_parameters.go deleted file mode 100644 index 29d56f7..0000000 --- a/client/object_restore_points/get_object_restore_point_disks_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_restore_points - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetObjectRestorePointDisksParams creates a new GetObjectRestorePointDisksParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetObjectRestorePointDisksParams() *GetObjectRestorePointDisksParams { - return &GetObjectRestorePointDisksParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetObjectRestorePointDisksParamsWithTimeout creates a new GetObjectRestorePointDisksParams object -// with the ability to set a timeout on a request. -func NewGetObjectRestorePointDisksParamsWithTimeout(timeout time.Duration) *GetObjectRestorePointDisksParams { - return &GetObjectRestorePointDisksParams{ - timeout: timeout, - } -} - -// NewGetObjectRestorePointDisksParamsWithContext creates a new GetObjectRestorePointDisksParams object -// with the ability to set a context for a request. -func NewGetObjectRestorePointDisksParamsWithContext(ctx context.Context) *GetObjectRestorePointDisksParams { - return &GetObjectRestorePointDisksParams{ - Context: ctx, - } -} - -// NewGetObjectRestorePointDisksParamsWithHTTPClient creates a new GetObjectRestorePointDisksParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetObjectRestorePointDisksParamsWithHTTPClient(client *http.Client) *GetObjectRestorePointDisksParams { - return &GetObjectRestorePointDisksParams{ - HTTPClient: client, - } -} - -/* GetObjectRestorePointDisksParams contains all the parameters to send to the API endpoint - for the get object restore point disks operation. - - Typically these are written to a http.Request. -*/ -type GetObjectRestorePointDisksParams struct { - - /* ID. - - ID of the restore point. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get object restore point disks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetObjectRestorePointDisksParams) WithDefaults() *GetObjectRestorePointDisksParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get object restore point disks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetObjectRestorePointDisksParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetObjectRestorePointDisksParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) WithTimeout(timeout time.Duration) *GetObjectRestorePointDisksParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) WithContext(ctx context.Context) *GetObjectRestorePointDisksParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) WithHTTPClient(client *http.Client) *GetObjectRestorePointDisksParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) WithID(id strfmt.UUID) *GetObjectRestorePointDisksParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) WithXAPIVersion(xAPIVersion string) *GetObjectRestorePointDisksParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get object restore point disks params -func (o *GetObjectRestorePointDisksParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetObjectRestorePointDisksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/object_restore_points/get_object_restore_point_disks_responses.go b/client/object_restore_points/get_object_restore_point_disks_responses.go deleted file mode 100644 index 1516b5d..0000000 --- a/client/object_restore_points/get_object_restore_point_disks_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_restore_points - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetObjectRestorePointDisksReader is a Reader for the GetObjectRestorePointDisks structure. -type GetObjectRestorePointDisksReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetObjectRestorePointDisksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetObjectRestorePointDisksOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetObjectRestorePointDisksUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetObjectRestorePointDisksForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetObjectRestorePointDisksNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetObjectRestorePointDisksInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetObjectRestorePointDisksOK creates a GetObjectRestorePointDisksOK with default headers values -func NewGetObjectRestorePointDisksOK() *GetObjectRestorePointDisksOK { - return &GetObjectRestorePointDisksOK{} -} - -/* GetObjectRestorePointDisksOK describes a response with status code 200, with default header values. - -OK -*/ -type GetObjectRestorePointDisksOK struct { - Payload *models.ObjectRestorePointDisksResult -} - -func (o *GetObjectRestorePointDisksOK) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}/disks][%d] getObjectRestorePointDisksOK %+v", 200, o.Payload) -} -func (o *GetObjectRestorePointDisksOK) GetPayload() *models.ObjectRestorePointDisksResult { - return o.Payload -} - -func (o *GetObjectRestorePointDisksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ObjectRestorePointDisksResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectRestorePointDisksUnauthorized creates a GetObjectRestorePointDisksUnauthorized with default headers values -func NewGetObjectRestorePointDisksUnauthorized() *GetObjectRestorePointDisksUnauthorized { - return &GetObjectRestorePointDisksUnauthorized{} -} - -/* GetObjectRestorePointDisksUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetObjectRestorePointDisksUnauthorized struct { - Payload *models.Error -} - -func (o *GetObjectRestorePointDisksUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}/disks][%d] getObjectRestorePointDisksUnauthorized %+v", 401, o.Payload) -} -func (o *GetObjectRestorePointDisksUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetObjectRestorePointDisksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectRestorePointDisksForbidden creates a GetObjectRestorePointDisksForbidden with default headers values -func NewGetObjectRestorePointDisksForbidden() *GetObjectRestorePointDisksForbidden { - return &GetObjectRestorePointDisksForbidden{} -} - -/* GetObjectRestorePointDisksForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetObjectRestorePointDisksForbidden struct { - Payload *models.Error -} - -func (o *GetObjectRestorePointDisksForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}/disks][%d] getObjectRestorePointDisksForbidden %+v", 403, o.Payload) -} -func (o *GetObjectRestorePointDisksForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetObjectRestorePointDisksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectRestorePointDisksNotFound creates a GetObjectRestorePointDisksNotFound with default headers values -func NewGetObjectRestorePointDisksNotFound() *GetObjectRestorePointDisksNotFound { - return &GetObjectRestorePointDisksNotFound{} -} - -/* GetObjectRestorePointDisksNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetObjectRestorePointDisksNotFound struct { - Payload *models.Error -} - -func (o *GetObjectRestorePointDisksNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}/disks][%d] getObjectRestorePointDisksNotFound %+v", 404, o.Payload) -} -func (o *GetObjectRestorePointDisksNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetObjectRestorePointDisksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectRestorePointDisksInternalServerError creates a GetObjectRestorePointDisksInternalServerError with default headers values -func NewGetObjectRestorePointDisksInternalServerError() *GetObjectRestorePointDisksInternalServerError { - return &GetObjectRestorePointDisksInternalServerError{} -} - -/* GetObjectRestorePointDisksInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetObjectRestorePointDisksInternalServerError struct { - Payload *models.Error -} - -func (o *GetObjectRestorePointDisksInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}/disks][%d] getObjectRestorePointDisksInternalServerError %+v", 500, o.Payload) -} -func (o *GetObjectRestorePointDisksInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetObjectRestorePointDisksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/object_restore_points/get_object_restore_point_parameters.go b/client/object_restore_points/get_object_restore_point_parameters.go deleted file mode 100644 index 4a8f247..0000000 --- a/client/object_restore_points/get_object_restore_point_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_restore_points - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetObjectRestorePointParams creates a new GetObjectRestorePointParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetObjectRestorePointParams() *GetObjectRestorePointParams { - return &GetObjectRestorePointParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetObjectRestorePointParamsWithTimeout creates a new GetObjectRestorePointParams object -// with the ability to set a timeout on a request. -func NewGetObjectRestorePointParamsWithTimeout(timeout time.Duration) *GetObjectRestorePointParams { - return &GetObjectRestorePointParams{ - timeout: timeout, - } -} - -// NewGetObjectRestorePointParamsWithContext creates a new GetObjectRestorePointParams object -// with the ability to set a context for a request. -func NewGetObjectRestorePointParamsWithContext(ctx context.Context) *GetObjectRestorePointParams { - return &GetObjectRestorePointParams{ - Context: ctx, - } -} - -// NewGetObjectRestorePointParamsWithHTTPClient creates a new GetObjectRestorePointParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetObjectRestorePointParamsWithHTTPClient(client *http.Client) *GetObjectRestorePointParams { - return &GetObjectRestorePointParams{ - HTTPClient: client, - } -} - -/* GetObjectRestorePointParams contains all the parameters to send to the API endpoint - for the get object restore point operation. - - Typically these are written to a http.Request. -*/ -type GetObjectRestorePointParams struct { - - /* ID. - - ID of the restore point. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get object restore point params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetObjectRestorePointParams) WithDefaults() *GetObjectRestorePointParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get object restore point params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetObjectRestorePointParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetObjectRestorePointParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get object restore point params -func (o *GetObjectRestorePointParams) WithTimeout(timeout time.Duration) *GetObjectRestorePointParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get object restore point params -func (o *GetObjectRestorePointParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get object restore point params -func (o *GetObjectRestorePointParams) WithContext(ctx context.Context) *GetObjectRestorePointParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get object restore point params -func (o *GetObjectRestorePointParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get object restore point params -func (o *GetObjectRestorePointParams) WithHTTPClient(client *http.Client) *GetObjectRestorePointParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get object restore point params -func (o *GetObjectRestorePointParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get object restore point params -func (o *GetObjectRestorePointParams) WithID(id strfmt.UUID) *GetObjectRestorePointParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get object restore point params -func (o *GetObjectRestorePointParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get object restore point params -func (o *GetObjectRestorePointParams) WithXAPIVersion(xAPIVersion string) *GetObjectRestorePointParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get object restore point params -func (o *GetObjectRestorePointParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetObjectRestorePointParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/object_restore_points/get_object_restore_point_responses.go b/client/object_restore_points/get_object_restore_point_responses.go deleted file mode 100644 index d4db7e0..0000000 --- a/client/object_restore_points/get_object_restore_point_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_restore_points - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetObjectRestorePointReader is a Reader for the GetObjectRestorePoint structure. -type GetObjectRestorePointReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetObjectRestorePointReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetObjectRestorePointOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetObjectRestorePointUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetObjectRestorePointForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetObjectRestorePointNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetObjectRestorePointInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetObjectRestorePointOK creates a GetObjectRestorePointOK with default headers values -func NewGetObjectRestorePointOK() *GetObjectRestorePointOK { - return &GetObjectRestorePointOK{} -} - -/* GetObjectRestorePointOK describes a response with status code 200, with default header values. - -OK -*/ -type GetObjectRestorePointOK struct { - Payload *models.ObjectRestorePointModel -} - -func (o *GetObjectRestorePointOK) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}][%d] getObjectRestorePointOK %+v", 200, o.Payload) -} -func (o *GetObjectRestorePointOK) GetPayload() *models.ObjectRestorePointModel { - return o.Payload -} - -func (o *GetObjectRestorePointOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ObjectRestorePointModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectRestorePointUnauthorized creates a GetObjectRestorePointUnauthorized with default headers values -func NewGetObjectRestorePointUnauthorized() *GetObjectRestorePointUnauthorized { - return &GetObjectRestorePointUnauthorized{} -} - -/* GetObjectRestorePointUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetObjectRestorePointUnauthorized struct { - Payload *models.Error -} - -func (o *GetObjectRestorePointUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}][%d] getObjectRestorePointUnauthorized %+v", 401, o.Payload) -} -func (o *GetObjectRestorePointUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetObjectRestorePointUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectRestorePointForbidden creates a GetObjectRestorePointForbidden with default headers values -func NewGetObjectRestorePointForbidden() *GetObjectRestorePointForbidden { - return &GetObjectRestorePointForbidden{} -} - -/* GetObjectRestorePointForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetObjectRestorePointForbidden struct { - Payload *models.Error -} - -func (o *GetObjectRestorePointForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}][%d] getObjectRestorePointForbidden %+v", 403, o.Payload) -} -func (o *GetObjectRestorePointForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetObjectRestorePointForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectRestorePointNotFound creates a GetObjectRestorePointNotFound with default headers values -func NewGetObjectRestorePointNotFound() *GetObjectRestorePointNotFound { - return &GetObjectRestorePointNotFound{} -} - -/* GetObjectRestorePointNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetObjectRestorePointNotFound struct { - Payload *models.Error -} - -func (o *GetObjectRestorePointNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}][%d] getObjectRestorePointNotFound %+v", 404, o.Payload) -} -func (o *GetObjectRestorePointNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetObjectRestorePointNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectRestorePointInternalServerError creates a GetObjectRestorePointInternalServerError with default headers values -func NewGetObjectRestorePointInternalServerError() *GetObjectRestorePointInternalServerError { - return &GetObjectRestorePointInternalServerError{} -} - -/* GetObjectRestorePointInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetObjectRestorePointInternalServerError struct { - Payload *models.Error -} - -func (o *GetObjectRestorePointInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/objectRestorePoints/{id}][%d] getObjectRestorePointInternalServerError %+v", 500, o.Payload) -} -func (o *GetObjectRestorePointInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetObjectRestorePointInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/object_restore_points/object_restore_points_client.go b/client/object_restore_points/object_restore_points_client.go deleted file mode 100644 index 20cdcd7..0000000 --- a/client/object_restore_points/object_restore_points_client.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_restore_points - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new object restore points API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for object restore points API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetAllObjectRestorePoints(params *GetAllObjectRestorePointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllObjectRestorePointsOK, error) - - GetObjectRestorePoint(params *GetObjectRestorePointParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetObjectRestorePointOK, error) - - GetObjectRestorePointDisks(params *GetObjectRestorePointDisksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetObjectRestorePointDisksOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAllObjectRestorePoints gets all restore points - - The HTTP GET request to the `/api/v1/objectRestorePoints` path allows you to get an array of all restore points created on the backup server. -*/ -func (a *Client) GetAllObjectRestorePoints(params *GetAllObjectRestorePointsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllObjectRestorePointsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllObjectRestorePointsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllObjectRestorePoints", - Method: "GET", - PathPattern: "/api/v1/objectRestorePoints", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllObjectRestorePointsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllObjectRestorePointsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllObjectRestorePoints: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetObjectRestorePoint gets restore point - - The HTTP GET request to the `/api/v1/objectRestorePoints/{id}` path allows you to get a restore point that has the specified `id`. -*/ -func (a *Client) GetObjectRestorePoint(params *GetObjectRestorePointParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetObjectRestorePointOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetObjectRestorePointParams() - } - op := &runtime.ClientOperation{ - ID: "GetObjectRestorePoint", - Method: "GET", - PathPattern: "/api/v1/objectRestorePoints/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetObjectRestorePointReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetObjectRestorePointOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetObjectRestorePoint: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetObjectRestorePointDisks gets restore point disks - - The HTTP GET request to the `/api/v1/objectRestorePoints/{id}/disks` path allows you to get an array of disks from a restore point that has the specified `id`. -*/ -func (a *Client) GetObjectRestorePointDisks(params *GetObjectRestorePointDisksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetObjectRestorePointDisksOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetObjectRestorePointDisksParams() - } - op := &runtime.ClientOperation{ - ID: "GetObjectRestorePointDisks", - Method: "GET", - PathPattern: "/api/v1/objectRestorePoints/{id}/disks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetObjectRestorePointDisksReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetObjectRestorePointDisksOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetObjectRestorePointDisks: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/proxies/create_proxy_parameters.go b/client/proxies/create_proxy_parameters.go deleted file mode 100644 index 52e93ea..0000000 --- a/client/proxies/create_proxy_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewCreateProxyParams creates a new CreateProxyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateProxyParams() *CreateProxyParams { - return &CreateProxyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateProxyParamsWithTimeout creates a new CreateProxyParams object -// with the ability to set a timeout on a request. -func NewCreateProxyParamsWithTimeout(timeout time.Duration) *CreateProxyParams { - return &CreateProxyParams{ - timeout: timeout, - } -} - -// NewCreateProxyParamsWithContext creates a new CreateProxyParams object -// with the ability to set a context for a request. -func NewCreateProxyParamsWithContext(ctx context.Context) *CreateProxyParams { - return &CreateProxyParams{ - Context: ctx, - } -} - -// NewCreateProxyParamsWithHTTPClient creates a new CreateProxyParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateProxyParamsWithHTTPClient(client *http.Client) *CreateProxyParams { - return &CreateProxyParams{ - HTTPClient: client, - } -} - -/* CreateProxyParams contains all the parameters to send to the API endpoint - for the create proxy operation. - - Typically these are written to a http.Request. -*/ -type CreateProxyParams struct { - - // Body. - Body *models.ProxySpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create proxy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateProxyParams) WithDefaults() *CreateProxyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create proxy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateProxyParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := CreateProxyParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create proxy params -func (o *CreateProxyParams) WithTimeout(timeout time.Duration) *CreateProxyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create proxy params -func (o *CreateProxyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create proxy params -func (o *CreateProxyParams) WithContext(ctx context.Context) *CreateProxyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create proxy params -func (o *CreateProxyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create proxy params -func (o *CreateProxyParams) WithHTTPClient(client *http.Client) *CreateProxyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create proxy params -func (o *CreateProxyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create proxy params -func (o *CreateProxyParams) WithBody(body *models.ProxySpec) *CreateProxyParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create proxy params -func (o *CreateProxyParams) SetBody(body *models.ProxySpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the create proxy params -func (o *CreateProxyParams) WithXAPIVersion(xAPIVersion string) *CreateProxyParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the create proxy params -func (o *CreateProxyParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateProxyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/proxies/create_proxy_responses.go b/client/proxies/create_proxy_responses.go deleted file mode 100644 index 0335731..0000000 --- a/client/proxies/create_proxy_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// CreateProxyReader is a Reader for the CreateProxy structure. -type CreateProxyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateProxyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateProxyCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateProxyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateProxyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateProxyForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateProxyInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateProxyCreated creates a CreateProxyCreated with default headers values -func NewCreateProxyCreated() *CreateProxyCreated { - return &CreateProxyCreated{} -} - -/* CreateProxyCreated describes a response with status code 201, with default header values. - -Infrastructure session has been created to add the proxy. To check the progress, track the session `state`. -*/ -type CreateProxyCreated struct { - Payload *models.SessionModel -} - -func (o *CreateProxyCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/proxies][%d] createProxyCreated %+v", 201, o.Payload) -} -func (o *CreateProxyCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *CreateProxyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateProxyBadRequest creates a CreateProxyBadRequest with default headers values -func NewCreateProxyBadRequest() *CreateProxyBadRequest { - return &CreateProxyBadRequest{} -} - -/* CreateProxyBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type CreateProxyBadRequest struct { - Payload *models.Error -} - -func (o *CreateProxyBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/proxies][%d] createProxyBadRequest %+v", 400, o.Payload) -} -func (o *CreateProxyBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateProxyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateProxyUnauthorized creates a CreateProxyUnauthorized with default headers values -func NewCreateProxyUnauthorized() *CreateProxyUnauthorized { - return &CreateProxyUnauthorized{} -} - -/* CreateProxyUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type CreateProxyUnauthorized struct { - Payload *models.Error -} - -func (o *CreateProxyUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/proxies][%d] createProxyUnauthorized %+v", 401, o.Payload) -} -func (o *CreateProxyUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateProxyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateProxyForbidden creates a CreateProxyForbidden with default headers values -func NewCreateProxyForbidden() *CreateProxyForbidden { - return &CreateProxyForbidden{} -} - -/* CreateProxyForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type CreateProxyForbidden struct { - Payload *models.Error -} - -func (o *CreateProxyForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/proxies][%d] createProxyForbidden %+v", 403, o.Payload) -} -func (o *CreateProxyForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateProxyForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateProxyInternalServerError creates a CreateProxyInternalServerError with default headers values -func NewCreateProxyInternalServerError() *CreateProxyInternalServerError { - return &CreateProxyInternalServerError{} -} - -/* CreateProxyInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type CreateProxyInternalServerError struct { - Payload *models.Error -} - -func (o *CreateProxyInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/proxies][%d] createProxyInternalServerError %+v", 500, o.Payload) -} -func (o *CreateProxyInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateProxyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/proxies/delete_proxy_parameters.go b/client/proxies/delete_proxy_parameters.go deleted file mode 100644 index 691164a..0000000 --- a/client/proxies/delete_proxy_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteProxyParams creates a new DeleteProxyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteProxyParams() *DeleteProxyParams { - return &DeleteProxyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteProxyParamsWithTimeout creates a new DeleteProxyParams object -// with the ability to set a timeout on a request. -func NewDeleteProxyParamsWithTimeout(timeout time.Duration) *DeleteProxyParams { - return &DeleteProxyParams{ - timeout: timeout, - } -} - -// NewDeleteProxyParamsWithContext creates a new DeleteProxyParams object -// with the ability to set a context for a request. -func NewDeleteProxyParamsWithContext(ctx context.Context) *DeleteProxyParams { - return &DeleteProxyParams{ - Context: ctx, - } -} - -// NewDeleteProxyParamsWithHTTPClient creates a new DeleteProxyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteProxyParamsWithHTTPClient(client *http.Client) *DeleteProxyParams { - return &DeleteProxyParams{ - HTTPClient: client, - } -} - -/* DeleteProxyParams contains all the parameters to send to the API endpoint - for the delete proxy operation. - - Typically these are written to a http.Request. -*/ -type DeleteProxyParams struct { - - /* ID. - - ID of the backup proxy. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete proxy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteProxyParams) WithDefaults() *DeleteProxyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete proxy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteProxyParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := DeleteProxyParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the delete proxy params -func (o *DeleteProxyParams) WithTimeout(timeout time.Duration) *DeleteProxyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete proxy params -func (o *DeleteProxyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete proxy params -func (o *DeleteProxyParams) WithContext(ctx context.Context) *DeleteProxyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete proxy params -func (o *DeleteProxyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete proxy params -func (o *DeleteProxyParams) WithHTTPClient(client *http.Client) *DeleteProxyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete proxy params -func (o *DeleteProxyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete proxy params -func (o *DeleteProxyParams) WithID(id strfmt.UUID) *DeleteProxyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete proxy params -func (o *DeleteProxyParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the delete proxy params -func (o *DeleteProxyParams) WithXAPIVersion(xAPIVersion string) *DeleteProxyParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the delete proxy params -func (o *DeleteProxyParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteProxyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/proxies/delete_proxy_responses.go b/client/proxies/delete_proxy_responses.go deleted file mode 100644 index 4588aca..0000000 --- a/client/proxies/delete_proxy_responses.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// DeleteProxyReader is a Reader for the DeleteProxy structure. -type DeleteProxyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteProxyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteProxyNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteProxyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteProxyForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteProxyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteProxyInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteProxyNoContent creates a DeleteProxyNoContent with default headers values -func NewDeleteProxyNoContent() *DeleteProxyNoContent { - return &DeleteProxyNoContent{} -} - -/* DeleteProxyNoContent describes a response with status code 204, with default header values. - -Removed. -*/ -type DeleteProxyNoContent struct { - Payload models.EmptySuccessResponse -} - -func (o *DeleteProxyNoContent) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/proxies/{id}][%d] deleteProxyNoContent %+v", 204, o.Payload) -} -func (o *DeleteProxyNoContent) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *DeleteProxyNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteProxyUnauthorized creates a DeleteProxyUnauthorized with default headers values -func NewDeleteProxyUnauthorized() *DeleteProxyUnauthorized { - return &DeleteProxyUnauthorized{} -} - -/* DeleteProxyUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type DeleteProxyUnauthorized struct { - Payload *models.Error -} - -func (o *DeleteProxyUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/proxies/{id}][%d] deleteProxyUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteProxyUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteProxyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteProxyForbidden creates a DeleteProxyForbidden with default headers values -func NewDeleteProxyForbidden() *DeleteProxyForbidden { - return &DeleteProxyForbidden{} -} - -/* DeleteProxyForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type DeleteProxyForbidden struct { - Payload *models.Error -} - -func (o *DeleteProxyForbidden) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/proxies/{id}][%d] deleteProxyForbidden %+v", 403, o.Payload) -} -func (o *DeleteProxyForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteProxyForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteProxyNotFound creates a DeleteProxyNotFound with default headers values -func NewDeleteProxyNotFound() *DeleteProxyNotFound { - return &DeleteProxyNotFound{} -} - -/* DeleteProxyNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type DeleteProxyNotFound struct { - Payload *models.Error -} - -func (o *DeleteProxyNotFound) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/proxies/{id}][%d] deleteProxyNotFound %+v", 404, o.Payload) -} -func (o *DeleteProxyNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteProxyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteProxyInternalServerError creates a DeleteProxyInternalServerError with default headers values -func NewDeleteProxyInternalServerError() *DeleteProxyInternalServerError { - return &DeleteProxyInternalServerError{} -} - -/* DeleteProxyInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type DeleteProxyInternalServerError struct { - Payload *models.Error -} - -func (o *DeleteProxyInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/proxies/{id}][%d] deleteProxyInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteProxyInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteProxyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/proxies/get_all_proxies_parameters.go b/client/proxies/get_all_proxies_parameters.go deleted file mode 100644 index 39c381e..0000000 --- a/client/proxies/get_all_proxies_parameters.go +++ /dev/null @@ -1,409 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllProxiesParams creates a new GetAllProxiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllProxiesParams() *GetAllProxiesParams { - return &GetAllProxiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllProxiesParamsWithTimeout creates a new GetAllProxiesParams object -// with the ability to set a timeout on a request. -func NewGetAllProxiesParamsWithTimeout(timeout time.Duration) *GetAllProxiesParams { - return &GetAllProxiesParams{ - timeout: timeout, - } -} - -// NewGetAllProxiesParamsWithContext creates a new GetAllProxiesParams object -// with the ability to set a context for a request. -func NewGetAllProxiesParamsWithContext(ctx context.Context) *GetAllProxiesParams { - return &GetAllProxiesParams{ - Context: ctx, - } -} - -// NewGetAllProxiesParamsWithHTTPClient creates a new GetAllProxiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllProxiesParamsWithHTTPClient(client *http.Client) *GetAllProxiesParams { - return &GetAllProxiesParams{ - HTTPClient: client, - } -} - -/* GetAllProxiesParams contains all the parameters to send to the API endpoint - for the get all proxies operation. - - Typically these are written to a http.Request. -*/ -type GetAllProxiesParams struct { - - /* HostIDFilter. - - Filters proxies by ID of the backup server. - - Format: uuid - */ - HostIDFilter *strfmt.UUID - - /* Limit. - - Maximum number of proxies to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters proxies by the `nameFilter` pattern. The pattern can match any proxy parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts proxies in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts proxies by one of the proxy parameters. - */ - OrderColumn *string - - /* Skip. - - Number of proxies to skip. - - Format: int32 - */ - Skip *int32 - - /* TypeFilter. - - Filters proxies by proxy type. - */ - TypeFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all proxies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllProxiesParams) WithDefaults() *GetAllProxiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all proxies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllProxiesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllProxiesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all proxies params -func (o *GetAllProxiesParams) WithTimeout(timeout time.Duration) *GetAllProxiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all proxies params -func (o *GetAllProxiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all proxies params -func (o *GetAllProxiesParams) WithContext(ctx context.Context) *GetAllProxiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all proxies params -func (o *GetAllProxiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all proxies params -func (o *GetAllProxiesParams) WithHTTPClient(client *http.Client) *GetAllProxiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all proxies params -func (o *GetAllProxiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostIDFilter adds the hostIDFilter to the get all proxies params -func (o *GetAllProxiesParams) WithHostIDFilter(hostIDFilter *strfmt.UUID) *GetAllProxiesParams { - o.SetHostIDFilter(hostIDFilter) - return o -} - -// SetHostIDFilter adds the hostIdFilter to the get all proxies params -func (o *GetAllProxiesParams) SetHostIDFilter(hostIDFilter *strfmt.UUID) { - o.HostIDFilter = hostIDFilter -} - -// WithLimit adds the limit to the get all proxies params -func (o *GetAllProxiesParams) WithLimit(limit *int32) *GetAllProxiesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all proxies params -func (o *GetAllProxiesParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all proxies params -func (o *GetAllProxiesParams) WithNameFilter(nameFilter *string) *GetAllProxiesParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all proxies params -func (o *GetAllProxiesParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all proxies params -func (o *GetAllProxiesParams) WithOrderAsc(orderAsc *bool) *GetAllProxiesParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all proxies params -func (o *GetAllProxiesParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all proxies params -func (o *GetAllProxiesParams) WithOrderColumn(orderColumn *string) *GetAllProxiesParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all proxies params -func (o *GetAllProxiesParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all proxies params -func (o *GetAllProxiesParams) WithSkip(skip *int32) *GetAllProxiesParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all proxies params -func (o *GetAllProxiesParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithTypeFilter adds the typeFilter to the get all proxies params -func (o *GetAllProxiesParams) WithTypeFilter(typeFilter *string) *GetAllProxiesParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all proxies params -func (o *GetAllProxiesParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all proxies params -func (o *GetAllProxiesParams) WithXAPIVersion(xAPIVersion string) *GetAllProxiesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all proxies params -func (o *GetAllProxiesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllProxiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.HostIDFilter != nil { - - // query param hostIdFilter - var qrHostIDFilter strfmt.UUID - - if o.HostIDFilter != nil { - qrHostIDFilter = *o.HostIDFilter - } - qHostIDFilter := qrHostIDFilter.String() - if qHostIDFilter != "" { - - if err := r.SetQueryParam("hostIdFilter", qHostIDFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/proxies/get_all_proxies_responses.go b/client/proxies/get_all_proxies_responses.go deleted file mode 100644 index 03bc315..0000000 --- a/client/proxies/get_all_proxies_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllProxiesReader is a Reader for the GetAllProxies structure. -type GetAllProxiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllProxiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllProxiesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllProxiesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllProxiesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllProxiesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllProxiesOK creates a GetAllProxiesOK with default headers values -func NewGetAllProxiesOK() *GetAllProxiesOK { - return &GetAllProxiesOK{} -} - -/* GetAllProxiesOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllProxiesOK struct { - Payload *models.ProxiesResult -} - -func (o *GetAllProxiesOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies][%d] getAllProxiesOK %+v", 200, o.Payload) -} -func (o *GetAllProxiesOK) GetPayload() *models.ProxiesResult { - return o.Payload -} - -func (o *GetAllProxiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ProxiesResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllProxiesUnauthorized creates a GetAllProxiesUnauthorized with default headers values -func NewGetAllProxiesUnauthorized() *GetAllProxiesUnauthorized { - return &GetAllProxiesUnauthorized{} -} - -/* GetAllProxiesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllProxiesUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllProxiesUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies][%d] getAllProxiesUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllProxiesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllProxiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllProxiesForbidden creates a GetAllProxiesForbidden with default headers values -func NewGetAllProxiesForbidden() *GetAllProxiesForbidden { - return &GetAllProxiesForbidden{} -} - -/* GetAllProxiesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllProxiesForbidden struct { - Payload *models.Error -} - -func (o *GetAllProxiesForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies][%d] getAllProxiesForbidden %+v", 403, o.Payload) -} -func (o *GetAllProxiesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllProxiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllProxiesInternalServerError creates a GetAllProxiesInternalServerError with default headers values -func NewGetAllProxiesInternalServerError() *GetAllProxiesInternalServerError { - return &GetAllProxiesInternalServerError{} -} - -/* GetAllProxiesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllProxiesInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllProxiesInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies][%d] getAllProxiesInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllProxiesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllProxiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/proxies/get_proxy_parameters.go b/client/proxies/get_proxy_parameters.go deleted file mode 100644 index 51a8f3c..0000000 --- a/client/proxies/get_proxy_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetProxyParams creates a new GetProxyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetProxyParams() *GetProxyParams { - return &GetProxyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetProxyParamsWithTimeout creates a new GetProxyParams object -// with the ability to set a timeout on a request. -func NewGetProxyParamsWithTimeout(timeout time.Duration) *GetProxyParams { - return &GetProxyParams{ - timeout: timeout, - } -} - -// NewGetProxyParamsWithContext creates a new GetProxyParams object -// with the ability to set a context for a request. -func NewGetProxyParamsWithContext(ctx context.Context) *GetProxyParams { - return &GetProxyParams{ - Context: ctx, - } -} - -// NewGetProxyParamsWithHTTPClient creates a new GetProxyParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetProxyParamsWithHTTPClient(client *http.Client) *GetProxyParams { - return &GetProxyParams{ - HTTPClient: client, - } -} - -/* GetProxyParams contains all the parameters to send to the API endpoint - for the get proxy operation. - - Typically these are written to a http.Request. -*/ -type GetProxyParams struct { - - /* ID. - - ID of the backup proxy. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get proxy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetProxyParams) WithDefaults() *GetProxyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get proxy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetProxyParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetProxyParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get proxy params -func (o *GetProxyParams) WithTimeout(timeout time.Duration) *GetProxyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get proxy params -func (o *GetProxyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get proxy params -func (o *GetProxyParams) WithContext(ctx context.Context) *GetProxyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get proxy params -func (o *GetProxyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get proxy params -func (o *GetProxyParams) WithHTTPClient(client *http.Client) *GetProxyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get proxy params -func (o *GetProxyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get proxy params -func (o *GetProxyParams) WithID(id strfmt.UUID) *GetProxyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get proxy params -func (o *GetProxyParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get proxy params -func (o *GetProxyParams) WithXAPIVersion(xAPIVersion string) *GetProxyParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get proxy params -func (o *GetProxyParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetProxyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/proxies/get_proxy_responses.go b/client/proxies/get_proxy_responses.go deleted file mode 100644 index e41334c..0000000 --- a/client/proxies/get_proxy_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetProxyReader is a Reader for the GetProxy structure. -type GetProxyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetProxyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetProxyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetProxyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetProxyForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetProxyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetProxyInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetProxyOK creates a GetProxyOK with default headers values -func NewGetProxyOK() *GetProxyOK { - return &GetProxyOK{} -} - -/* GetProxyOK describes a response with status code 200, with default header values. - -OK -*/ -type GetProxyOK struct { - Payload *models.ProxyModel -} - -func (o *GetProxyOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies/{id}][%d] getProxyOK %+v", 200, o.Payload) -} -func (o *GetProxyOK) GetPayload() *models.ProxyModel { - return o.Payload -} - -func (o *GetProxyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ProxyModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetProxyUnauthorized creates a GetProxyUnauthorized with default headers values -func NewGetProxyUnauthorized() *GetProxyUnauthorized { - return &GetProxyUnauthorized{} -} - -/* GetProxyUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetProxyUnauthorized struct { - Payload *models.Error -} - -func (o *GetProxyUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies/{id}][%d] getProxyUnauthorized %+v", 401, o.Payload) -} -func (o *GetProxyUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetProxyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetProxyForbidden creates a GetProxyForbidden with default headers values -func NewGetProxyForbidden() *GetProxyForbidden { - return &GetProxyForbidden{} -} - -/* GetProxyForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetProxyForbidden struct { - Payload *models.Error -} - -func (o *GetProxyForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies/{id}][%d] getProxyForbidden %+v", 403, o.Payload) -} -func (o *GetProxyForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetProxyForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetProxyNotFound creates a GetProxyNotFound with default headers values -func NewGetProxyNotFound() *GetProxyNotFound { - return &GetProxyNotFound{} -} - -/* GetProxyNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetProxyNotFound struct { - Payload *models.Error -} - -func (o *GetProxyNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies/{id}][%d] getProxyNotFound %+v", 404, o.Payload) -} -func (o *GetProxyNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetProxyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetProxyInternalServerError creates a GetProxyInternalServerError with default headers values -func NewGetProxyInternalServerError() *GetProxyInternalServerError { - return &GetProxyInternalServerError{} -} - -/* GetProxyInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetProxyInternalServerError struct { - Payload *models.Error -} - -func (o *GetProxyInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/proxies/{id}][%d] getProxyInternalServerError %+v", 500, o.Payload) -} -func (o *GetProxyInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetProxyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/proxies/proxies_client.go b/client/proxies/proxies_client.go deleted file mode 100644 index 71a78c1..0000000 --- a/client/proxies/proxies_client.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new proxies API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for proxies API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateProxy(params *CreateProxyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateProxyCreated, error) - - DeleteProxy(params *DeleteProxyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteProxyNoContent, error) - - GetAllProxies(params *GetAllProxiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllProxiesOK, error) - - GetProxy(params *GetProxyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProxyOK, error) - - UpdateProxy(params *UpdateProxyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateProxyCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateProxy adds proxy - - The HTTP POST request to the `/api/v1/backupInfrastructure/proxies` path allows you to add a proxy to the backup infrastructure. -*/ -func (a *Client) CreateProxy(params *CreateProxyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateProxyCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateProxyParams() - } - op := &runtime.ClientOperation{ - ID: "CreateProxy", - Method: "POST", - PathPattern: "/api/v1/backupInfrastructure/proxies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateProxyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateProxyCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateProxy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteProxy removes proxy - - The HTTP DELETE request to the `/api/v1/backupInfrastructure/proxies/{id}` path allows you to remove a backup proxy that has the specified `id` from the backup infrastructure. -*/ -func (a *Client) DeleteProxy(params *DeleteProxyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteProxyNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteProxyParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteProxy", - Method: "DELETE", - PathPattern: "/api/v1/backupInfrastructure/proxies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteProxyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteProxyNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteProxy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllProxies gets all proxies - - The HTTP GET request to the `/api/v1/backupInfrastructure/proxies` path allows you to get an array of all backup proxies that are added to the backup infrastructure. -*/ -func (a *Client) GetAllProxies(params *GetAllProxiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllProxiesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllProxiesParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllProxies", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/proxies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllProxiesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllProxiesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllProxies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetProxy gets proxy - - The HTTP GET request to the `/api/v1/backupInfrastructure/proxies/{id}` path allows you to get a backup proxy that has the specified `id`. -*/ -func (a *Client) GetProxy(params *GetProxyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetProxyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetProxyParams() - } - op := &runtime.ClientOperation{ - ID: "GetProxy", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/proxies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetProxyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetProxyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetProxy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateProxy edits proxy - - The HTTP PUT request to the `/api/v1/backupInfrastructure/proxies/{id}` path allows you to edit a backup proxy that has the specified `id`. -*/ -func (a *Client) UpdateProxy(params *UpdateProxyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateProxyCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateProxyParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateProxy", - Method: "PUT", - PathPattern: "/api/v1/backupInfrastructure/proxies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateProxyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateProxyCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateProxy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/proxies/update_proxy_parameters.go b/client/proxies/update_proxy_parameters.go deleted file mode 100644 index 79ef228..0000000 --- a/client/proxies/update_proxy_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateProxyParams creates a new UpdateProxyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateProxyParams() *UpdateProxyParams { - return &UpdateProxyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateProxyParamsWithTimeout creates a new UpdateProxyParams object -// with the ability to set a timeout on a request. -func NewUpdateProxyParamsWithTimeout(timeout time.Duration) *UpdateProxyParams { - return &UpdateProxyParams{ - timeout: timeout, - } -} - -// NewUpdateProxyParamsWithContext creates a new UpdateProxyParams object -// with the ability to set a context for a request. -func NewUpdateProxyParamsWithContext(ctx context.Context) *UpdateProxyParams { - return &UpdateProxyParams{ - Context: ctx, - } -} - -// NewUpdateProxyParamsWithHTTPClient creates a new UpdateProxyParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateProxyParamsWithHTTPClient(client *http.Client) *UpdateProxyParams { - return &UpdateProxyParams{ - HTTPClient: client, - } -} - -/* UpdateProxyParams contains all the parameters to send to the API endpoint - for the update proxy operation. - - Typically these are written to a http.Request. -*/ -type UpdateProxyParams struct { - - // Body. - Body *models.ProxyModel - - /* ID. - - ID of the backup proxy. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update proxy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateProxyParams) WithDefaults() *UpdateProxyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update proxy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateProxyParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateProxyParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update proxy params -func (o *UpdateProxyParams) WithTimeout(timeout time.Duration) *UpdateProxyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update proxy params -func (o *UpdateProxyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update proxy params -func (o *UpdateProxyParams) WithContext(ctx context.Context) *UpdateProxyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update proxy params -func (o *UpdateProxyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update proxy params -func (o *UpdateProxyParams) WithHTTPClient(client *http.Client) *UpdateProxyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update proxy params -func (o *UpdateProxyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update proxy params -func (o *UpdateProxyParams) WithBody(body *models.ProxyModel) *UpdateProxyParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update proxy params -func (o *UpdateProxyParams) SetBody(body *models.ProxyModel) { - o.Body = body -} - -// WithID adds the id to the update proxy params -func (o *UpdateProxyParams) WithID(id strfmt.UUID) *UpdateProxyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update proxy params -func (o *UpdateProxyParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the update proxy params -func (o *UpdateProxyParams) WithXAPIVersion(xAPIVersion string) *UpdateProxyParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update proxy params -func (o *UpdateProxyParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateProxyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/proxies/update_proxy_responses.go b/client/proxies/update_proxy_responses.go deleted file mode 100644 index a87ec14..0000000 --- a/client/proxies/update_proxy_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package proxies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateProxyReader is a Reader for the UpdateProxy structure. -type UpdateProxyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateProxyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewUpdateProxyCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateProxyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateProxyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateProxyForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateProxyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateProxyInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateProxyCreated creates a UpdateProxyCreated with default headers values -func NewUpdateProxyCreated() *UpdateProxyCreated { - return &UpdateProxyCreated{} -} - -/* UpdateProxyCreated describes a response with status code 201, with default header values. - -Infrastructure session has been created to edit the proxy. To check the progress, track the session `state`. -*/ -type UpdateProxyCreated struct { - Payload *models.SessionModel -} - -func (o *UpdateProxyCreated) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/proxies/{id}][%d] updateProxyCreated %+v", 201, o.Payload) -} -func (o *UpdateProxyCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *UpdateProxyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateProxyBadRequest creates a UpdateProxyBadRequest with default headers values -func NewUpdateProxyBadRequest() *UpdateProxyBadRequest { - return &UpdateProxyBadRequest{} -} - -/* UpdateProxyBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateProxyBadRequest struct { - Payload *models.Error -} - -func (o *UpdateProxyBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/proxies/{id}][%d] updateProxyBadRequest %+v", 400, o.Payload) -} -func (o *UpdateProxyBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateProxyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateProxyUnauthorized creates a UpdateProxyUnauthorized with default headers values -func NewUpdateProxyUnauthorized() *UpdateProxyUnauthorized { - return &UpdateProxyUnauthorized{} -} - -/* UpdateProxyUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateProxyUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateProxyUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/proxies/{id}][%d] updateProxyUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateProxyUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateProxyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateProxyForbidden creates a UpdateProxyForbidden with default headers values -func NewUpdateProxyForbidden() *UpdateProxyForbidden { - return &UpdateProxyForbidden{} -} - -/* UpdateProxyForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateProxyForbidden struct { - Payload *models.Error -} - -func (o *UpdateProxyForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/proxies/{id}][%d] updateProxyForbidden %+v", 403, o.Payload) -} -func (o *UpdateProxyForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateProxyForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateProxyNotFound creates a UpdateProxyNotFound with default headers values -func NewUpdateProxyNotFound() *UpdateProxyNotFound { - return &UpdateProxyNotFound{} -} - -/* UpdateProxyNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type UpdateProxyNotFound struct { - Payload *models.Error -} - -func (o *UpdateProxyNotFound) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/proxies/{id}][%d] updateProxyNotFound %+v", 404, o.Payload) -} -func (o *UpdateProxyNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateProxyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateProxyInternalServerError creates a UpdateProxyInternalServerError with default headers values -func NewUpdateProxyInternalServerError() *UpdateProxyInternalServerError { - return &UpdateProxyInternalServerError{} -} - -/* UpdateProxyInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateProxyInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateProxyInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/proxies/{id}][%d] updateProxyInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateProxyInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateProxyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/create_repository_parameters.go b/client/repositories/create_repository_parameters.go deleted file mode 100644 index 1e3b466..0000000 --- a/client/repositories/create_repository_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewCreateRepositoryParams creates a new CreateRepositoryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateRepositoryParams() *CreateRepositoryParams { - return &CreateRepositoryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateRepositoryParamsWithTimeout creates a new CreateRepositoryParams object -// with the ability to set a timeout on a request. -func NewCreateRepositoryParamsWithTimeout(timeout time.Duration) *CreateRepositoryParams { - return &CreateRepositoryParams{ - timeout: timeout, - } -} - -// NewCreateRepositoryParamsWithContext creates a new CreateRepositoryParams object -// with the ability to set a context for a request. -func NewCreateRepositoryParamsWithContext(ctx context.Context) *CreateRepositoryParams { - return &CreateRepositoryParams{ - Context: ctx, - } -} - -// NewCreateRepositoryParamsWithHTTPClient creates a new CreateRepositoryParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateRepositoryParamsWithHTTPClient(client *http.Client) *CreateRepositoryParams { - return &CreateRepositoryParams{ - HTTPClient: client, - } -} - -/* CreateRepositoryParams contains all the parameters to send to the API endpoint - for the create repository operation. - - Typically these are written to a http.Request. -*/ -type CreateRepositoryParams struct { - - // Body. - Body *models.RepositorySpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRepositoryParams) WithDefaults() *CreateRepositoryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRepositoryParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := CreateRepositoryParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create repository params -func (o *CreateRepositoryParams) WithTimeout(timeout time.Duration) *CreateRepositoryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create repository params -func (o *CreateRepositoryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create repository params -func (o *CreateRepositoryParams) WithContext(ctx context.Context) *CreateRepositoryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create repository params -func (o *CreateRepositoryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create repository params -func (o *CreateRepositoryParams) WithHTTPClient(client *http.Client) *CreateRepositoryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create repository params -func (o *CreateRepositoryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create repository params -func (o *CreateRepositoryParams) WithBody(body *models.RepositorySpec) *CreateRepositoryParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create repository params -func (o *CreateRepositoryParams) SetBody(body *models.RepositorySpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the create repository params -func (o *CreateRepositoryParams) WithXAPIVersion(xAPIVersion string) *CreateRepositoryParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the create repository params -func (o *CreateRepositoryParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateRepositoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/create_repository_responses.go b/client/repositories/create_repository_responses.go deleted file mode 100644 index 836295f..0000000 --- a/client/repositories/create_repository_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// CreateRepositoryReader is a Reader for the CreateRepository structure. -type CreateRepositoryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateRepositoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateRepositoryCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateRepositoryBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateRepositoryUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateRepositoryForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateRepositoryInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateRepositoryCreated creates a CreateRepositoryCreated with default headers values -func NewCreateRepositoryCreated() *CreateRepositoryCreated { - return &CreateRepositoryCreated{} -} - -/* CreateRepositoryCreated describes a response with status code 201, with default header values. - -Infrastructure session has been created to add the repository. To check the progress, track the session `state`. -*/ -type CreateRepositoryCreated struct { - Payload *models.SessionModel -} - -func (o *CreateRepositoryCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/repositories][%d] createRepositoryCreated %+v", 201, o.Payload) -} -func (o *CreateRepositoryCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *CreateRepositoryCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateRepositoryBadRequest creates a CreateRepositoryBadRequest with default headers values -func NewCreateRepositoryBadRequest() *CreateRepositoryBadRequest { - return &CreateRepositoryBadRequest{} -} - -/* CreateRepositoryBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type CreateRepositoryBadRequest struct { - Payload *models.Error -} - -func (o *CreateRepositoryBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/repositories][%d] createRepositoryBadRequest %+v", 400, o.Payload) -} -func (o *CreateRepositoryBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateRepositoryBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateRepositoryUnauthorized creates a CreateRepositoryUnauthorized with default headers values -func NewCreateRepositoryUnauthorized() *CreateRepositoryUnauthorized { - return &CreateRepositoryUnauthorized{} -} - -/* CreateRepositoryUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type CreateRepositoryUnauthorized struct { - Payload *models.Error -} - -func (o *CreateRepositoryUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/repositories][%d] createRepositoryUnauthorized %+v", 401, o.Payload) -} -func (o *CreateRepositoryUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateRepositoryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateRepositoryForbidden creates a CreateRepositoryForbidden with default headers values -func NewCreateRepositoryForbidden() *CreateRepositoryForbidden { - return &CreateRepositoryForbidden{} -} - -/* CreateRepositoryForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type CreateRepositoryForbidden struct { - Payload *models.Error -} - -func (o *CreateRepositoryForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/repositories][%d] createRepositoryForbidden %+v", 403, o.Payload) -} -func (o *CreateRepositoryForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateRepositoryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateRepositoryInternalServerError creates a CreateRepositoryInternalServerError with default headers values -func NewCreateRepositoryInternalServerError() *CreateRepositoryInternalServerError { - return &CreateRepositoryInternalServerError{} -} - -/* CreateRepositoryInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type CreateRepositoryInternalServerError struct { - Payload *models.Error -} - -func (o *CreateRepositoryInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/repositories][%d] createRepositoryInternalServerError %+v", 500, o.Payload) -} -func (o *CreateRepositoryInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateRepositoryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/delete_repository_parameters.go b/client/repositories/delete_repository_parameters.go deleted file mode 100644 index 4c8f373..0000000 --- a/client/repositories/delete_repository_parameters.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewDeleteRepositoryParams creates a new DeleteRepositoryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteRepositoryParams() *DeleteRepositoryParams { - return &DeleteRepositoryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteRepositoryParamsWithTimeout creates a new DeleteRepositoryParams object -// with the ability to set a timeout on a request. -func NewDeleteRepositoryParamsWithTimeout(timeout time.Duration) *DeleteRepositoryParams { - return &DeleteRepositoryParams{ - timeout: timeout, - } -} - -// NewDeleteRepositoryParamsWithContext creates a new DeleteRepositoryParams object -// with the ability to set a context for a request. -func NewDeleteRepositoryParamsWithContext(ctx context.Context) *DeleteRepositoryParams { - return &DeleteRepositoryParams{ - Context: ctx, - } -} - -// NewDeleteRepositoryParamsWithHTTPClient creates a new DeleteRepositoryParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteRepositoryParamsWithHTTPClient(client *http.Client) *DeleteRepositoryParams { - return &DeleteRepositoryParams{ - HTTPClient: client, - } -} - -/* DeleteRepositoryParams contains all the parameters to send to the API endpoint - for the delete repository operation. - - Typically these are written to a http.Request. -*/ -type DeleteRepositoryParams struct { - - /* DeleteBackups. - - If *true*, Veeam Backup & Replication will remove backup files. - */ - DeleteBackups *bool - - /* ID. - - ID of the backup repository. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteRepositoryParams) WithDefaults() *DeleteRepositoryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteRepositoryParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := DeleteRepositoryParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the delete repository params -func (o *DeleteRepositoryParams) WithTimeout(timeout time.Duration) *DeleteRepositoryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete repository params -func (o *DeleteRepositoryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete repository params -func (o *DeleteRepositoryParams) WithContext(ctx context.Context) *DeleteRepositoryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete repository params -func (o *DeleteRepositoryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete repository params -func (o *DeleteRepositoryParams) WithHTTPClient(client *http.Client) *DeleteRepositoryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete repository params -func (o *DeleteRepositoryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithDeleteBackups adds the deleteBackups to the delete repository params -func (o *DeleteRepositoryParams) WithDeleteBackups(deleteBackups *bool) *DeleteRepositoryParams { - o.SetDeleteBackups(deleteBackups) - return o -} - -// SetDeleteBackups adds the deleteBackups to the delete repository params -func (o *DeleteRepositoryParams) SetDeleteBackups(deleteBackups *bool) { - o.DeleteBackups = deleteBackups -} - -// WithID adds the id to the delete repository params -func (o *DeleteRepositoryParams) WithID(id strfmt.UUID) *DeleteRepositoryParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete repository params -func (o *DeleteRepositoryParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the delete repository params -func (o *DeleteRepositoryParams) WithXAPIVersion(xAPIVersion string) *DeleteRepositoryParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the delete repository params -func (o *DeleteRepositoryParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteRepositoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.DeleteBackups != nil { - - // query param deleteBackups - var qrDeleteBackups bool - - if o.DeleteBackups != nil { - qrDeleteBackups = *o.DeleteBackups - } - qDeleteBackups := swag.FormatBool(qrDeleteBackups) - if qDeleteBackups != "" { - - if err := r.SetQueryParam("deleteBackups", qDeleteBackups); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/delete_repository_responses.go b/client/repositories/delete_repository_responses.go deleted file mode 100644 index d258591..0000000 --- a/client/repositories/delete_repository_responses.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// DeleteRepositoryReader is a Reader for the DeleteRepository structure. -type DeleteRepositoryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteRepositoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteRepositoryNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteRepositoryUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteRepositoryForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteRepositoryNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteRepositoryInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteRepositoryNoContent creates a DeleteRepositoryNoContent with default headers values -func NewDeleteRepositoryNoContent() *DeleteRepositoryNoContent { - return &DeleteRepositoryNoContent{} -} - -/* DeleteRepositoryNoContent describes a response with status code 204, with default header values. - -Removed -*/ -type DeleteRepositoryNoContent struct { - Payload models.EmptySuccessResponse -} - -func (o *DeleteRepositoryNoContent) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/repositories/{id}][%d] deleteRepositoryNoContent %+v", 204, o.Payload) -} -func (o *DeleteRepositoryNoContent) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *DeleteRepositoryNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteRepositoryUnauthorized creates a DeleteRepositoryUnauthorized with default headers values -func NewDeleteRepositoryUnauthorized() *DeleteRepositoryUnauthorized { - return &DeleteRepositoryUnauthorized{} -} - -/* DeleteRepositoryUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type DeleteRepositoryUnauthorized struct { - Payload *models.Error -} - -func (o *DeleteRepositoryUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/repositories/{id}][%d] deleteRepositoryUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteRepositoryUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteRepositoryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteRepositoryForbidden creates a DeleteRepositoryForbidden with default headers values -func NewDeleteRepositoryForbidden() *DeleteRepositoryForbidden { - return &DeleteRepositoryForbidden{} -} - -/* DeleteRepositoryForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type DeleteRepositoryForbidden struct { - Payload *models.Error -} - -func (o *DeleteRepositoryForbidden) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/repositories/{id}][%d] deleteRepositoryForbidden %+v", 403, o.Payload) -} -func (o *DeleteRepositoryForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteRepositoryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteRepositoryNotFound creates a DeleteRepositoryNotFound with default headers values -func NewDeleteRepositoryNotFound() *DeleteRepositoryNotFound { - return &DeleteRepositoryNotFound{} -} - -/* DeleteRepositoryNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type DeleteRepositoryNotFound struct { - Payload *models.Error -} - -func (o *DeleteRepositoryNotFound) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/repositories/{id}][%d] deleteRepositoryNotFound %+v", 404, o.Payload) -} -func (o *DeleteRepositoryNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteRepositoryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteRepositoryInternalServerError creates a DeleteRepositoryInternalServerError with default headers values -func NewDeleteRepositoryInternalServerError() *DeleteRepositoryInternalServerError { - return &DeleteRepositoryInternalServerError{} -} - -/* DeleteRepositoryInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type DeleteRepositoryInternalServerError struct { - Payload *models.Error -} - -func (o *DeleteRepositoryInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /api/v1/backupInfrastructure/repositories/{id}][%d] deleteRepositoryInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteRepositoryInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteRepositoryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/disable_scale_out_extent_maintenance_mode_parameters.go b/client/repositories/disable_scale_out_extent_maintenance_mode_parameters.go deleted file mode 100644 index 4931c7a..0000000 --- a/client/repositories/disable_scale_out_extent_maintenance_mode_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewDisableScaleOutExtentMaintenanceModeParams creates a new DisableScaleOutExtentMaintenanceModeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDisableScaleOutExtentMaintenanceModeParams() *DisableScaleOutExtentMaintenanceModeParams { - return &DisableScaleOutExtentMaintenanceModeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDisableScaleOutExtentMaintenanceModeParamsWithTimeout creates a new DisableScaleOutExtentMaintenanceModeParams object -// with the ability to set a timeout on a request. -func NewDisableScaleOutExtentMaintenanceModeParamsWithTimeout(timeout time.Duration) *DisableScaleOutExtentMaintenanceModeParams { - return &DisableScaleOutExtentMaintenanceModeParams{ - timeout: timeout, - } -} - -// NewDisableScaleOutExtentMaintenanceModeParamsWithContext creates a new DisableScaleOutExtentMaintenanceModeParams object -// with the ability to set a context for a request. -func NewDisableScaleOutExtentMaintenanceModeParamsWithContext(ctx context.Context) *DisableScaleOutExtentMaintenanceModeParams { - return &DisableScaleOutExtentMaintenanceModeParams{ - Context: ctx, - } -} - -// NewDisableScaleOutExtentMaintenanceModeParamsWithHTTPClient creates a new DisableScaleOutExtentMaintenanceModeParams object -// with the ability to set a custom HTTPClient for a request. -func NewDisableScaleOutExtentMaintenanceModeParamsWithHTTPClient(client *http.Client) *DisableScaleOutExtentMaintenanceModeParams { - return &DisableScaleOutExtentMaintenanceModeParams{ - HTTPClient: client, - } -} - -/* DisableScaleOutExtentMaintenanceModeParams contains all the parameters to send to the API endpoint - for the disable scale out extent maintenance mode operation. - - Typically these are written to a http.Request. -*/ -type DisableScaleOutExtentMaintenanceModeParams struct { - - // Body. - Body *models.ScaleOutExtentMaintenanceSpec - - /* ID. - - ID of the scale-out backup repository extent. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the disable scale out extent maintenance mode params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisableScaleOutExtentMaintenanceModeParams) WithDefaults() *DisableScaleOutExtentMaintenanceModeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the disable scale out extent maintenance mode params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisableScaleOutExtentMaintenanceModeParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := DisableScaleOutExtentMaintenanceModeParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) WithTimeout(timeout time.Duration) *DisableScaleOutExtentMaintenanceModeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) WithContext(ctx context.Context) *DisableScaleOutExtentMaintenanceModeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) WithHTTPClient(client *http.Client) *DisableScaleOutExtentMaintenanceModeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) WithBody(body *models.ScaleOutExtentMaintenanceSpec) *DisableScaleOutExtentMaintenanceModeParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) SetBody(body *models.ScaleOutExtentMaintenanceSpec) { - o.Body = body -} - -// WithID adds the id to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) WithID(id strfmt.UUID) *DisableScaleOutExtentMaintenanceModeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) WithXAPIVersion(xAPIVersion string) *DisableScaleOutExtentMaintenanceModeParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the disable scale out extent maintenance mode params -func (o *DisableScaleOutExtentMaintenanceModeParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *DisableScaleOutExtentMaintenanceModeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/disable_scale_out_extent_maintenance_mode_responses.go b/client/repositories/disable_scale_out_extent_maintenance_mode_responses.go deleted file mode 100644 index 636de99..0000000 --- a/client/repositories/disable_scale_out_extent_maintenance_mode_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// DisableScaleOutExtentMaintenanceModeReader is a Reader for the DisableScaleOutExtentMaintenanceMode structure. -type DisableScaleOutExtentMaintenanceModeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DisableScaleOutExtentMaintenanceModeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewDisableScaleOutExtentMaintenanceModeCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDisableScaleOutExtentMaintenanceModeBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDisableScaleOutExtentMaintenanceModeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDisableScaleOutExtentMaintenanceModeForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDisableScaleOutExtentMaintenanceModeInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDisableScaleOutExtentMaintenanceModeCreated creates a DisableScaleOutExtentMaintenanceModeCreated with default headers values -func NewDisableScaleOutExtentMaintenanceModeCreated() *DisableScaleOutExtentMaintenanceModeCreated { - return &DisableScaleOutExtentMaintenanceModeCreated{} -} - -/* DisableScaleOutExtentMaintenanceModeCreated describes a response with status code 201, with default header values. - -RepositoryMaintenance session has been created. -*/ -type DisableScaleOutExtentMaintenanceModeCreated struct { - Payload *models.SessionModel -} - -func (o *DisableScaleOutExtentMaintenanceModeCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode][%d] disableScaleOutExtentMaintenanceModeCreated %+v", 201, o.Payload) -} -func (o *DisableScaleOutExtentMaintenanceModeCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *DisableScaleOutExtentMaintenanceModeCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableScaleOutExtentMaintenanceModeBadRequest creates a DisableScaleOutExtentMaintenanceModeBadRequest with default headers values -func NewDisableScaleOutExtentMaintenanceModeBadRequest() *DisableScaleOutExtentMaintenanceModeBadRequest { - return &DisableScaleOutExtentMaintenanceModeBadRequest{} -} - -/* DisableScaleOutExtentMaintenanceModeBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type DisableScaleOutExtentMaintenanceModeBadRequest struct { - Payload *models.Error -} - -func (o *DisableScaleOutExtentMaintenanceModeBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode][%d] disableScaleOutExtentMaintenanceModeBadRequest %+v", 400, o.Payload) -} -func (o *DisableScaleOutExtentMaintenanceModeBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableScaleOutExtentMaintenanceModeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableScaleOutExtentMaintenanceModeUnauthorized creates a DisableScaleOutExtentMaintenanceModeUnauthorized with default headers values -func NewDisableScaleOutExtentMaintenanceModeUnauthorized() *DisableScaleOutExtentMaintenanceModeUnauthorized { - return &DisableScaleOutExtentMaintenanceModeUnauthorized{} -} - -/* DisableScaleOutExtentMaintenanceModeUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type DisableScaleOutExtentMaintenanceModeUnauthorized struct { - Payload *models.Error -} - -func (o *DisableScaleOutExtentMaintenanceModeUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode][%d] disableScaleOutExtentMaintenanceModeUnauthorized %+v", 401, o.Payload) -} -func (o *DisableScaleOutExtentMaintenanceModeUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableScaleOutExtentMaintenanceModeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableScaleOutExtentMaintenanceModeForbidden creates a DisableScaleOutExtentMaintenanceModeForbidden with default headers values -func NewDisableScaleOutExtentMaintenanceModeForbidden() *DisableScaleOutExtentMaintenanceModeForbidden { - return &DisableScaleOutExtentMaintenanceModeForbidden{} -} - -/* DisableScaleOutExtentMaintenanceModeForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type DisableScaleOutExtentMaintenanceModeForbidden struct { - Payload *models.Error -} - -func (o *DisableScaleOutExtentMaintenanceModeForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode][%d] disableScaleOutExtentMaintenanceModeForbidden %+v", 403, o.Payload) -} -func (o *DisableScaleOutExtentMaintenanceModeForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableScaleOutExtentMaintenanceModeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableScaleOutExtentMaintenanceModeInternalServerError creates a DisableScaleOutExtentMaintenanceModeInternalServerError with default headers values -func NewDisableScaleOutExtentMaintenanceModeInternalServerError() *DisableScaleOutExtentMaintenanceModeInternalServerError { - return &DisableScaleOutExtentMaintenanceModeInternalServerError{} -} - -/* DisableScaleOutExtentMaintenanceModeInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type DisableScaleOutExtentMaintenanceModeInternalServerError struct { - Payload *models.Error -} - -func (o *DisableScaleOutExtentMaintenanceModeInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode][%d] disableScaleOutExtentMaintenanceModeInternalServerError %+v", 500, o.Payload) -} -func (o *DisableScaleOutExtentMaintenanceModeInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DisableScaleOutExtentMaintenanceModeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/enable_scale_out_extent_maintenance_mode_parameters.go b/client/repositories/enable_scale_out_extent_maintenance_mode_parameters.go deleted file mode 100644 index 358b945..0000000 --- a/client/repositories/enable_scale_out_extent_maintenance_mode_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewEnableScaleOutExtentMaintenanceModeParams creates a new EnableScaleOutExtentMaintenanceModeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnableScaleOutExtentMaintenanceModeParams() *EnableScaleOutExtentMaintenanceModeParams { - return &EnableScaleOutExtentMaintenanceModeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnableScaleOutExtentMaintenanceModeParamsWithTimeout creates a new EnableScaleOutExtentMaintenanceModeParams object -// with the ability to set a timeout on a request. -func NewEnableScaleOutExtentMaintenanceModeParamsWithTimeout(timeout time.Duration) *EnableScaleOutExtentMaintenanceModeParams { - return &EnableScaleOutExtentMaintenanceModeParams{ - timeout: timeout, - } -} - -// NewEnableScaleOutExtentMaintenanceModeParamsWithContext creates a new EnableScaleOutExtentMaintenanceModeParams object -// with the ability to set a context for a request. -func NewEnableScaleOutExtentMaintenanceModeParamsWithContext(ctx context.Context) *EnableScaleOutExtentMaintenanceModeParams { - return &EnableScaleOutExtentMaintenanceModeParams{ - Context: ctx, - } -} - -// NewEnableScaleOutExtentMaintenanceModeParamsWithHTTPClient creates a new EnableScaleOutExtentMaintenanceModeParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnableScaleOutExtentMaintenanceModeParamsWithHTTPClient(client *http.Client) *EnableScaleOutExtentMaintenanceModeParams { - return &EnableScaleOutExtentMaintenanceModeParams{ - HTTPClient: client, - } -} - -/* EnableScaleOutExtentMaintenanceModeParams contains all the parameters to send to the API endpoint - for the enable scale out extent maintenance mode operation. - - Typically these are written to a http.Request. -*/ -type EnableScaleOutExtentMaintenanceModeParams struct { - - // Body. - Body *models.ScaleOutExtentMaintenanceSpec - - /* ID. - - ID of the scale-out backup repository extent. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enable scale out extent maintenance mode params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnableScaleOutExtentMaintenanceModeParams) WithDefaults() *EnableScaleOutExtentMaintenanceModeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enable scale out extent maintenance mode params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnableScaleOutExtentMaintenanceModeParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := EnableScaleOutExtentMaintenanceModeParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) WithTimeout(timeout time.Duration) *EnableScaleOutExtentMaintenanceModeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) WithContext(ctx context.Context) *EnableScaleOutExtentMaintenanceModeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) WithHTTPClient(client *http.Client) *EnableScaleOutExtentMaintenanceModeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) WithBody(body *models.ScaleOutExtentMaintenanceSpec) *EnableScaleOutExtentMaintenanceModeParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) SetBody(body *models.ScaleOutExtentMaintenanceSpec) { - o.Body = body -} - -// WithID adds the id to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) WithID(id strfmt.UUID) *EnableScaleOutExtentMaintenanceModeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) WithXAPIVersion(xAPIVersion string) *EnableScaleOutExtentMaintenanceModeParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the enable scale out extent maintenance mode params -func (o *EnableScaleOutExtentMaintenanceModeParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *EnableScaleOutExtentMaintenanceModeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/enable_scale_out_extent_maintenance_mode_responses.go b/client/repositories/enable_scale_out_extent_maintenance_mode_responses.go deleted file mode 100644 index adcbc00..0000000 --- a/client/repositories/enable_scale_out_extent_maintenance_mode_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// EnableScaleOutExtentMaintenanceModeReader is a Reader for the EnableScaleOutExtentMaintenanceMode structure. -type EnableScaleOutExtentMaintenanceModeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnableScaleOutExtentMaintenanceModeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewEnableScaleOutExtentMaintenanceModeCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewEnableScaleOutExtentMaintenanceModeBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewEnableScaleOutExtentMaintenanceModeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewEnableScaleOutExtentMaintenanceModeForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewEnableScaleOutExtentMaintenanceModeInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnableScaleOutExtentMaintenanceModeCreated creates a EnableScaleOutExtentMaintenanceModeCreated with default headers values -func NewEnableScaleOutExtentMaintenanceModeCreated() *EnableScaleOutExtentMaintenanceModeCreated { - return &EnableScaleOutExtentMaintenanceModeCreated{} -} - -/* EnableScaleOutExtentMaintenanceModeCreated describes a response with status code 201, with default header values. - -RepositoryMaintenance session has been created. -*/ -type EnableScaleOutExtentMaintenanceModeCreated struct { - Payload *models.SessionModel -} - -func (o *EnableScaleOutExtentMaintenanceModeCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode][%d] enableScaleOutExtentMaintenanceModeCreated %+v", 201, o.Payload) -} -func (o *EnableScaleOutExtentMaintenanceModeCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *EnableScaleOutExtentMaintenanceModeCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableScaleOutExtentMaintenanceModeBadRequest creates a EnableScaleOutExtentMaintenanceModeBadRequest with default headers values -func NewEnableScaleOutExtentMaintenanceModeBadRequest() *EnableScaleOutExtentMaintenanceModeBadRequest { - return &EnableScaleOutExtentMaintenanceModeBadRequest{} -} - -/* EnableScaleOutExtentMaintenanceModeBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type EnableScaleOutExtentMaintenanceModeBadRequest struct { - Payload *models.Error -} - -func (o *EnableScaleOutExtentMaintenanceModeBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode][%d] enableScaleOutExtentMaintenanceModeBadRequest %+v", 400, o.Payload) -} -func (o *EnableScaleOutExtentMaintenanceModeBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableScaleOutExtentMaintenanceModeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableScaleOutExtentMaintenanceModeUnauthorized creates a EnableScaleOutExtentMaintenanceModeUnauthorized with default headers values -func NewEnableScaleOutExtentMaintenanceModeUnauthorized() *EnableScaleOutExtentMaintenanceModeUnauthorized { - return &EnableScaleOutExtentMaintenanceModeUnauthorized{} -} - -/* EnableScaleOutExtentMaintenanceModeUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type EnableScaleOutExtentMaintenanceModeUnauthorized struct { - Payload *models.Error -} - -func (o *EnableScaleOutExtentMaintenanceModeUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode][%d] enableScaleOutExtentMaintenanceModeUnauthorized %+v", 401, o.Payload) -} -func (o *EnableScaleOutExtentMaintenanceModeUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableScaleOutExtentMaintenanceModeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableScaleOutExtentMaintenanceModeForbidden creates a EnableScaleOutExtentMaintenanceModeForbidden with default headers values -func NewEnableScaleOutExtentMaintenanceModeForbidden() *EnableScaleOutExtentMaintenanceModeForbidden { - return &EnableScaleOutExtentMaintenanceModeForbidden{} -} - -/* EnableScaleOutExtentMaintenanceModeForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type EnableScaleOutExtentMaintenanceModeForbidden struct { - Payload *models.Error -} - -func (o *EnableScaleOutExtentMaintenanceModeForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode][%d] enableScaleOutExtentMaintenanceModeForbidden %+v", 403, o.Payload) -} -func (o *EnableScaleOutExtentMaintenanceModeForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableScaleOutExtentMaintenanceModeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableScaleOutExtentMaintenanceModeInternalServerError creates a EnableScaleOutExtentMaintenanceModeInternalServerError with default headers values -func NewEnableScaleOutExtentMaintenanceModeInternalServerError() *EnableScaleOutExtentMaintenanceModeInternalServerError { - return &EnableScaleOutExtentMaintenanceModeInternalServerError{} -} - -/* EnableScaleOutExtentMaintenanceModeInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type EnableScaleOutExtentMaintenanceModeInternalServerError struct { - Payload *models.Error -} - -func (o *EnableScaleOutExtentMaintenanceModeInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode][%d] enableScaleOutExtentMaintenanceModeInternalServerError %+v", 500, o.Payload) -} -func (o *EnableScaleOutExtentMaintenanceModeInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *EnableScaleOutExtentMaintenanceModeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/get_all_repositories_parameters.go b/client/repositories/get_all_repositories_parameters.go deleted file mode 100644 index 16a86b7..0000000 --- a/client/repositories/get_all_repositories_parameters.go +++ /dev/null @@ -1,490 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllRepositoriesParams creates a new GetAllRepositoriesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllRepositoriesParams() *GetAllRepositoriesParams { - return &GetAllRepositoriesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllRepositoriesParamsWithTimeout creates a new GetAllRepositoriesParams object -// with the ability to set a timeout on a request. -func NewGetAllRepositoriesParamsWithTimeout(timeout time.Duration) *GetAllRepositoriesParams { - return &GetAllRepositoriesParams{ - timeout: timeout, - } -} - -// NewGetAllRepositoriesParamsWithContext creates a new GetAllRepositoriesParams object -// with the ability to set a context for a request. -func NewGetAllRepositoriesParamsWithContext(ctx context.Context) *GetAllRepositoriesParams { - return &GetAllRepositoriesParams{ - Context: ctx, - } -} - -// NewGetAllRepositoriesParamsWithHTTPClient creates a new GetAllRepositoriesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllRepositoriesParamsWithHTTPClient(client *http.Client) *GetAllRepositoriesParams { - return &GetAllRepositoriesParams{ - HTTPClient: client, - } -} - -/* GetAllRepositoriesParams contains all the parameters to send to the API endpoint - for the get all repositories operation. - - Typically these are written to a http.Request. -*/ -type GetAllRepositoriesParams struct { - - /* HostIDFilter. - - Filters repositories by ID of the backup server. - - Format: uuid - */ - HostIDFilter *strfmt.UUID - - /* Limit. - - Maximum number of repositories to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters repositories by the `nameFilter` pattern. The pattern can match any repository parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts repositories in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts repositories by one of the repository parameters. - */ - OrderColumn *string - - /* PathFilter. - - Filters repositories by path to the folder where backup files are stored. - */ - PathFilter *string - - /* Skip. - - Number of repositories to skip. - - Format: int32 - */ - Skip *int32 - - /* TypeFilter. - - Filters repositories by repository type. - */ - TypeFilter *string - - /* VmbAPIFilter. - - Filters repositories by VM Backup API parameters converted to the base64 string.
- To compose the base64 string:
-
    -
  1. Prepare VM Backup API parameters in the JSON format.
  2. - {
    - "protocolVersion":"string",
    - "assemblyVersion":"string",
    - "productId":"string",
    - "versionFlags":"string"
    - }
    -
  3. Convert the JSON object into a string.
  4. -
  5. Encode the string with base64 encoding.
  6. -
- - */ - VmbAPIFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all repositories params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllRepositoriesParams) WithDefaults() *GetAllRepositoriesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all repositories params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllRepositoriesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllRepositoriesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all repositories params -func (o *GetAllRepositoriesParams) WithTimeout(timeout time.Duration) *GetAllRepositoriesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all repositories params -func (o *GetAllRepositoriesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all repositories params -func (o *GetAllRepositoriesParams) WithContext(ctx context.Context) *GetAllRepositoriesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all repositories params -func (o *GetAllRepositoriesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all repositories params -func (o *GetAllRepositoriesParams) WithHTTPClient(client *http.Client) *GetAllRepositoriesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all repositories params -func (o *GetAllRepositoriesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostIDFilter adds the hostIDFilter to the get all repositories params -func (o *GetAllRepositoriesParams) WithHostIDFilter(hostIDFilter *strfmt.UUID) *GetAllRepositoriesParams { - o.SetHostIDFilter(hostIDFilter) - return o -} - -// SetHostIDFilter adds the hostIdFilter to the get all repositories params -func (o *GetAllRepositoriesParams) SetHostIDFilter(hostIDFilter *strfmt.UUID) { - o.HostIDFilter = hostIDFilter -} - -// WithLimit adds the limit to the get all repositories params -func (o *GetAllRepositoriesParams) WithLimit(limit *int32) *GetAllRepositoriesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all repositories params -func (o *GetAllRepositoriesParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all repositories params -func (o *GetAllRepositoriesParams) WithNameFilter(nameFilter *string) *GetAllRepositoriesParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all repositories params -func (o *GetAllRepositoriesParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all repositories params -func (o *GetAllRepositoriesParams) WithOrderAsc(orderAsc *bool) *GetAllRepositoriesParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all repositories params -func (o *GetAllRepositoriesParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all repositories params -func (o *GetAllRepositoriesParams) WithOrderColumn(orderColumn *string) *GetAllRepositoriesParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all repositories params -func (o *GetAllRepositoriesParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithPathFilter adds the pathFilter to the get all repositories params -func (o *GetAllRepositoriesParams) WithPathFilter(pathFilter *string) *GetAllRepositoriesParams { - o.SetPathFilter(pathFilter) - return o -} - -// SetPathFilter adds the pathFilter to the get all repositories params -func (o *GetAllRepositoriesParams) SetPathFilter(pathFilter *string) { - o.PathFilter = pathFilter -} - -// WithSkip adds the skip to the get all repositories params -func (o *GetAllRepositoriesParams) WithSkip(skip *int32) *GetAllRepositoriesParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all repositories params -func (o *GetAllRepositoriesParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithTypeFilter adds the typeFilter to the get all repositories params -func (o *GetAllRepositoriesParams) WithTypeFilter(typeFilter *string) *GetAllRepositoriesParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all repositories params -func (o *GetAllRepositoriesParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithVmbAPIFilter adds the vmbAPIFilter to the get all repositories params -func (o *GetAllRepositoriesParams) WithVmbAPIFilter(vmbAPIFilter *string) *GetAllRepositoriesParams { - o.SetVmbAPIFilter(vmbAPIFilter) - return o -} - -// SetVmbAPIFilter adds the vmbApiFilter to the get all repositories params -func (o *GetAllRepositoriesParams) SetVmbAPIFilter(vmbAPIFilter *string) { - o.VmbAPIFilter = vmbAPIFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all repositories params -func (o *GetAllRepositoriesParams) WithXAPIVersion(xAPIVersion string) *GetAllRepositoriesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all repositories params -func (o *GetAllRepositoriesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllRepositoriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.HostIDFilter != nil { - - // query param hostIdFilter - var qrHostIDFilter strfmt.UUID - - if o.HostIDFilter != nil { - qrHostIDFilter = *o.HostIDFilter - } - qHostIDFilter := qrHostIDFilter.String() - if qHostIDFilter != "" { - - if err := r.SetQueryParam("hostIdFilter", qHostIDFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.PathFilter != nil { - - // query param pathFilter - var qrPathFilter string - - if o.PathFilter != nil { - qrPathFilter = *o.PathFilter - } - qPathFilter := qrPathFilter - if qPathFilter != "" { - - if err := r.SetQueryParam("pathFilter", qPathFilter); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - if o.VmbAPIFilter != nil { - - // query param vmbApiFilter - var qrVmbAPIFilter string - - if o.VmbAPIFilter != nil { - qrVmbAPIFilter = *o.VmbAPIFilter - } - qVmbAPIFilter := qrVmbAPIFilter - if qVmbAPIFilter != "" { - - if err := r.SetQueryParam("vmbApiFilter", qVmbAPIFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/get_all_repositories_responses.go b/client/repositories/get_all_repositories_responses.go deleted file mode 100644 index e5e3817..0000000 --- a/client/repositories/get_all_repositories_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllRepositoriesReader is a Reader for the GetAllRepositories structure. -type GetAllRepositoriesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllRepositoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllRepositoriesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllRepositoriesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllRepositoriesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllRepositoriesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllRepositoriesOK creates a GetAllRepositoriesOK with default headers values -func NewGetAllRepositoriesOK() *GetAllRepositoriesOK { - return &GetAllRepositoriesOK{} -} - -/* GetAllRepositoriesOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllRepositoriesOK struct { - Payload *models.RepositoriesResult -} - -func (o *GetAllRepositoriesOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories][%d] getAllRepositoriesOK %+v", 200, o.Payload) -} -func (o *GetAllRepositoriesOK) GetPayload() *models.RepositoriesResult { - return o.Payload -} - -func (o *GetAllRepositoriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.RepositoriesResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllRepositoriesUnauthorized creates a GetAllRepositoriesUnauthorized with default headers values -func NewGetAllRepositoriesUnauthorized() *GetAllRepositoriesUnauthorized { - return &GetAllRepositoriesUnauthorized{} -} - -/* GetAllRepositoriesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllRepositoriesUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllRepositoriesUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories][%d] getAllRepositoriesUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllRepositoriesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllRepositoriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllRepositoriesForbidden creates a GetAllRepositoriesForbidden with default headers values -func NewGetAllRepositoriesForbidden() *GetAllRepositoriesForbidden { - return &GetAllRepositoriesForbidden{} -} - -/* GetAllRepositoriesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllRepositoriesForbidden struct { - Payload *models.Error -} - -func (o *GetAllRepositoriesForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories][%d] getAllRepositoriesForbidden %+v", 403, o.Payload) -} -func (o *GetAllRepositoriesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllRepositoriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllRepositoriesInternalServerError creates a GetAllRepositoriesInternalServerError with default headers values -func NewGetAllRepositoriesInternalServerError() *GetAllRepositoriesInternalServerError { - return &GetAllRepositoriesInternalServerError{} -} - -/* GetAllRepositoriesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllRepositoriesInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllRepositoriesInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories][%d] getAllRepositoriesInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllRepositoriesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllRepositoriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/get_all_repositories_states_parameters.go b/client/repositories/get_all_repositories_states_parameters.go deleted file mode 100644 index 9aeaacd..0000000 --- a/client/repositories/get_all_repositories_states_parameters.go +++ /dev/null @@ -1,517 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllRepositoriesStatesParams creates a new GetAllRepositoriesStatesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllRepositoriesStatesParams() *GetAllRepositoriesStatesParams { - return &GetAllRepositoriesStatesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllRepositoriesStatesParamsWithTimeout creates a new GetAllRepositoriesStatesParams object -// with the ability to set a timeout on a request. -func NewGetAllRepositoriesStatesParamsWithTimeout(timeout time.Duration) *GetAllRepositoriesStatesParams { - return &GetAllRepositoriesStatesParams{ - timeout: timeout, - } -} - -// NewGetAllRepositoriesStatesParamsWithContext creates a new GetAllRepositoriesStatesParams object -// with the ability to set a context for a request. -func NewGetAllRepositoriesStatesParamsWithContext(ctx context.Context) *GetAllRepositoriesStatesParams { - return &GetAllRepositoriesStatesParams{ - Context: ctx, - } -} - -// NewGetAllRepositoriesStatesParamsWithHTTPClient creates a new GetAllRepositoriesStatesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllRepositoriesStatesParamsWithHTTPClient(client *http.Client) *GetAllRepositoriesStatesParams { - return &GetAllRepositoriesStatesParams{ - HTTPClient: client, - } -} - -/* GetAllRepositoriesStatesParams contains all the parameters to send to the API endpoint - for the get all repositories states operation. - - Typically these are written to a http.Request. -*/ -type GetAllRepositoriesStatesParams struct { - - /* CapacityFilter. - - Filters repository states by repository capacity. - - Format: double - */ - CapacityFilter *float64 - - /* FreeSpaceFilter. - - Filters repository states by repository free space. - - Format: double - */ - FreeSpaceFilter *float64 - - /* IDFilter. - - Filters repository states by repository ID. - - Format: uuid - */ - IDFilter *strfmt.UUID - - /* Limit. - - Maximum number of repository states to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters repository states by the `nameFilter` pattern. The pattern can match any repository state parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts repository states in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts repository states by one of the state parameters. - */ - OrderColumn *string - - /* Skip. - - Number of repository states to skip. - - Format: int32 - */ - Skip *int32 - - /* TypeFilter. - - Filters repository states by repository type. - */ - TypeFilter *string - - /* UsedSpaceFilter. - - Filters repository states by repository used space. - - Format: double - */ - UsedSpaceFilter *float64 - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all repositories states params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllRepositoriesStatesParams) WithDefaults() *GetAllRepositoriesStatesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all repositories states params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllRepositoriesStatesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllRepositoriesStatesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithTimeout(timeout time.Duration) *GetAllRepositoriesStatesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithContext(ctx context.Context) *GetAllRepositoriesStatesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithHTTPClient(client *http.Client) *GetAllRepositoriesStatesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCapacityFilter adds the capacityFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithCapacityFilter(capacityFilter *float64) *GetAllRepositoriesStatesParams { - o.SetCapacityFilter(capacityFilter) - return o -} - -// SetCapacityFilter adds the capacityFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetCapacityFilter(capacityFilter *float64) { - o.CapacityFilter = capacityFilter -} - -// WithFreeSpaceFilter adds the freeSpaceFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithFreeSpaceFilter(freeSpaceFilter *float64) *GetAllRepositoriesStatesParams { - o.SetFreeSpaceFilter(freeSpaceFilter) - return o -} - -// SetFreeSpaceFilter adds the freeSpaceFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetFreeSpaceFilter(freeSpaceFilter *float64) { - o.FreeSpaceFilter = freeSpaceFilter -} - -// WithIDFilter adds the iDFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithIDFilter(iDFilter *strfmt.UUID) *GetAllRepositoriesStatesParams { - o.SetIDFilter(iDFilter) - return o -} - -// SetIDFilter adds the idFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetIDFilter(iDFilter *strfmt.UUID) { - o.IDFilter = iDFilter -} - -// WithLimit adds the limit to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithLimit(limit *int32) *GetAllRepositoriesStatesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithNameFilter(nameFilter *string) *GetAllRepositoriesStatesParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithOrderAsc(orderAsc *bool) *GetAllRepositoriesStatesParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithOrderColumn(orderColumn *string) *GetAllRepositoriesStatesParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithSkip(skip *int32) *GetAllRepositoriesStatesParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithTypeFilter adds the typeFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithTypeFilter(typeFilter *string) *GetAllRepositoriesStatesParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithUsedSpaceFilter adds the usedSpaceFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithUsedSpaceFilter(usedSpaceFilter *float64) *GetAllRepositoriesStatesParams { - o.SetUsedSpaceFilter(usedSpaceFilter) - return o -} - -// SetUsedSpaceFilter adds the usedSpaceFilter to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetUsedSpaceFilter(usedSpaceFilter *float64) { - o.UsedSpaceFilter = usedSpaceFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) WithXAPIVersion(xAPIVersion string) *GetAllRepositoriesStatesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all repositories states params -func (o *GetAllRepositoriesStatesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllRepositoriesStatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.CapacityFilter != nil { - - // query param capacityFilter - var qrCapacityFilter float64 - - if o.CapacityFilter != nil { - qrCapacityFilter = *o.CapacityFilter - } - qCapacityFilter := swag.FormatFloat64(qrCapacityFilter) - if qCapacityFilter != "" { - - if err := r.SetQueryParam("capacityFilter", qCapacityFilter); err != nil { - return err - } - } - } - - if o.FreeSpaceFilter != nil { - - // query param freeSpaceFilter - var qrFreeSpaceFilter float64 - - if o.FreeSpaceFilter != nil { - qrFreeSpaceFilter = *o.FreeSpaceFilter - } - qFreeSpaceFilter := swag.FormatFloat64(qrFreeSpaceFilter) - if qFreeSpaceFilter != "" { - - if err := r.SetQueryParam("freeSpaceFilter", qFreeSpaceFilter); err != nil { - return err - } - } - } - - if o.IDFilter != nil { - - // query param idFilter - var qrIDFilter strfmt.UUID - - if o.IDFilter != nil { - qrIDFilter = *o.IDFilter - } - qIDFilter := qrIDFilter.String() - if qIDFilter != "" { - - if err := r.SetQueryParam("idFilter", qIDFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - if o.UsedSpaceFilter != nil { - - // query param usedSpaceFilter - var qrUsedSpaceFilter float64 - - if o.UsedSpaceFilter != nil { - qrUsedSpaceFilter = *o.UsedSpaceFilter - } - qUsedSpaceFilter := swag.FormatFloat64(qrUsedSpaceFilter) - if qUsedSpaceFilter != "" { - - if err := r.SetQueryParam("usedSpaceFilter", qUsedSpaceFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/get_all_repositories_states_responses.go b/client/repositories/get_all_repositories_states_responses.go deleted file mode 100644 index d57864c..0000000 --- a/client/repositories/get_all_repositories_states_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllRepositoriesStatesReader is a Reader for the GetAllRepositoriesStates structure. -type GetAllRepositoriesStatesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllRepositoriesStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllRepositoriesStatesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllRepositoriesStatesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllRepositoriesStatesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllRepositoriesStatesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllRepositoriesStatesOK creates a GetAllRepositoriesStatesOK with default headers values -func NewGetAllRepositoriesStatesOK() *GetAllRepositoriesStatesOK { - return &GetAllRepositoriesStatesOK{} -} - -/* GetAllRepositoriesStatesOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllRepositoriesStatesOK struct { - Payload *models.RepositoryStatesResult -} - -func (o *GetAllRepositoriesStatesOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/states][%d] getAllRepositoriesStatesOK %+v", 200, o.Payload) -} -func (o *GetAllRepositoriesStatesOK) GetPayload() *models.RepositoryStatesResult { - return o.Payload -} - -func (o *GetAllRepositoriesStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.RepositoryStatesResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllRepositoriesStatesUnauthorized creates a GetAllRepositoriesStatesUnauthorized with default headers values -func NewGetAllRepositoriesStatesUnauthorized() *GetAllRepositoriesStatesUnauthorized { - return &GetAllRepositoriesStatesUnauthorized{} -} - -/* GetAllRepositoriesStatesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllRepositoriesStatesUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllRepositoriesStatesUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/states][%d] getAllRepositoriesStatesUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllRepositoriesStatesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllRepositoriesStatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllRepositoriesStatesForbidden creates a GetAllRepositoriesStatesForbidden with default headers values -func NewGetAllRepositoriesStatesForbidden() *GetAllRepositoriesStatesForbidden { - return &GetAllRepositoriesStatesForbidden{} -} - -/* GetAllRepositoriesStatesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllRepositoriesStatesForbidden struct { - Payload *models.Error -} - -func (o *GetAllRepositoriesStatesForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/states][%d] getAllRepositoriesStatesForbidden %+v", 403, o.Payload) -} -func (o *GetAllRepositoriesStatesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllRepositoriesStatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllRepositoriesStatesInternalServerError creates a GetAllRepositoriesStatesInternalServerError with default headers values -func NewGetAllRepositoriesStatesInternalServerError() *GetAllRepositoriesStatesInternalServerError { - return &GetAllRepositoriesStatesInternalServerError{} -} - -/* GetAllRepositoriesStatesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllRepositoriesStatesInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllRepositoriesStatesInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/states][%d] getAllRepositoriesStatesInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllRepositoriesStatesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllRepositoriesStatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/get_all_scale_out_repositories_parameters.go b/client/repositories/get_all_scale_out_repositories_parameters.go deleted file mode 100644 index b571cf4..0000000 --- a/client/repositories/get_all_scale_out_repositories_parameters.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllScaleOutRepositoriesParams creates a new GetAllScaleOutRepositoriesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllScaleOutRepositoriesParams() *GetAllScaleOutRepositoriesParams { - return &GetAllScaleOutRepositoriesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllScaleOutRepositoriesParamsWithTimeout creates a new GetAllScaleOutRepositoriesParams object -// with the ability to set a timeout on a request. -func NewGetAllScaleOutRepositoriesParamsWithTimeout(timeout time.Duration) *GetAllScaleOutRepositoriesParams { - return &GetAllScaleOutRepositoriesParams{ - timeout: timeout, - } -} - -// NewGetAllScaleOutRepositoriesParamsWithContext creates a new GetAllScaleOutRepositoriesParams object -// with the ability to set a context for a request. -func NewGetAllScaleOutRepositoriesParamsWithContext(ctx context.Context) *GetAllScaleOutRepositoriesParams { - return &GetAllScaleOutRepositoriesParams{ - Context: ctx, - } -} - -// NewGetAllScaleOutRepositoriesParamsWithHTTPClient creates a new GetAllScaleOutRepositoriesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllScaleOutRepositoriesParamsWithHTTPClient(client *http.Client) *GetAllScaleOutRepositoriesParams { - return &GetAllScaleOutRepositoriesParams{ - HTTPClient: client, - } -} - -/* GetAllScaleOutRepositoriesParams contains all the parameters to send to the API endpoint - for the get all scale out repositories operation. - - Typically these are written to a http.Request. -*/ -type GetAllScaleOutRepositoriesParams struct { - - /* Limit. - - Maximum number of repositories to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters repositories by the `nameFilter` substring. The substring can be part of any repository parameter. - */ - NameFilter *string - - /* OrderAsc. - - Sorts repositories in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts repositories by one of the repository parameters. - */ - OrderColumn *string - - /* Skip. - - Number of repositories to skip. - - Format: int32 - */ - Skip *int32 - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all scale out repositories params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllScaleOutRepositoriesParams) WithDefaults() *GetAllScaleOutRepositoriesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all scale out repositories params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllScaleOutRepositoriesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllScaleOutRepositoriesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithTimeout(timeout time.Duration) *GetAllScaleOutRepositoriesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithContext(ctx context.Context) *GetAllScaleOutRepositoriesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithHTTPClient(client *http.Client) *GetAllScaleOutRepositoriesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithLimit(limit *int32) *GetAllScaleOutRepositoriesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithNameFilter(nameFilter *string) *GetAllScaleOutRepositoriesParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithOrderAsc(orderAsc *bool) *GetAllScaleOutRepositoriesParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithOrderColumn(orderColumn *string) *GetAllScaleOutRepositoriesParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithSkip(skip *int32) *GetAllScaleOutRepositoriesParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithXAPIVersion adds the xAPIVersion to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) WithXAPIVersion(xAPIVersion string) *GetAllScaleOutRepositoriesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all scale out repositories params -func (o *GetAllScaleOutRepositoriesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllScaleOutRepositoriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/get_all_scale_out_repositories_responses.go b/client/repositories/get_all_scale_out_repositories_responses.go deleted file mode 100644 index 8172868..0000000 --- a/client/repositories/get_all_scale_out_repositories_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllScaleOutRepositoriesReader is a Reader for the GetAllScaleOutRepositories structure. -type GetAllScaleOutRepositoriesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllScaleOutRepositoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllScaleOutRepositoriesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllScaleOutRepositoriesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllScaleOutRepositoriesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllScaleOutRepositoriesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllScaleOutRepositoriesOK creates a GetAllScaleOutRepositoriesOK with default headers values -func NewGetAllScaleOutRepositoriesOK() *GetAllScaleOutRepositoriesOK { - return &GetAllScaleOutRepositoriesOK{} -} - -/* GetAllScaleOutRepositoriesOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllScaleOutRepositoriesOK struct { - Payload *models.ScaleOutRepositoriesResult -} - -func (o *GetAllScaleOutRepositoriesOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories][%d] getAllScaleOutRepositoriesOK %+v", 200, o.Payload) -} -func (o *GetAllScaleOutRepositoriesOK) GetPayload() *models.ScaleOutRepositoriesResult { - return o.Payload -} - -func (o *GetAllScaleOutRepositoriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ScaleOutRepositoriesResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllScaleOutRepositoriesUnauthorized creates a GetAllScaleOutRepositoriesUnauthorized with default headers values -func NewGetAllScaleOutRepositoriesUnauthorized() *GetAllScaleOutRepositoriesUnauthorized { - return &GetAllScaleOutRepositoriesUnauthorized{} -} - -/* GetAllScaleOutRepositoriesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllScaleOutRepositoriesUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllScaleOutRepositoriesUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories][%d] getAllScaleOutRepositoriesUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllScaleOutRepositoriesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllScaleOutRepositoriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllScaleOutRepositoriesForbidden creates a GetAllScaleOutRepositoriesForbidden with default headers values -func NewGetAllScaleOutRepositoriesForbidden() *GetAllScaleOutRepositoriesForbidden { - return &GetAllScaleOutRepositoriesForbidden{} -} - -/* GetAllScaleOutRepositoriesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllScaleOutRepositoriesForbidden struct { - Payload *models.Error -} - -func (o *GetAllScaleOutRepositoriesForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories][%d] getAllScaleOutRepositoriesForbidden %+v", 403, o.Payload) -} -func (o *GetAllScaleOutRepositoriesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllScaleOutRepositoriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllScaleOutRepositoriesInternalServerError creates a GetAllScaleOutRepositoriesInternalServerError with default headers values -func NewGetAllScaleOutRepositoriesInternalServerError() *GetAllScaleOutRepositoriesInternalServerError { - return &GetAllScaleOutRepositoriesInternalServerError{} -} - -/* GetAllScaleOutRepositoriesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllScaleOutRepositoriesInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllScaleOutRepositoriesInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories][%d] getAllScaleOutRepositoriesInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllScaleOutRepositoriesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllScaleOutRepositoriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/get_repository_parameters.go b/client/repositories/get_repository_parameters.go deleted file mode 100644 index 520449d..0000000 --- a/client/repositories/get_repository_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetRepositoryParams creates a new GetRepositoryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetRepositoryParams() *GetRepositoryParams { - return &GetRepositoryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetRepositoryParamsWithTimeout creates a new GetRepositoryParams object -// with the ability to set a timeout on a request. -func NewGetRepositoryParamsWithTimeout(timeout time.Duration) *GetRepositoryParams { - return &GetRepositoryParams{ - timeout: timeout, - } -} - -// NewGetRepositoryParamsWithContext creates a new GetRepositoryParams object -// with the ability to set a context for a request. -func NewGetRepositoryParamsWithContext(ctx context.Context) *GetRepositoryParams { - return &GetRepositoryParams{ - Context: ctx, - } -} - -// NewGetRepositoryParamsWithHTTPClient creates a new GetRepositoryParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetRepositoryParamsWithHTTPClient(client *http.Client) *GetRepositoryParams { - return &GetRepositoryParams{ - HTTPClient: client, - } -} - -/* GetRepositoryParams contains all the parameters to send to the API endpoint - for the get repository operation. - - Typically these are written to a http.Request. -*/ -type GetRepositoryParams struct { - - /* ID. - - ID of the backup repository. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetRepositoryParams) WithDefaults() *GetRepositoryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetRepositoryParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetRepositoryParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get repository params -func (o *GetRepositoryParams) WithTimeout(timeout time.Duration) *GetRepositoryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get repository params -func (o *GetRepositoryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get repository params -func (o *GetRepositoryParams) WithContext(ctx context.Context) *GetRepositoryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get repository params -func (o *GetRepositoryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get repository params -func (o *GetRepositoryParams) WithHTTPClient(client *http.Client) *GetRepositoryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get repository params -func (o *GetRepositoryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get repository params -func (o *GetRepositoryParams) WithID(id strfmt.UUID) *GetRepositoryParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get repository params -func (o *GetRepositoryParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get repository params -func (o *GetRepositoryParams) WithXAPIVersion(xAPIVersion string) *GetRepositoryParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get repository params -func (o *GetRepositoryParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetRepositoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/get_repository_responses.go b/client/repositories/get_repository_responses.go deleted file mode 100644 index a0f5850..0000000 --- a/client/repositories/get_repository_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetRepositoryReader is a Reader for the GetRepository structure. -type GetRepositoryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetRepositoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetRepositoryOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetRepositoryUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetRepositoryForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetRepositoryNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetRepositoryInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetRepositoryOK creates a GetRepositoryOK with default headers values -func NewGetRepositoryOK() *GetRepositoryOK { - return &GetRepositoryOK{} -} - -/* GetRepositoryOK describes a response with status code 200, with default header values. - -OK -*/ -type GetRepositoryOK struct { - Payload *models.RepositoryModel -} - -func (o *GetRepositoryOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/{id}][%d] getRepositoryOK %+v", 200, o.Payload) -} -func (o *GetRepositoryOK) GetPayload() *models.RepositoryModel { - return o.Payload -} - -func (o *GetRepositoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.RepositoryModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetRepositoryUnauthorized creates a GetRepositoryUnauthorized with default headers values -func NewGetRepositoryUnauthorized() *GetRepositoryUnauthorized { - return &GetRepositoryUnauthorized{} -} - -/* GetRepositoryUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetRepositoryUnauthorized struct { - Payload *models.Error -} - -func (o *GetRepositoryUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/{id}][%d] getRepositoryUnauthorized %+v", 401, o.Payload) -} -func (o *GetRepositoryUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetRepositoryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetRepositoryForbidden creates a GetRepositoryForbidden with default headers values -func NewGetRepositoryForbidden() *GetRepositoryForbidden { - return &GetRepositoryForbidden{} -} - -/* GetRepositoryForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetRepositoryForbidden struct { - Payload *models.Error -} - -func (o *GetRepositoryForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/{id}][%d] getRepositoryForbidden %+v", 403, o.Payload) -} -func (o *GetRepositoryForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetRepositoryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetRepositoryNotFound creates a GetRepositoryNotFound with default headers values -func NewGetRepositoryNotFound() *GetRepositoryNotFound { - return &GetRepositoryNotFound{} -} - -/* GetRepositoryNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetRepositoryNotFound struct { - Payload *models.Error -} - -func (o *GetRepositoryNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/{id}][%d] getRepositoryNotFound %+v", 404, o.Payload) -} -func (o *GetRepositoryNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetRepositoryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetRepositoryInternalServerError creates a GetRepositoryInternalServerError with default headers values -func NewGetRepositoryInternalServerError() *GetRepositoryInternalServerError { - return &GetRepositoryInternalServerError{} -} - -/* GetRepositoryInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetRepositoryInternalServerError struct { - Payload *models.Error -} - -func (o *GetRepositoryInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/repositories/{id}][%d] getRepositoryInternalServerError %+v", 500, o.Payload) -} -func (o *GetRepositoryInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetRepositoryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/get_scale_out_repository_parameters.go b/client/repositories/get_scale_out_repository_parameters.go deleted file mode 100644 index 583f48a..0000000 --- a/client/repositories/get_scale_out_repository_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetScaleOutRepositoryParams creates a new GetScaleOutRepositoryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetScaleOutRepositoryParams() *GetScaleOutRepositoryParams { - return &GetScaleOutRepositoryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetScaleOutRepositoryParamsWithTimeout creates a new GetScaleOutRepositoryParams object -// with the ability to set a timeout on a request. -func NewGetScaleOutRepositoryParamsWithTimeout(timeout time.Duration) *GetScaleOutRepositoryParams { - return &GetScaleOutRepositoryParams{ - timeout: timeout, - } -} - -// NewGetScaleOutRepositoryParamsWithContext creates a new GetScaleOutRepositoryParams object -// with the ability to set a context for a request. -func NewGetScaleOutRepositoryParamsWithContext(ctx context.Context) *GetScaleOutRepositoryParams { - return &GetScaleOutRepositoryParams{ - Context: ctx, - } -} - -// NewGetScaleOutRepositoryParamsWithHTTPClient creates a new GetScaleOutRepositoryParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetScaleOutRepositoryParamsWithHTTPClient(client *http.Client) *GetScaleOutRepositoryParams { - return &GetScaleOutRepositoryParams{ - HTTPClient: client, - } -} - -/* GetScaleOutRepositoryParams contains all the parameters to send to the API endpoint - for the get scale out repository operation. - - Typically these are written to a http.Request. -*/ -type GetScaleOutRepositoryParams struct { - - /* ID. - - ID of the scale-out backup repository. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get scale out repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetScaleOutRepositoryParams) WithDefaults() *GetScaleOutRepositoryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get scale out repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetScaleOutRepositoryParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetScaleOutRepositoryParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get scale out repository params -func (o *GetScaleOutRepositoryParams) WithTimeout(timeout time.Duration) *GetScaleOutRepositoryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get scale out repository params -func (o *GetScaleOutRepositoryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get scale out repository params -func (o *GetScaleOutRepositoryParams) WithContext(ctx context.Context) *GetScaleOutRepositoryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get scale out repository params -func (o *GetScaleOutRepositoryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get scale out repository params -func (o *GetScaleOutRepositoryParams) WithHTTPClient(client *http.Client) *GetScaleOutRepositoryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get scale out repository params -func (o *GetScaleOutRepositoryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get scale out repository params -func (o *GetScaleOutRepositoryParams) WithID(id strfmt.UUID) *GetScaleOutRepositoryParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get scale out repository params -func (o *GetScaleOutRepositoryParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get scale out repository params -func (o *GetScaleOutRepositoryParams) WithXAPIVersion(xAPIVersion string) *GetScaleOutRepositoryParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get scale out repository params -func (o *GetScaleOutRepositoryParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetScaleOutRepositoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/get_scale_out_repository_responses.go b/client/repositories/get_scale_out_repository_responses.go deleted file mode 100644 index c09b0cb..0000000 --- a/client/repositories/get_scale_out_repository_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetScaleOutRepositoryReader is a Reader for the GetScaleOutRepository structure. -type GetScaleOutRepositoryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetScaleOutRepositoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetScaleOutRepositoryOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetScaleOutRepositoryUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetScaleOutRepositoryForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetScaleOutRepositoryNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetScaleOutRepositoryInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetScaleOutRepositoryOK creates a GetScaleOutRepositoryOK with default headers values -func NewGetScaleOutRepositoryOK() *GetScaleOutRepositoryOK { - return &GetScaleOutRepositoryOK{} -} - -/* GetScaleOutRepositoryOK describes a response with status code 200, with default header values. - -OK -*/ -type GetScaleOutRepositoryOK struct { - Payload *models.ScaleOutRepositoryModel -} - -func (o *GetScaleOutRepositoryOK) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories/{id}][%d] getScaleOutRepositoryOK %+v", 200, o.Payload) -} -func (o *GetScaleOutRepositoryOK) GetPayload() *models.ScaleOutRepositoryModel { - return o.Payload -} - -func (o *GetScaleOutRepositoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ScaleOutRepositoryModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetScaleOutRepositoryUnauthorized creates a GetScaleOutRepositoryUnauthorized with default headers values -func NewGetScaleOutRepositoryUnauthorized() *GetScaleOutRepositoryUnauthorized { - return &GetScaleOutRepositoryUnauthorized{} -} - -/* GetScaleOutRepositoryUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetScaleOutRepositoryUnauthorized struct { - Payload *models.Error -} - -func (o *GetScaleOutRepositoryUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories/{id}][%d] getScaleOutRepositoryUnauthorized %+v", 401, o.Payload) -} -func (o *GetScaleOutRepositoryUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetScaleOutRepositoryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetScaleOutRepositoryForbidden creates a GetScaleOutRepositoryForbidden with default headers values -func NewGetScaleOutRepositoryForbidden() *GetScaleOutRepositoryForbidden { - return &GetScaleOutRepositoryForbidden{} -} - -/* GetScaleOutRepositoryForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetScaleOutRepositoryForbidden struct { - Payload *models.Error -} - -func (o *GetScaleOutRepositoryForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories/{id}][%d] getScaleOutRepositoryForbidden %+v", 403, o.Payload) -} -func (o *GetScaleOutRepositoryForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetScaleOutRepositoryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetScaleOutRepositoryNotFound creates a GetScaleOutRepositoryNotFound with default headers values -func NewGetScaleOutRepositoryNotFound() *GetScaleOutRepositoryNotFound { - return &GetScaleOutRepositoryNotFound{} -} - -/* GetScaleOutRepositoryNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetScaleOutRepositoryNotFound struct { - Payload *models.Error -} - -func (o *GetScaleOutRepositoryNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories/{id}][%d] getScaleOutRepositoryNotFound %+v", 404, o.Payload) -} -func (o *GetScaleOutRepositoryNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetScaleOutRepositoryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetScaleOutRepositoryInternalServerError creates a GetScaleOutRepositoryInternalServerError with default headers values -func NewGetScaleOutRepositoryInternalServerError() *GetScaleOutRepositoryInternalServerError { - return &GetScaleOutRepositoryInternalServerError{} -} - -/* GetScaleOutRepositoryInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetScaleOutRepositoryInternalServerError struct { - Payload *models.Error -} - -func (o *GetScaleOutRepositoryInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/backupInfrastructure/scaleOutRepositories/{id}][%d] getScaleOutRepositoryInternalServerError %+v", 500, o.Payload) -} -func (o *GetScaleOutRepositoryInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetScaleOutRepositoryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/repositories/repositories_client.go b/client/repositories/repositories_client.go deleted file mode 100644 index 3c9d32a..0000000 --- a/client/repositories/repositories_client.go +++ /dev/null @@ -1,469 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new repositories API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for repositories API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateRepository(params *CreateRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRepositoryCreated, error) - - DeleteRepository(params *DeleteRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRepositoryNoContent, error) - - DisableScaleOutExtentMaintenanceMode(params *DisableScaleOutExtentMaintenanceModeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableScaleOutExtentMaintenanceModeCreated, error) - - EnableScaleOutExtentMaintenanceMode(params *EnableScaleOutExtentMaintenanceModeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableScaleOutExtentMaintenanceModeCreated, error) - - GetAllRepositories(params *GetAllRepositoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllRepositoriesOK, error) - - GetAllRepositoriesStates(params *GetAllRepositoriesStatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllRepositoriesStatesOK, error) - - GetAllScaleOutRepositories(params *GetAllScaleOutRepositoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllScaleOutRepositoriesOK, error) - - GetRepository(params *GetRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRepositoryOK, error) - - GetScaleOutRepository(params *GetScaleOutRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetScaleOutRepositoryOK, error) - - UpdateRepository(params *UpdateRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRepositoryCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateRepository adds repository - - The HTTP POST request to the `/api/v1/backupInfrastructure/repositories` path allows you to add a repository to the backup infrastructure. -*/ -func (a *Client) CreateRepository(params *CreateRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRepositoryCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateRepositoryParams() - } - op := &runtime.ClientOperation{ - ID: "CreateRepository", - Method: "POST", - PathPattern: "/api/v1/backupInfrastructure/repositories", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateRepositoryReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateRepositoryCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteRepository removes repository - - The HTTP DELETE request to the `/api/v1/backupInfrastructure/repositories/{id}` path allows you to remove a backup repository that has the specified `id` from the backup infrastructure. -*/ -func (a *Client) DeleteRepository(params *DeleteRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRepositoryNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteRepositoryParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteRepository", - Method: "DELETE", - PathPattern: "/api/v1/backupInfrastructure/repositories/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteRepositoryReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteRepositoryNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DisableScaleOutExtentMaintenanceMode disables maintenance mode - - The HTTP POST request to the `/api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode` path allows you to disable maintenance mode for a scale-out backup repository extent that has the specified `id`. -*/ -func (a *Client) DisableScaleOutExtentMaintenanceMode(params *DisableScaleOutExtentMaintenanceModeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableScaleOutExtentMaintenanceModeCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDisableScaleOutExtentMaintenanceModeParams() - } - op := &runtime.ClientOperation{ - ID: "DisableScaleOutExtentMaintenanceMode", - Method: "POST", - PathPattern: "/api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DisableScaleOutExtentMaintenanceModeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DisableScaleOutExtentMaintenanceModeCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DisableScaleOutExtentMaintenanceMode: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnableScaleOutExtentMaintenanceMode enables maintenance mode - - The HTTP POST request to the `/api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode` path allows you to enable maintenance mode for a scale-out backup repository extent that has the specified `id`. -*/ -func (a *Client) EnableScaleOutExtentMaintenanceMode(params *EnableScaleOutExtentMaintenanceModeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableScaleOutExtentMaintenanceModeCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnableScaleOutExtentMaintenanceModeParams() - } - op := &runtime.ClientOperation{ - ID: "EnableScaleOutExtentMaintenanceMode", - Method: "POST", - PathPattern: "/api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &EnableScaleOutExtentMaintenanceModeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnableScaleOutExtentMaintenanceModeCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for EnableScaleOutExtentMaintenanceMode: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllRepositories gets all repositories - - The HTTP GET request to the `/api/v1/backupInfrastructure/repositories` path allows you to get an array of all backup repositories that are added to the backup infrastructure. -*/ -func (a *Client) GetAllRepositories(params *GetAllRepositoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllRepositoriesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllRepositoriesParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllRepositories", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/repositories", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllRepositoriesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllRepositoriesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllRepositories: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllRepositoriesStates gets all repository states - - The HTTP GET request to the `/api/v1/backupInfrastructure/repositories/states` path allows you to get an array of all repository states. The states include repository location and brief statistics, such as repository capacity, free and used space. -*/ -func (a *Client) GetAllRepositoriesStates(params *GetAllRepositoriesStatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllRepositoriesStatesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllRepositoriesStatesParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllRepositoriesStates", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/repositories/states", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllRepositoriesStatesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllRepositoriesStatesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllRepositoriesStates: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetAllScaleOutRepositories gets all scale out backup repositories - - The HTTP GET request to the `/api/v1/backupInfrastructure/scaleOutRepositories` path allows you to get an array of all scale-out backup repositories that are added to the backup infrastructure. -*/ -func (a *Client) GetAllScaleOutRepositories(params *GetAllScaleOutRepositoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllScaleOutRepositoriesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllScaleOutRepositoriesParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllScaleOutRepositories", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/scaleOutRepositories", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllScaleOutRepositoriesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllScaleOutRepositoriesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllScaleOutRepositories: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetRepository gets repository - - The HTTP GET request to the `/api/v1/backupInfrastructure/repositories/{id}` path allows you to get a backup repository that has the specified `id`. -*/ -func (a *Client) GetRepository(params *GetRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRepositoryOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetRepositoryParams() - } - op := &runtime.ClientOperation{ - ID: "GetRepository", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/repositories/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetRepositoryReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetRepositoryOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetScaleOutRepository gets scale out backup repository - - The HTTP GET request to the `/api/v1/backupInfrastructure/scaleOutRepositories/{id}` path allows you to get a scale-out backup repository that has the specified `id`. -*/ -func (a *Client) GetScaleOutRepository(params *GetScaleOutRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetScaleOutRepositoryOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetScaleOutRepositoryParams() - } - op := &runtime.ClientOperation{ - ID: "GetScaleOutRepository", - Method: "GET", - PathPattern: "/api/v1/backupInfrastructure/scaleOutRepositories/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetScaleOutRepositoryReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetScaleOutRepositoryOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetScaleOutRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateRepository edits repository - - The HTTP PUT request to the `/api/v1/backupInfrastructure/repositories/{id}` path allows you to edit a backup repository that has the specified `id`. -*/ -func (a *Client) UpdateRepository(params *UpdateRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRepositoryCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateRepositoryParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateRepository", - Method: "PUT", - PathPattern: "/api/v1/backupInfrastructure/repositories/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateRepositoryReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateRepositoryCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateRepository: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/repositories/update_repository_parameters.go b/client/repositories/update_repository_parameters.go deleted file mode 100644 index 3b91c7e..0000000 --- a/client/repositories/update_repository_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateRepositoryParams creates a new UpdateRepositoryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateRepositoryParams() *UpdateRepositoryParams { - return &UpdateRepositoryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateRepositoryParamsWithTimeout creates a new UpdateRepositoryParams object -// with the ability to set a timeout on a request. -func NewUpdateRepositoryParamsWithTimeout(timeout time.Duration) *UpdateRepositoryParams { - return &UpdateRepositoryParams{ - timeout: timeout, - } -} - -// NewUpdateRepositoryParamsWithContext creates a new UpdateRepositoryParams object -// with the ability to set a context for a request. -func NewUpdateRepositoryParamsWithContext(ctx context.Context) *UpdateRepositoryParams { - return &UpdateRepositoryParams{ - Context: ctx, - } -} - -// NewUpdateRepositoryParamsWithHTTPClient creates a new UpdateRepositoryParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateRepositoryParamsWithHTTPClient(client *http.Client) *UpdateRepositoryParams { - return &UpdateRepositoryParams{ - HTTPClient: client, - } -} - -/* UpdateRepositoryParams contains all the parameters to send to the API endpoint - for the update repository operation. - - Typically these are written to a http.Request. -*/ -type UpdateRepositoryParams struct { - - // Body. - Body *models.RepositoryModel - - /* ID. - - ID of the backup repository. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateRepositoryParams) WithDefaults() *UpdateRepositoryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update repository params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateRepositoryParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateRepositoryParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update repository params -func (o *UpdateRepositoryParams) WithTimeout(timeout time.Duration) *UpdateRepositoryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update repository params -func (o *UpdateRepositoryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update repository params -func (o *UpdateRepositoryParams) WithContext(ctx context.Context) *UpdateRepositoryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update repository params -func (o *UpdateRepositoryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update repository params -func (o *UpdateRepositoryParams) WithHTTPClient(client *http.Client) *UpdateRepositoryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update repository params -func (o *UpdateRepositoryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update repository params -func (o *UpdateRepositoryParams) WithBody(body *models.RepositoryModel) *UpdateRepositoryParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update repository params -func (o *UpdateRepositoryParams) SetBody(body *models.RepositoryModel) { - o.Body = body -} - -// WithID adds the id to the update repository params -func (o *UpdateRepositoryParams) WithID(id strfmt.UUID) *UpdateRepositoryParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update repository params -func (o *UpdateRepositoryParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the update repository params -func (o *UpdateRepositoryParams) WithXAPIVersion(xAPIVersion string) *UpdateRepositoryParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update repository params -func (o *UpdateRepositoryParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateRepositoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/repositories/update_repository_responses.go b/client/repositories/update_repository_responses.go deleted file mode 100644 index 4849b01..0000000 --- a/client/repositories/update_repository_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package repositories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateRepositoryReader is a Reader for the UpdateRepository structure. -type UpdateRepositoryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateRepositoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewUpdateRepositoryCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateRepositoryBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateRepositoryUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateRepositoryForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateRepositoryNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateRepositoryInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateRepositoryCreated creates a UpdateRepositoryCreated with default headers values -func NewUpdateRepositoryCreated() *UpdateRepositoryCreated { - return &UpdateRepositoryCreated{} -} - -/* UpdateRepositoryCreated describes a response with status code 201, with default header values. - -Infrastructure session has been created to edit the repository. To check the progress, track the session `state`. -*/ -type UpdateRepositoryCreated struct { - Payload *models.SessionModel -} - -func (o *UpdateRepositoryCreated) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/repositories/{id}][%d] updateRepositoryCreated %+v", 201, o.Payload) -} -func (o *UpdateRepositoryCreated) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *UpdateRepositoryCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateRepositoryBadRequest creates a UpdateRepositoryBadRequest with default headers values -func NewUpdateRepositoryBadRequest() *UpdateRepositoryBadRequest { - return &UpdateRepositoryBadRequest{} -} - -/* UpdateRepositoryBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateRepositoryBadRequest struct { - Payload *models.Error -} - -func (o *UpdateRepositoryBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/repositories/{id}][%d] updateRepositoryBadRequest %+v", 400, o.Payload) -} -func (o *UpdateRepositoryBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateRepositoryBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateRepositoryUnauthorized creates a UpdateRepositoryUnauthorized with default headers values -func NewUpdateRepositoryUnauthorized() *UpdateRepositoryUnauthorized { - return &UpdateRepositoryUnauthorized{} -} - -/* UpdateRepositoryUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateRepositoryUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateRepositoryUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/repositories/{id}][%d] updateRepositoryUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateRepositoryUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateRepositoryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateRepositoryForbidden creates a UpdateRepositoryForbidden with default headers values -func NewUpdateRepositoryForbidden() *UpdateRepositoryForbidden { - return &UpdateRepositoryForbidden{} -} - -/* UpdateRepositoryForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateRepositoryForbidden struct { - Payload *models.Error -} - -func (o *UpdateRepositoryForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/repositories/{id}][%d] updateRepositoryForbidden %+v", 403, o.Payload) -} -func (o *UpdateRepositoryForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateRepositoryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateRepositoryNotFound creates a UpdateRepositoryNotFound with default headers values -func NewUpdateRepositoryNotFound() *UpdateRepositoryNotFound { - return &UpdateRepositoryNotFound{} -} - -/* UpdateRepositoryNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type UpdateRepositoryNotFound struct { - Payload *models.Error -} - -func (o *UpdateRepositoryNotFound) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/repositories/{id}][%d] updateRepositoryNotFound %+v", 404, o.Payload) -} -func (o *UpdateRepositoryNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateRepositoryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateRepositoryInternalServerError creates a UpdateRepositoryInternalServerError with default headers values -func NewUpdateRepositoryInternalServerError() *UpdateRepositoryInternalServerError { - return &UpdateRepositoryInternalServerError{} -} - -/* UpdateRepositoryInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateRepositoryInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateRepositoryInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/backupInfrastructure/repositories/{id}][%d] updateRepositoryInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateRepositoryInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateRepositoryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/restore/get_vmware_fcd_instant_recovery_mount_model_parameters.go b/client/restore/get_vmware_fcd_instant_recovery_mount_model_parameters.go deleted file mode 100644 index 85af0df..0000000 --- a/client/restore/get_vmware_fcd_instant_recovery_mount_model_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetVmwareFcdInstantRecoveryMountModelParams creates a new GetVmwareFcdInstantRecoveryMountModelParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetVmwareFcdInstantRecoveryMountModelParams() *GetVmwareFcdInstantRecoveryMountModelParams { - return &GetVmwareFcdInstantRecoveryMountModelParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetVmwareFcdInstantRecoveryMountModelParamsWithTimeout creates a new GetVmwareFcdInstantRecoveryMountModelParams object -// with the ability to set a timeout on a request. -func NewGetVmwareFcdInstantRecoveryMountModelParamsWithTimeout(timeout time.Duration) *GetVmwareFcdInstantRecoveryMountModelParams { - return &GetVmwareFcdInstantRecoveryMountModelParams{ - timeout: timeout, - } -} - -// NewGetVmwareFcdInstantRecoveryMountModelParamsWithContext creates a new GetVmwareFcdInstantRecoveryMountModelParams object -// with the ability to set a context for a request. -func NewGetVmwareFcdInstantRecoveryMountModelParamsWithContext(ctx context.Context) *GetVmwareFcdInstantRecoveryMountModelParams { - return &GetVmwareFcdInstantRecoveryMountModelParams{ - Context: ctx, - } -} - -// NewGetVmwareFcdInstantRecoveryMountModelParamsWithHTTPClient creates a new GetVmwareFcdInstantRecoveryMountModelParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetVmwareFcdInstantRecoveryMountModelParamsWithHTTPClient(client *http.Client) *GetVmwareFcdInstantRecoveryMountModelParams { - return &GetVmwareFcdInstantRecoveryMountModelParams{ - HTTPClient: client, - } -} - -/* GetVmwareFcdInstantRecoveryMountModelParams contains all the parameters to send to the API endpoint - for the get vmware fcd instant recovery mount model operation. - - Typically these are written to a http.Request. -*/ -type GetVmwareFcdInstantRecoveryMountModelParams struct { - - /* MountID. - - Mount ID. - - Format: uuid - */ - MountID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get vmware fcd instant recovery mount model params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVmwareFcdInstantRecoveryMountModelParams) WithDefaults() *GetVmwareFcdInstantRecoveryMountModelParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get vmware fcd instant recovery mount model params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVmwareFcdInstantRecoveryMountModelParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetVmwareFcdInstantRecoveryMountModelParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) WithTimeout(timeout time.Duration) *GetVmwareFcdInstantRecoveryMountModelParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) WithContext(ctx context.Context) *GetVmwareFcdInstantRecoveryMountModelParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) WithHTTPClient(client *http.Client) *GetVmwareFcdInstantRecoveryMountModelParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMountID adds the mountID to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) WithMountID(mountID strfmt.UUID) *GetVmwareFcdInstantRecoveryMountModelParams { - o.SetMountID(mountID) - return o -} - -// SetMountID adds the mountId to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) SetMountID(mountID strfmt.UUID) { - o.MountID = mountID -} - -// WithXAPIVersion adds the xAPIVersion to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) WithXAPIVersion(xAPIVersion string) *GetVmwareFcdInstantRecoveryMountModelParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get vmware fcd instant recovery mount model params -func (o *GetVmwareFcdInstantRecoveryMountModelParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetVmwareFcdInstantRecoveryMountModelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param mountId - if err := r.SetPathParam("mountId", o.MountID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/restore/get_vmware_fcd_instant_recovery_mount_model_responses.go b/client/restore/get_vmware_fcd_instant_recovery_mount_model_responses.go deleted file mode 100644 index 63a503e..0000000 --- a/client/restore/get_vmware_fcd_instant_recovery_mount_model_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetVmwareFcdInstantRecoveryMountModelReader is a Reader for the GetVmwareFcdInstantRecoveryMountModel structure. -type GetVmwareFcdInstantRecoveryMountModelReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetVmwareFcdInstantRecoveryMountModelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetVmwareFcdInstantRecoveryMountModelOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetVmwareFcdInstantRecoveryMountModelUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetVmwareFcdInstantRecoveryMountModelForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetVmwareFcdInstantRecoveryMountModelNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetVmwareFcdInstantRecoveryMountModelInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetVmwareFcdInstantRecoveryMountModelOK creates a GetVmwareFcdInstantRecoveryMountModelOK with default headers values -func NewGetVmwareFcdInstantRecoveryMountModelOK() *GetVmwareFcdInstantRecoveryMountModelOK { - return &GetVmwareFcdInstantRecoveryMountModelOK{} -} - -/* GetVmwareFcdInstantRecoveryMountModelOK describes a response with status code 200, with default header values. - -OK -*/ -type GetVmwareFcdInstantRecoveryMountModelOK struct { - Payload *models.VmwareFcdInstantRecoveryMount -} - -func (o *GetVmwareFcdInstantRecoveryMountModelOK) Error() string { - return fmt.Sprintf("[GET /api/v1/restore/instantRecovery/vmware/fcd/{mountId}][%d] getVmwareFcdInstantRecoveryMountModelOK %+v", 200, o.Payload) -} -func (o *GetVmwareFcdInstantRecoveryMountModelOK) GetPayload() *models.VmwareFcdInstantRecoveryMount { - return o.Payload -} - -func (o *GetVmwareFcdInstantRecoveryMountModelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VmwareFcdInstantRecoveryMount) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetVmwareFcdInstantRecoveryMountModelUnauthorized creates a GetVmwareFcdInstantRecoveryMountModelUnauthorized with default headers values -func NewGetVmwareFcdInstantRecoveryMountModelUnauthorized() *GetVmwareFcdInstantRecoveryMountModelUnauthorized { - return &GetVmwareFcdInstantRecoveryMountModelUnauthorized{} -} - -/* GetVmwareFcdInstantRecoveryMountModelUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetVmwareFcdInstantRecoveryMountModelUnauthorized struct { - Payload *models.Error -} - -func (o *GetVmwareFcdInstantRecoveryMountModelUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/restore/instantRecovery/vmware/fcd/{mountId}][%d] getVmwareFcdInstantRecoveryMountModelUnauthorized %+v", 401, o.Payload) -} -func (o *GetVmwareFcdInstantRecoveryMountModelUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetVmwareFcdInstantRecoveryMountModelUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetVmwareFcdInstantRecoveryMountModelForbidden creates a GetVmwareFcdInstantRecoveryMountModelForbidden with default headers values -func NewGetVmwareFcdInstantRecoveryMountModelForbidden() *GetVmwareFcdInstantRecoveryMountModelForbidden { - return &GetVmwareFcdInstantRecoveryMountModelForbidden{} -} - -/* GetVmwareFcdInstantRecoveryMountModelForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetVmwareFcdInstantRecoveryMountModelForbidden struct { - Payload *models.Error -} - -func (o *GetVmwareFcdInstantRecoveryMountModelForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/restore/instantRecovery/vmware/fcd/{mountId}][%d] getVmwareFcdInstantRecoveryMountModelForbidden %+v", 403, o.Payload) -} -func (o *GetVmwareFcdInstantRecoveryMountModelForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetVmwareFcdInstantRecoveryMountModelForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetVmwareFcdInstantRecoveryMountModelNotFound creates a GetVmwareFcdInstantRecoveryMountModelNotFound with default headers values -func NewGetVmwareFcdInstantRecoveryMountModelNotFound() *GetVmwareFcdInstantRecoveryMountModelNotFound { - return &GetVmwareFcdInstantRecoveryMountModelNotFound{} -} - -/* GetVmwareFcdInstantRecoveryMountModelNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetVmwareFcdInstantRecoveryMountModelNotFound struct { - Payload *models.Error -} - -func (o *GetVmwareFcdInstantRecoveryMountModelNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/restore/instantRecovery/vmware/fcd/{mountId}][%d] getVmwareFcdInstantRecoveryMountModelNotFound %+v", 404, o.Payload) -} -func (o *GetVmwareFcdInstantRecoveryMountModelNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetVmwareFcdInstantRecoveryMountModelNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetVmwareFcdInstantRecoveryMountModelInternalServerError creates a GetVmwareFcdInstantRecoveryMountModelInternalServerError with default headers values -func NewGetVmwareFcdInstantRecoveryMountModelInternalServerError() *GetVmwareFcdInstantRecoveryMountModelInternalServerError { - return &GetVmwareFcdInstantRecoveryMountModelInternalServerError{} -} - -/* GetVmwareFcdInstantRecoveryMountModelInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetVmwareFcdInstantRecoveryMountModelInternalServerError struct { - Payload *models.Error -} - -func (o *GetVmwareFcdInstantRecoveryMountModelInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/restore/instantRecovery/vmware/fcd/{mountId}][%d] getVmwareFcdInstantRecoveryMountModelInternalServerError %+v", 500, o.Payload) -} -func (o *GetVmwareFcdInstantRecoveryMountModelInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetVmwareFcdInstantRecoveryMountModelInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/restore/instant_recovery_vmware_fcd_dismount_parameters.go b/client/restore/instant_recovery_vmware_fcd_dismount_parameters.go deleted file mode 100644 index c069b9c..0000000 --- a/client/restore/instant_recovery_vmware_fcd_dismount_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInstantRecoveryVmwareFcdDismountParams creates a new InstantRecoveryVmwareFcdDismountParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInstantRecoveryVmwareFcdDismountParams() *InstantRecoveryVmwareFcdDismountParams { - return &InstantRecoveryVmwareFcdDismountParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInstantRecoveryVmwareFcdDismountParamsWithTimeout creates a new InstantRecoveryVmwareFcdDismountParams object -// with the ability to set a timeout on a request. -func NewInstantRecoveryVmwareFcdDismountParamsWithTimeout(timeout time.Duration) *InstantRecoveryVmwareFcdDismountParams { - return &InstantRecoveryVmwareFcdDismountParams{ - timeout: timeout, - } -} - -// NewInstantRecoveryVmwareFcdDismountParamsWithContext creates a new InstantRecoveryVmwareFcdDismountParams object -// with the ability to set a context for a request. -func NewInstantRecoveryVmwareFcdDismountParamsWithContext(ctx context.Context) *InstantRecoveryVmwareFcdDismountParams { - return &InstantRecoveryVmwareFcdDismountParams{ - Context: ctx, - } -} - -// NewInstantRecoveryVmwareFcdDismountParamsWithHTTPClient creates a new InstantRecoveryVmwareFcdDismountParams object -// with the ability to set a custom HTTPClient for a request. -func NewInstantRecoveryVmwareFcdDismountParamsWithHTTPClient(client *http.Client) *InstantRecoveryVmwareFcdDismountParams { - return &InstantRecoveryVmwareFcdDismountParams{ - HTTPClient: client, - } -} - -/* InstantRecoveryVmwareFcdDismountParams contains all the parameters to send to the API endpoint - for the instant recovery vmware fcd dismount operation. - - Typically these are written to a http.Request. -*/ -type InstantRecoveryVmwareFcdDismountParams struct { - - /* MountID. - - Mount ID. - - Format: uuid - */ - MountID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the instant recovery vmware fcd dismount params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InstantRecoveryVmwareFcdDismountParams) WithDefaults() *InstantRecoveryVmwareFcdDismountParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the instant recovery vmware fcd dismount params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InstantRecoveryVmwareFcdDismountParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := InstantRecoveryVmwareFcdDismountParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) WithTimeout(timeout time.Duration) *InstantRecoveryVmwareFcdDismountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) WithContext(ctx context.Context) *InstantRecoveryVmwareFcdDismountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) WithHTTPClient(client *http.Client) *InstantRecoveryVmwareFcdDismountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMountID adds the mountID to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) WithMountID(mountID strfmt.UUID) *InstantRecoveryVmwareFcdDismountParams { - o.SetMountID(mountID) - return o -} - -// SetMountID adds the mountId to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) SetMountID(mountID strfmt.UUID) { - o.MountID = mountID -} - -// WithXAPIVersion adds the xAPIVersion to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) WithXAPIVersion(xAPIVersion string) *InstantRecoveryVmwareFcdDismountParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the instant recovery vmware fcd dismount params -func (o *InstantRecoveryVmwareFcdDismountParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *InstantRecoveryVmwareFcdDismountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param mountId - if err := r.SetPathParam("mountId", o.MountID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/restore/instant_recovery_vmware_fcd_dismount_responses.go b/client/restore/instant_recovery_vmware_fcd_dismount_responses.go deleted file mode 100644 index b8706c9..0000000 --- a/client/restore/instant_recovery_vmware_fcd_dismount_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// InstantRecoveryVmwareFcdDismountReader is a Reader for the InstantRecoveryVmwareFcdDismount structure. -type InstantRecoveryVmwareFcdDismountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InstantRecoveryVmwareFcdDismountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInstantRecoveryVmwareFcdDismountOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewInstantRecoveryVmwareFcdDismountBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewInstantRecoveryVmwareFcdDismountUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewInstantRecoveryVmwareFcdDismountForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewInstantRecoveryVmwareFcdDismountNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInstantRecoveryVmwareFcdDismountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewInstantRecoveryVmwareFcdDismountOK creates a InstantRecoveryVmwareFcdDismountOK with default headers values -func NewInstantRecoveryVmwareFcdDismountOK() *InstantRecoveryVmwareFcdDismountOK { - return &InstantRecoveryVmwareFcdDismountOK{} -} - -/* InstantRecoveryVmwareFcdDismountOK describes a response with status code 200, with default header values. - -Disks has been unmounted. -*/ -type InstantRecoveryVmwareFcdDismountOK struct { - Payload *models.VmwareFcdInstantRecoveryMount -} - -func (o *InstantRecoveryVmwareFcdDismountOK) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount][%d] instantRecoveryVmwareFcdDismountOK %+v", 200, o.Payload) -} -func (o *InstantRecoveryVmwareFcdDismountOK) GetPayload() *models.VmwareFcdInstantRecoveryMount { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdDismountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VmwareFcdInstantRecoveryMount) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdDismountBadRequest creates a InstantRecoveryVmwareFcdDismountBadRequest with default headers values -func NewInstantRecoveryVmwareFcdDismountBadRequest() *InstantRecoveryVmwareFcdDismountBadRequest { - return &InstantRecoveryVmwareFcdDismountBadRequest{} -} - -/* InstantRecoveryVmwareFcdDismountBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type InstantRecoveryVmwareFcdDismountBadRequest struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdDismountBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount][%d] instantRecoveryVmwareFcdDismountBadRequest %+v", 400, o.Payload) -} -func (o *InstantRecoveryVmwareFcdDismountBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdDismountBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdDismountUnauthorized creates a InstantRecoveryVmwareFcdDismountUnauthorized with default headers values -func NewInstantRecoveryVmwareFcdDismountUnauthorized() *InstantRecoveryVmwareFcdDismountUnauthorized { - return &InstantRecoveryVmwareFcdDismountUnauthorized{} -} - -/* InstantRecoveryVmwareFcdDismountUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type InstantRecoveryVmwareFcdDismountUnauthorized struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdDismountUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount][%d] instantRecoveryVmwareFcdDismountUnauthorized %+v", 401, o.Payload) -} -func (o *InstantRecoveryVmwareFcdDismountUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdDismountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdDismountForbidden creates a InstantRecoveryVmwareFcdDismountForbidden with default headers values -func NewInstantRecoveryVmwareFcdDismountForbidden() *InstantRecoveryVmwareFcdDismountForbidden { - return &InstantRecoveryVmwareFcdDismountForbidden{} -} - -/* InstantRecoveryVmwareFcdDismountForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type InstantRecoveryVmwareFcdDismountForbidden struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdDismountForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount][%d] instantRecoveryVmwareFcdDismountForbidden %+v", 403, o.Payload) -} -func (o *InstantRecoveryVmwareFcdDismountForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdDismountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdDismountNotFound creates a InstantRecoveryVmwareFcdDismountNotFound with default headers values -func NewInstantRecoveryVmwareFcdDismountNotFound() *InstantRecoveryVmwareFcdDismountNotFound { - return &InstantRecoveryVmwareFcdDismountNotFound{} -} - -/* InstantRecoveryVmwareFcdDismountNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type InstantRecoveryVmwareFcdDismountNotFound struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdDismountNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount][%d] instantRecoveryVmwareFcdDismountNotFound %+v", 404, o.Payload) -} -func (o *InstantRecoveryVmwareFcdDismountNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdDismountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdDismountInternalServerError creates a InstantRecoveryVmwareFcdDismountInternalServerError with default headers values -func NewInstantRecoveryVmwareFcdDismountInternalServerError() *InstantRecoveryVmwareFcdDismountInternalServerError { - return &InstantRecoveryVmwareFcdDismountInternalServerError{} -} - -/* InstantRecoveryVmwareFcdDismountInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type InstantRecoveryVmwareFcdDismountInternalServerError struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdDismountInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount][%d] instantRecoveryVmwareFcdDismountInternalServerError %+v", 500, o.Payload) -} -func (o *InstantRecoveryVmwareFcdDismountInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdDismountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/restore/instant_recovery_vmware_fcd_migrate_parameters.go b/client/restore/instant_recovery_vmware_fcd_migrate_parameters.go deleted file mode 100644 index cdfad46..0000000 --- a/client/restore/instant_recovery_vmware_fcd_migrate_parameters.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewInstantRecoveryVmwareFcdMigrateParams creates a new InstantRecoveryVmwareFcdMigrateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInstantRecoveryVmwareFcdMigrateParams() *InstantRecoveryVmwareFcdMigrateParams { - return &InstantRecoveryVmwareFcdMigrateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInstantRecoveryVmwareFcdMigrateParamsWithTimeout creates a new InstantRecoveryVmwareFcdMigrateParams object -// with the ability to set a timeout on a request. -func NewInstantRecoveryVmwareFcdMigrateParamsWithTimeout(timeout time.Duration) *InstantRecoveryVmwareFcdMigrateParams { - return &InstantRecoveryVmwareFcdMigrateParams{ - timeout: timeout, - } -} - -// NewInstantRecoveryVmwareFcdMigrateParamsWithContext creates a new InstantRecoveryVmwareFcdMigrateParams object -// with the ability to set a context for a request. -func NewInstantRecoveryVmwareFcdMigrateParamsWithContext(ctx context.Context) *InstantRecoveryVmwareFcdMigrateParams { - return &InstantRecoveryVmwareFcdMigrateParams{ - Context: ctx, - } -} - -// NewInstantRecoveryVmwareFcdMigrateParamsWithHTTPClient creates a new InstantRecoveryVmwareFcdMigrateParams object -// with the ability to set a custom HTTPClient for a request. -func NewInstantRecoveryVmwareFcdMigrateParamsWithHTTPClient(client *http.Client) *InstantRecoveryVmwareFcdMigrateParams { - return &InstantRecoveryVmwareFcdMigrateParams{ - HTTPClient: client, - } -} - -/* InstantRecoveryVmwareFcdMigrateParams contains all the parameters to send to the API endpoint - for the instant recovery vmware fcd migrate operation. - - Typically these are written to a http.Request. -*/ -type InstantRecoveryVmwareFcdMigrateParams struct { - - // Body. - Body *models.VmwareFcdQuickMigrationSpec - - /* MountID. - - Mount ID. - - Format: uuid - */ - MountID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the instant recovery vmware fcd migrate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InstantRecoveryVmwareFcdMigrateParams) WithDefaults() *InstantRecoveryVmwareFcdMigrateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the instant recovery vmware fcd migrate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InstantRecoveryVmwareFcdMigrateParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := InstantRecoveryVmwareFcdMigrateParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) WithTimeout(timeout time.Duration) *InstantRecoveryVmwareFcdMigrateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) WithContext(ctx context.Context) *InstantRecoveryVmwareFcdMigrateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) WithHTTPClient(client *http.Client) *InstantRecoveryVmwareFcdMigrateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) WithBody(body *models.VmwareFcdQuickMigrationSpec) *InstantRecoveryVmwareFcdMigrateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) SetBody(body *models.VmwareFcdQuickMigrationSpec) { - o.Body = body -} - -// WithMountID adds the mountID to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) WithMountID(mountID strfmt.UUID) *InstantRecoveryVmwareFcdMigrateParams { - o.SetMountID(mountID) - return o -} - -// SetMountID adds the mountId to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) SetMountID(mountID strfmt.UUID) { - o.MountID = mountID -} - -// WithXAPIVersion adds the xAPIVersion to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) WithXAPIVersion(xAPIVersion string) *InstantRecoveryVmwareFcdMigrateParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the instant recovery vmware fcd migrate params -func (o *InstantRecoveryVmwareFcdMigrateParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *InstantRecoveryVmwareFcdMigrateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mountId - if err := r.SetPathParam("mountId", o.MountID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/restore/instant_recovery_vmware_fcd_migrate_responses.go b/client/restore/instant_recovery_vmware_fcd_migrate_responses.go deleted file mode 100644 index 2d9d6be..0000000 --- a/client/restore/instant_recovery_vmware_fcd_migrate_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// InstantRecoveryVmwareFcdMigrateReader is a Reader for the InstantRecoveryVmwareFcdMigrate structure. -type InstantRecoveryVmwareFcdMigrateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InstantRecoveryVmwareFcdMigrateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInstantRecoveryVmwareFcdMigrateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewInstantRecoveryVmwareFcdMigrateBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewInstantRecoveryVmwareFcdMigrateUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewInstantRecoveryVmwareFcdMigrateForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewInstantRecoveryVmwareFcdMigrateNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInstantRecoveryVmwareFcdMigrateInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewInstantRecoveryVmwareFcdMigrateOK creates a InstantRecoveryVmwareFcdMigrateOK with default headers values -func NewInstantRecoveryVmwareFcdMigrateOK() *InstantRecoveryVmwareFcdMigrateOK { - return &InstantRecoveryVmwareFcdMigrateOK{} -} - -/* InstantRecoveryVmwareFcdMigrateOK describes a response with status code 200, with default header values. - -FCD Migration has been started. -*/ -type InstantRecoveryVmwareFcdMigrateOK struct { - Payload *models.VmwareFcdInstantRecoveryMount -} - -func (o *InstantRecoveryVmwareFcdMigrateOK) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate][%d] instantRecoveryVmwareFcdMigrateOK %+v", 200, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMigrateOK) GetPayload() *models.VmwareFcdInstantRecoveryMount { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMigrateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VmwareFcdInstantRecoveryMount) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMigrateBadRequest creates a InstantRecoveryVmwareFcdMigrateBadRequest with default headers values -func NewInstantRecoveryVmwareFcdMigrateBadRequest() *InstantRecoveryVmwareFcdMigrateBadRequest { - return &InstantRecoveryVmwareFcdMigrateBadRequest{} -} - -/* InstantRecoveryVmwareFcdMigrateBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type InstantRecoveryVmwareFcdMigrateBadRequest struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMigrateBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate][%d] instantRecoveryVmwareFcdMigrateBadRequest %+v", 400, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMigrateBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMigrateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMigrateUnauthorized creates a InstantRecoveryVmwareFcdMigrateUnauthorized with default headers values -func NewInstantRecoveryVmwareFcdMigrateUnauthorized() *InstantRecoveryVmwareFcdMigrateUnauthorized { - return &InstantRecoveryVmwareFcdMigrateUnauthorized{} -} - -/* InstantRecoveryVmwareFcdMigrateUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type InstantRecoveryVmwareFcdMigrateUnauthorized struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMigrateUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate][%d] instantRecoveryVmwareFcdMigrateUnauthorized %+v", 401, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMigrateUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMigrateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMigrateForbidden creates a InstantRecoveryVmwareFcdMigrateForbidden with default headers values -func NewInstantRecoveryVmwareFcdMigrateForbidden() *InstantRecoveryVmwareFcdMigrateForbidden { - return &InstantRecoveryVmwareFcdMigrateForbidden{} -} - -/* InstantRecoveryVmwareFcdMigrateForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type InstantRecoveryVmwareFcdMigrateForbidden struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMigrateForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate][%d] instantRecoveryVmwareFcdMigrateForbidden %+v", 403, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMigrateForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMigrateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMigrateNotFound creates a InstantRecoveryVmwareFcdMigrateNotFound with default headers values -func NewInstantRecoveryVmwareFcdMigrateNotFound() *InstantRecoveryVmwareFcdMigrateNotFound { - return &InstantRecoveryVmwareFcdMigrateNotFound{} -} - -/* InstantRecoveryVmwareFcdMigrateNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type InstantRecoveryVmwareFcdMigrateNotFound struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMigrateNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate][%d] instantRecoveryVmwareFcdMigrateNotFound %+v", 404, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMigrateNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMigrateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMigrateInternalServerError creates a InstantRecoveryVmwareFcdMigrateInternalServerError with default headers values -func NewInstantRecoveryVmwareFcdMigrateInternalServerError() *InstantRecoveryVmwareFcdMigrateInternalServerError { - return &InstantRecoveryVmwareFcdMigrateInternalServerError{} -} - -/* InstantRecoveryVmwareFcdMigrateInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type InstantRecoveryVmwareFcdMigrateInternalServerError struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMigrateInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate][%d] instantRecoveryVmwareFcdMigrateInternalServerError %+v", 500, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMigrateInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMigrateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/restore/instant_recovery_vmware_fcd_mount_parameters.go b/client/restore/instant_recovery_vmware_fcd_mount_parameters.go deleted file mode 100644 index b4f763c..0000000 --- a/client/restore/instant_recovery_vmware_fcd_mount_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewInstantRecoveryVmwareFcdMountParams creates a new InstantRecoveryVmwareFcdMountParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInstantRecoveryVmwareFcdMountParams() *InstantRecoveryVmwareFcdMountParams { - return &InstantRecoveryVmwareFcdMountParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInstantRecoveryVmwareFcdMountParamsWithTimeout creates a new InstantRecoveryVmwareFcdMountParams object -// with the ability to set a timeout on a request. -func NewInstantRecoveryVmwareFcdMountParamsWithTimeout(timeout time.Duration) *InstantRecoveryVmwareFcdMountParams { - return &InstantRecoveryVmwareFcdMountParams{ - timeout: timeout, - } -} - -// NewInstantRecoveryVmwareFcdMountParamsWithContext creates a new InstantRecoveryVmwareFcdMountParams object -// with the ability to set a context for a request. -func NewInstantRecoveryVmwareFcdMountParamsWithContext(ctx context.Context) *InstantRecoveryVmwareFcdMountParams { - return &InstantRecoveryVmwareFcdMountParams{ - Context: ctx, - } -} - -// NewInstantRecoveryVmwareFcdMountParamsWithHTTPClient creates a new InstantRecoveryVmwareFcdMountParams object -// with the ability to set a custom HTTPClient for a request. -func NewInstantRecoveryVmwareFcdMountParamsWithHTTPClient(client *http.Client) *InstantRecoveryVmwareFcdMountParams { - return &InstantRecoveryVmwareFcdMountParams{ - HTTPClient: client, - } -} - -/* InstantRecoveryVmwareFcdMountParams contains all the parameters to send to the API endpoint - for the instant recovery vmware fcd mount operation. - - Typically these are written to a http.Request. -*/ -type InstantRecoveryVmwareFcdMountParams struct { - - // Body. - Body *models.VmwareFcdInstantRecoverySpec - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the instant recovery vmware fcd mount params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InstantRecoveryVmwareFcdMountParams) WithDefaults() *InstantRecoveryVmwareFcdMountParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the instant recovery vmware fcd mount params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InstantRecoveryVmwareFcdMountParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := InstantRecoveryVmwareFcdMountParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) WithTimeout(timeout time.Duration) *InstantRecoveryVmwareFcdMountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) WithContext(ctx context.Context) *InstantRecoveryVmwareFcdMountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) WithHTTPClient(client *http.Client) *InstantRecoveryVmwareFcdMountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) WithBody(body *models.VmwareFcdInstantRecoverySpec) *InstantRecoveryVmwareFcdMountParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) SetBody(body *models.VmwareFcdInstantRecoverySpec) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) WithXAPIVersion(xAPIVersion string) *InstantRecoveryVmwareFcdMountParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the instant recovery vmware fcd mount params -func (o *InstantRecoveryVmwareFcdMountParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *InstantRecoveryVmwareFcdMountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/restore/instant_recovery_vmware_fcd_mount_responses.go b/client/restore/instant_recovery_vmware_fcd_mount_responses.go deleted file mode 100644 index d61e45a..0000000 --- a/client/restore/instant_recovery_vmware_fcd_mount_responses.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// InstantRecoveryVmwareFcdMountReader is a Reader for the InstantRecoveryVmwareFcdMount structure. -type InstantRecoveryVmwareFcdMountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InstantRecoveryVmwareFcdMountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewInstantRecoveryVmwareFcdMountCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewInstantRecoveryVmwareFcdMountBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewInstantRecoveryVmwareFcdMountUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewInstantRecoveryVmwareFcdMountForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewInstantRecoveryVmwareFcdMountNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInstantRecoveryVmwareFcdMountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewInstantRecoveryVmwareFcdMountCreated creates a InstantRecoveryVmwareFcdMountCreated with default headers values -func NewInstantRecoveryVmwareFcdMountCreated() *InstantRecoveryVmwareFcdMountCreated { - return &InstantRecoveryVmwareFcdMountCreated{} -} - -/* InstantRecoveryVmwareFcdMountCreated describes a response with status code 201, with default header values. - -Instant FCD Recovery has been started. -*/ -type InstantRecoveryVmwareFcdMountCreated struct { - Payload *models.VmwareFcdInstantRecoveryMount -} - -func (o *InstantRecoveryVmwareFcdMountCreated) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/][%d] instantRecoveryVmwareFcdMountCreated %+v", 201, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMountCreated) GetPayload() *models.VmwareFcdInstantRecoveryMount { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMountCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.VmwareFcdInstantRecoveryMount) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMountBadRequest creates a InstantRecoveryVmwareFcdMountBadRequest with default headers values -func NewInstantRecoveryVmwareFcdMountBadRequest() *InstantRecoveryVmwareFcdMountBadRequest { - return &InstantRecoveryVmwareFcdMountBadRequest{} -} - -/* InstantRecoveryVmwareFcdMountBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type InstantRecoveryVmwareFcdMountBadRequest struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMountBadRequest) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/][%d] instantRecoveryVmwareFcdMountBadRequest %+v", 400, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMountBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMountBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMountUnauthorized creates a InstantRecoveryVmwareFcdMountUnauthorized with default headers values -func NewInstantRecoveryVmwareFcdMountUnauthorized() *InstantRecoveryVmwareFcdMountUnauthorized { - return &InstantRecoveryVmwareFcdMountUnauthorized{} -} - -/* InstantRecoveryVmwareFcdMountUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type InstantRecoveryVmwareFcdMountUnauthorized struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMountUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/][%d] instantRecoveryVmwareFcdMountUnauthorized %+v", 401, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMountUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMountForbidden creates a InstantRecoveryVmwareFcdMountForbidden with default headers values -func NewInstantRecoveryVmwareFcdMountForbidden() *InstantRecoveryVmwareFcdMountForbidden { - return &InstantRecoveryVmwareFcdMountForbidden{} -} - -/* InstantRecoveryVmwareFcdMountForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type InstantRecoveryVmwareFcdMountForbidden struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMountForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/][%d] instantRecoveryVmwareFcdMountForbidden %+v", 403, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMountForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMountNotFound creates a InstantRecoveryVmwareFcdMountNotFound with default headers values -func NewInstantRecoveryVmwareFcdMountNotFound() *InstantRecoveryVmwareFcdMountNotFound { - return &InstantRecoveryVmwareFcdMountNotFound{} -} - -/* InstantRecoveryVmwareFcdMountNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type InstantRecoveryVmwareFcdMountNotFound struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMountNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/][%d] instantRecoveryVmwareFcdMountNotFound %+v", 404, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMountNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstantRecoveryVmwareFcdMountInternalServerError creates a InstantRecoveryVmwareFcdMountInternalServerError with default headers values -func NewInstantRecoveryVmwareFcdMountInternalServerError() *InstantRecoveryVmwareFcdMountInternalServerError { - return &InstantRecoveryVmwareFcdMountInternalServerError{} -} - -/* InstantRecoveryVmwareFcdMountInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type InstantRecoveryVmwareFcdMountInternalServerError struct { - Payload *models.Error -} - -func (o *InstantRecoveryVmwareFcdMountInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/restore/instantRecovery/vmware/fcd/][%d] instantRecoveryVmwareFcdMountInternalServerError %+v", 500, o.Payload) -} -func (o *InstantRecoveryVmwareFcdMountInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *InstantRecoveryVmwareFcdMountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/restore/restore_client.go b/client/restore/restore_client.go deleted file mode 100644 index 4910fa8..0000000 --- a/client/restore/restore_client.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restore - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new restore API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for restore API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetVmwareFcdInstantRecoveryMountModel(params *GetVmwareFcdInstantRecoveryMountModelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVmwareFcdInstantRecoveryMountModelOK, error) - - InstantRecoveryVmwareFcdDismount(params *InstantRecoveryVmwareFcdDismountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InstantRecoveryVmwareFcdDismountOK, error) - - InstantRecoveryVmwareFcdMigrate(params *InstantRecoveryVmwareFcdMigrateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InstantRecoveryVmwareFcdMigrateOK, error) - - InstantRecoveryVmwareFcdMount(params *InstantRecoveryVmwareFcdMountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InstantRecoveryVmwareFcdMountCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetVmwareFcdInstantRecoveryMountModel gets mount information - - The HTTP GET request to the `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}` path allows you to get information about the mounted vPower NFS datastore, such as restore session ID, mount state, instant recovery settings and disks that will be recovered. -*/ -func (a *Client) GetVmwareFcdInstantRecoveryMountModel(params *GetVmwareFcdInstantRecoveryMountModelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVmwareFcdInstantRecoveryMountModelOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetVmwareFcdInstantRecoveryMountModelParams() - } - op := &runtime.ClientOperation{ - ID: "GetVmwareFcdInstantRecoveryMountModel", - Method: "GET", - PathPattern: "/api/v1/restore/instantRecovery/vmware/fcd/{mountId}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetVmwareFcdInstantRecoveryMountModelReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetVmwareFcdInstantRecoveryMountModelOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetVmwareFcdInstantRecoveryMountModel: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - InstantRecoveryVmwareFcdDismount stops f c d publishing - - The HTTP POST request to the `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount` path allows you to stop publishing the recovered FCDs and remove the disks from the datastore. -*/ -func (a *Client) InstantRecoveryVmwareFcdDismount(params *InstantRecoveryVmwareFcdDismountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InstantRecoveryVmwareFcdDismountOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInstantRecoveryVmwareFcdDismountParams() - } - op := &runtime.ClientOperation{ - ID: "InstantRecoveryVmwareFcdDismount", - Method: "POST", - PathPattern: "/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InstantRecoveryVmwareFcdDismountReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InstantRecoveryVmwareFcdDismountOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for InstantRecoveryVmwareFcdDismount: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - InstantRecoveryVmwareFcdMigrate starts f c d migration - - The HTTP POST request to the `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate` path allows you to start migration of FCDs from the specified mount. -*/ -func (a *Client) InstantRecoveryVmwareFcdMigrate(params *InstantRecoveryVmwareFcdMigrateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InstantRecoveryVmwareFcdMigrateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInstantRecoveryVmwareFcdMigrateParams() - } - op := &runtime.ClientOperation{ - ID: "InstantRecoveryVmwareFcdMigrate", - Method: "POST", - PathPattern: "/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InstantRecoveryVmwareFcdMigrateReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InstantRecoveryVmwareFcdMigrateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for InstantRecoveryVmwareFcdMigrate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - InstantRecoveryVmwareFcdMount starts instant f c d recovery - - The HTTP POST request to the `/api/v1/restore/instantRecovery/vmware/fcd/` path allows you to start Instant FCD Recovery from the specified restore point to the specified cluster. For details on how to get a cluster model, see [Get VMware vSphere Server Objects](#operation/GetVmwareHostObject). -*/ -func (a *Client) InstantRecoveryVmwareFcdMount(params *InstantRecoveryVmwareFcdMountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InstantRecoveryVmwareFcdMountCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInstantRecoveryVmwareFcdMountParams() - } - op := &runtime.ClientOperation{ - ID: "InstantRecoveryVmwareFcdMount", - Method: "POST", - PathPattern: "/api/v1/restore/instantRecovery/vmware/fcd/", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InstantRecoveryVmwareFcdMountReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*InstantRecoveryVmwareFcdMountCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for InstantRecoveryVmwareFcdMount: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/service/get_server_certificate_parameters.go b/client/service/get_server_certificate_parameters.go deleted file mode 100644 index e34d6f0..0000000 --- a/client/service/get_server_certificate_parameters.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetServerCertificateParams creates a new GetServerCertificateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetServerCertificateParams() *GetServerCertificateParams { - return &GetServerCertificateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetServerCertificateParamsWithTimeout creates a new GetServerCertificateParams object -// with the ability to set a timeout on a request. -func NewGetServerCertificateParamsWithTimeout(timeout time.Duration) *GetServerCertificateParams { - return &GetServerCertificateParams{ - timeout: timeout, - } -} - -// NewGetServerCertificateParamsWithContext creates a new GetServerCertificateParams object -// with the ability to set a context for a request. -func NewGetServerCertificateParamsWithContext(ctx context.Context) *GetServerCertificateParams { - return &GetServerCertificateParams{ - Context: ctx, - } -} - -// NewGetServerCertificateParamsWithHTTPClient creates a new GetServerCertificateParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetServerCertificateParamsWithHTTPClient(client *http.Client) *GetServerCertificateParams { - return &GetServerCertificateParams{ - HTTPClient: client, - } -} - -/* GetServerCertificateParams contains all the parameters to send to the API endpoint - for the get server certificate operation. - - Typically these are written to a http.Request. -*/ -type GetServerCertificateParams struct { - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get server certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetServerCertificateParams) WithDefaults() *GetServerCertificateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get server certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetServerCertificateParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetServerCertificateParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get server certificate params -func (o *GetServerCertificateParams) WithTimeout(timeout time.Duration) *GetServerCertificateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get server certificate params -func (o *GetServerCertificateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get server certificate params -func (o *GetServerCertificateParams) WithContext(ctx context.Context) *GetServerCertificateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get server certificate params -func (o *GetServerCertificateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get server certificate params -func (o *GetServerCertificateParams) WithHTTPClient(client *http.Client) *GetServerCertificateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get server certificate params -func (o *GetServerCertificateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXAPIVersion adds the xAPIVersion to the get server certificate params -func (o *GetServerCertificateParams) WithXAPIVersion(xAPIVersion string) *GetServerCertificateParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get server certificate params -func (o *GetServerCertificateParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetServerCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/service/get_server_certificate_responses.go b/client/service/get_server_certificate_responses.go deleted file mode 100644 index d6f3cd7..0000000 --- a/client/service/get_server_certificate_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetServerCertificateReader is a Reader for the GetServerCertificate structure. -type GetServerCertificateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetServerCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetServerCertificateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetServerCertificateUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetServerCertificateForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetServerCertificateInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetServerCertificateOK creates a GetServerCertificateOK with default headers values -func NewGetServerCertificateOK() *GetServerCertificateOK { - return &GetServerCertificateOK{} -} - -/* GetServerCertificateOK describes a response with status code 200, with default header values. - -OK -*/ -type GetServerCertificateOK struct { - Payload *models.CertificateModel -} - -func (o *GetServerCertificateOK) Error() string { - return fmt.Sprintf("[GET /api/v1/serverCertificate][%d] getServerCertificateOK %+v", 200, o.Payload) -} -func (o *GetServerCertificateOK) GetPayload() *models.CertificateModel { - return o.Payload -} - -func (o *GetServerCertificateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.CertificateModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetServerCertificateUnauthorized creates a GetServerCertificateUnauthorized with default headers values -func NewGetServerCertificateUnauthorized() *GetServerCertificateUnauthorized { - return &GetServerCertificateUnauthorized{} -} - -/* GetServerCertificateUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetServerCertificateUnauthorized struct { - Payload *models.Error -} - -func (o *GetServerCertificateUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/serverCertificate][%d] getServerCertificateUnauthorized %+v", 401, o.Payload) -} -func (o *GetServerCertificateUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetServerCertificateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetServerCertificateForbidden creates a GetServerCertificateForbidden with default headers values -func NewGetServerCertificateForbidden() *GetServerCertificateForbidden { - return &GetServerCertificateForbidden{} -} - -/* GetServerCertificateForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetServerCertificateForbidden struct { - Payload *models.Error -} - -func (o *GetServerCertificateForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/serverCertificate][%d] getServerCertificateForbidden %+v", 403, o.Payload) -} -func (o *GetServerCertificateForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetServerCertificateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetServerCertificateInternalServerError creates a GetServerCertificateInternalServerError with default headers values -func NewGetServerCertificateInternalServerError() *GetServerCertificateInternalServerError { - return &GetServerCertificateInternalServerError{} -} - -/* GetServerCertificateInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetServerCertificateInternalServerError struct { - Payload *models.Error -} - -func (o *GetServerCertificateInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/serverCertificate][%d] getServerCertificateInternalServerError %+v", 500, o.Payload) -} -func (o *GetServerCertificateInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetServerCertificateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/service/get_server_time_parameters.go b/client/service/get_server_time_parameters.go deleted file mode 100644 index b91ea1b..0000000 --- a/client/service/get_server_time_parameters.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetServerTimeParams creates a new GetServerTimeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetServerTimeParams() *GetServerTimeParams { - return &GetServerTimeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetServerTimeParamsWithTimeout creates a new GetServerTimeParams object -// with the ability to set a timeout on a request. -func NewGetServerTimeParamsWithTimeout(timeout time.Duration) *GetServerTimeParams { - return &GetServerTimeParams{ - timeout: timeout, - } -} - -// NewGetServerTimeParamsWithContext creates a new GetServerTimeParams object -// with the ability to set a context for a request. -func NewGetServerTimeParamsWithContext(ctx context.Context) *GetServerTimeParams { - return &GetServerTimeParams{ - Context: ctx, - } -} - -// NewGetServerTimeParamsWithHTTPClient creates a new GetServerTimeParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetServerTimeParamsWithHTTPClient(client *http.Client) *GetServerTimeParams { - return &GetServerTimeParams{ - HTTPClient: client, - } -} - -/* GetServerTimeParams contains all the parameters to send to the API endpoint - for the get server time operation. - - Typically these are written to a http.Request. -*/ -type GetServerTimeParams struct { - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get server time params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetServerTimeParams) WithDefaults() *GetServerTimeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get server time params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetServerTimeParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetServerTimeParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get server time params -func (o *GetServerTimeParams) WithTimeout(timeout time.Duration) *GetServerTimeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get server time params -func (o *GetServerTimeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get server time params -func (o *GetServerTimeParams) WithContext(ctx context.Context) *GetServerTimeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get server time params -func (o *GetServerTimeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get server time params -func (o *GetServerTimeParams) WithHTTPClient(client *http.Client) *GetServerTimeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get server time params -func (o *GetServerTimeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXAPIVersion adds the xAPIVersion to the get server time params -func (o *GetServerTimeParams) WithXAPIVersion(xAPIVersion string) *GetServerTimeParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get server time params -func (o *GetServerTimeParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetServerTimeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/service/get_server_time_responses.go b/client/service/get_server_time_responses.go deleted file mode 100644 index 24e48a4..0000000 --- a/client/service/get_server_time_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetServerTimeReader is a Reader for the GetServerTime structure. -type GetServerTimeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetServerTimeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetServerTimeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetServerTimeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetServerTimeForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetServerTimeInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetServerTimeOK creates a GetServerTimeOK with default headers values -func NewGetServerTimeOK() *GetServerTimeOK { - return &GetServerTimeOK{} -} - -/* GetServerTimeOK describes a response with status code 200, with default header values. - -OK -*/ -type GetServerTimeOK struct { - Payload *models.ServerTimeModel -} - -func (o *GetServerTimeOK) Error() string { - return fmt.Sprintf("[GET /api/v1/serverTime][%d] getServerTimeOK %+v", 200, o.Payload) -} -func (o *GetServerTimeOK) GetPayload() *models.ServerTimeModel { - return o.Payload -} - -func (o *GetServerTimeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServerTimeModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetServerTimeUnauthorized creates a GetServerTimeUnauthorized with default headers values -func NewGetServerTimeUnauthorized() *GetServerTimeUnauthorized { - return &GetServerTimeUnauthorized{} -} - -/* GetServerTimeUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetServerTimeUnauthorized struct { - Payload *models.Error -} - -func (o *GetServerTimeUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/serverTime][%d] getServerTimeUnauthorized %+v", 401, o.Payload) -} -func (o *GetServerTimeUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetServerTimeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetServerTimeForbidden creates a GetServerTimeForbidden with default headers values -func NewGetServerTimeForbidden() *GetServerTimeForbidden { - return &GetServerTimeForbidden{} -} - -/* GetServerTimeForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetServerTimeForbidden struct { - Payload *models.Error -} - -func (o *GetServerTimeForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/serverTime][%d] getServerTimeForbidden %+v", 403, o.Payload) -} -func (o *GetServerTimeForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetServerTimeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetServerTimeInternalServerError creates a GetServerTimeInternalServerError with default headers values -func NewGetServerTimeInternalServerError() *GetServerTimeInternalServerError { - return &GetServerTimeInternalServerError{} -} - -/* GetServerTimeInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetServerTimeInternalServerError struct { - Payload *models.Error -} - -func (o *GetServerTimeInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/serverTime][%d] getServerTimeInternalServerError %+v", 500, o.Payload) -} -func (o *GetServerTimeInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetServerTimeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/service/service_client.go b/client/service/service_client.go deleted file mode 100644 index 0fc5993..0000000 --- a/client/service/service_client.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetServerCertificate(params *GetServerCertificateParams, opts ...ClientOption) (*GetServerCertificateOK, error) - - GetServerTime(params *GetServerTimeParams, opts ...ClientOption) (*GetServerTimeOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetServerCertificate gets server certificate - - The HTTP GET request to the `/api/v1/serverCertificate` path allows you to get a certificate of the backup server. -*/ -func (a *Client) GetServerCertificate(params *GetServerCertificateParams, opts ...ClientOption) (*GetServerCertificateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetServerCertificateParams() - } - op := &runtime.ClientOperation{ - ID: "GetServerCertificate", - Method: "GET", - PathPattern: "/api/v1/serverCertificate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetServerCertificateReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetServerCertificateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetServerCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetServerTime gets server time - - The HTTP GET request to the `/api/v1/serverTime` path allows you to get current date and time on the backup server. -*/ -func (a *Client) GetServerTime(params *GetServerTimeParams, opts ...ClientOption) (*GetServerTimeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetServerTimeParams() - } - op := &runtime.ClientOperation{ - ID: "GetServerTime", - Method: "GET", - PathPattern: "/api/v1/serverTime", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetServerTimeReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetServerTimeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetServerTime: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/services/get_all_services_parameters.go b/client/services/get_all_services_parameters.go deleted file mode 100644 index 107b202..0000000 --- a/client/services/get_all_services_parameters.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllServicesParams creates a new GetAllServicesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllServicesParams() *GetAllServicesParams { - return &GetAllServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllServicesParamsWithTimeout creates a new GetAllServicesParams object -// with the ability to set a timeout on a request. -func NewGetAllServicesParamsWithTimeout(timeout time.Duration) *GetAllServicesParams { - return &GetAllServicesParams{ - timeout: timeout, - } -} - -// NewGetAllServicesParamsWithContext creates a new GetAllServicesParams object -// with the ability to set a context for a request. -func NewGetAllServicesParamsWithContext(ctx context.Context) *GetAllServicesParams { - return &GetAllServicesParams{ - Context: ctx, - } -} - -// NewGetAllServicesParamsWithHTTPClient creates a new GetAllServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllServicesParamsWithHTTPClient(client *http.Client) *GetAllServicesParams { - return &GetAllServicesParams{ - HTTPClient: client, - } -} - -/* GetAllServicesParams contains all the parameters to send to the API endpoint - for the get all services operation. - - Typically these are written to a http.Request. -*/ -type GetAllServicesParams struct { - - /* Limit. - - Maximum number of services to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters services by the `nameFilter` pattern. The pattern can match any service parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts services in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts services by one of the service parameters. - */ - OrderColumn *string - - /* Skip. - - Number of services to skip. - - Format: int32 - */ - Skip *int32 - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllServicesParams) WithDefaults() *GetAllServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllServicesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllServicesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all services params -func (o *GetAllServicesParams) WithTimeout(timeout time.Duration) *GetAllServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all services params -func (o *GetAllServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all services params -func (o *GetAllServicesParams) WithContext(ctx context.Context) *GetAllServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all services params -func (o *GetAllServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all services params -func (o *GetAllServicesParams) WithHTTPClient(client *http.Client) *GetAllServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all services params -func (o *GetAllServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the get all services params -func (o *GetAllServicesParams) WithLimit(limit *int32) *GetAllServicesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all services params -func (o *GetAllServicesParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all services params -func (o *GetAllServicesParams) WithNameFilter(nameFilter *string) *GetAllServicesParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all services params -func (o *GetAllServicesParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all services params -func (o *GetAllServicesParams) WithOrderAsc(orderAsc *bool) *GetAllServicesParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all services params -func (o *GetAllServicesParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all services params -func (o *GetAllServicesParams) WithOrderColumn(orderColumn *string) *GetAllServicesParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all services params -func (o *GetAllServicesParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithSkip adds the skip to the get all services params -func (o *GetAllServicesParams) WithSkip(skip *int32) *GetAllServicesParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all services params -func (o *GetAllServicesParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithXAPIVersion adds the xAPIVersion to the get all services params -func (o *GetAllServicesParams) WithXAPIVersion(xAPIVersion string) *GetAllServicesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all services params -func (o *GetAllServicesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/services/get_all_services_responses.go b/client/services/get_all_services_responses.go deleted file mode 100644 index 29d07e5..0000000 --- a/client/services/get_all_services_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllServicesReader is a Reader for the GetAllServices structure. -type GetAllServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllServicesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllServicesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllServicesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllServicesOK creates a GetAllServicesOK with default headers values -func NewGetAllServicesOK() *GetAllServicesOK { - return &GetAllServicesOK{} -} - -/* GetAllServicesOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllServicesOK struct { - Payload *models.ServicesResult -} - -func (o *GetAllServicesOK) Error() string { - return fmt.Sprintf("[GET /api/v1/services][%d] getAllServicesOK %+v", 200, o.Payload) -} -func (o *GetAllServicesOK) GetPayload() *models.ServicesResult { - return o.Payload -} - -func (o *GetAllServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ServicesResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllServicesUnauthorized creates a GetAllServicesUnauthorized with default headers values -func NewGetAllServicesUnauthorized() *GetAllServicesUnauthorized { - return &GetAllServicesUnauthorized{} -} - -/* GetAllServicesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllServicesUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllServicesUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/services][%d] getAllServicesUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllServicesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllServicesForbidden creates a GetAllServicesForbidden with default headers values -func NewGetAllServicesForbidden() *GetAllServicesForbidden { - return &GetAllServicesForbidden{} -} - -/* GetAllServicesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllServicesForbidden struct { - Payload *models.Error -} - -func (o *GetAllServicesForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/services][%d] getAllServicesForbidden %+v", 403, o.Payload) -} -func (o *GetAllServicesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllServicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllServicesInternalServerError creates a GetAllServicesInternalServerError with default headers values -func NewGetAllServicesInternalServerError() *GetAllServicesInternalServerError { - return &GetAllServicesInternalServerError{} -} - -/* GetAllServicesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllServicesInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllServicesInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/services][%d] getAllServicesInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllServicesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllServicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/services/services_client.go b/client/services/services_client.go deleted file mode 100644 index a398b72..0000000 --- a/client/services/services_client.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package services - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new services API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for services API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetAllServices(params *GetAllServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllServicesOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAllServices gets associated services - - The HTTP GET request to the `/api/v1/services` path allows you to get associated services for integration with Veeam Backup & Replication. -*/ -func (a *Client) GetAllServices(params *GetAllServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllServicesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllServicesParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllServices", - Method: "GET", - PathPattern: "/api/v1/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllServicesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllServicesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/sessions/get_all_sessions_parameters.go b/client/sessions/get_all_sessions_parameters.go deleted file mode 100644 index 239cf91..0000000 --- a/client/sessions/get_all_sessions_parameters.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetAllSessionsParams creates a new GetAllSessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllSessionsParams() *GetAllSessionsParams { - return &GetAllSessionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllSessionsParamsWithTimeout creates a new GetAllSessionsParams object -// with the ability to set a timeout on a request. -func NewGetAllSessionsParamsWithTimeout(timeout time.Duration) *GetAllSessionsParams { - return &GetAllSessionsParams{ - timeout: timeout, - } -} - -// NewGetAllSessionsParamsWithContext creates a new GetAllSessionsParams object -// with the ability to set a context for a request. -func NewGetAllSessionsParamsWithContext(ctx context.Context) *GetAllSessionsParams { - return &GetAllSessionsParams{ - Context: ctx, - } -} - -// NewGetAllSessionsParamsWithHTTPClient creates a new GetAllSessionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllSessionsParamsWithHTTPClient(client *http.Client) *GetAllSessionsParams { - return &GetAllSessionsParams{ - HTTPClient: client, - } -} - -/* GetAllSessionsParams contains all the parameters to send to the API endpoint - for the get all sessions operation. - - Typically these are written to a http.Request. -*/ -type GetAllSessionsParams struct { - - /* CreatedAfterFilter. - - Returns sessions that are created after the specified date and time. - - Format: date-time - */ - CreatedAfterFilter *strfmt.DateTime - - /* CreatedBeforeFilter. - - Returns sessions that are created before the specified date and time. - - Format: date-time - */ - CreatedBeforeFilter *strfmt.DateTime - - /* EndedAfterFilter. - - Returns sessions that are finished after the specified date and time. - - Format: date-time - */ - EndedAfterFilter *strfmt.DateTime - - /* EndedBeforeFilter. - - Returns sessions that are finished before the specified date and time. - - Format: date-time - */ - EndedBeforeFilter *strfmt.DateTime - - /* JobIDFilter. - - Filters sessions by job ID. - - Format: uuid - */ - JobIDFilter *strfmt.UUID - - /* Limit. - - Maximum number of sessions to return. - - Format: int32 - */ - Limit *int32 - - /* NameFilter. - - Filters sessions by the `nameFilter` pattern. The pattern can match any session parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - */ - NameFilter *string - - /* OrderAsc. - - Sorts sessions in the ascending order by the `orderColumn` parameter. - */ - OrderAsc *bool - - /* OrderColumn. - - Sorts sessions by one of the session parameters. - */ - OrderColumn *string - - /* ResultFilter. - - Filters sessions by session result. - */ - ResultFilter *string - - /* Skip. - - Number of sessions to skip. - - Format: int32 - */ - Skip *int32 - - /* StateFilter. - - Filters sessions by session state. - */ - StateFilter *string - - /* TypeFilter. - - Filters sessions by session type. - */ - TypeFilter *string - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllSessionsParams) WithDefaults() *GetAllSessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllSessionsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllSessionsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all sessions params -func (o *GetAllSessionsParams) WithTimeout(timeout time.Duration) *GetAllSessionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all sessions params -func (o *GetAllSessionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all sessions params -func (o *GetAllSessionsParams) WithContext(ctx context.Context) *GetAllSessionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all sessions params -func (o *GetAllSessionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all sessions params -func (o *GetAllSessionsParams) WithHTTPClient(client *http.Client) *GetAllSessionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all sessions params -func (o *GetAllSessionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCreatedAfterFilter adds the createdAfterFilter to the get all sessions params -func (o *GetAllSessionsParams) WithCreatedAfterFilter(createdAfterFilter *strfmt.DateTime) *GetAllSessionsParams { - o.SetCreatedAfterFilter(createdAfterFilter) - return o -} - -// SetCreatedAfterFilter adds the createdAfterFilter to the get all sessions params -func (o *GetAllSessionsParams) SetCreatedAfterFilter(createdAfterFilter *strfmt.DateTime) { - o.CreatedAfterFilter = createdAfterFilter -} - -// WithCreatedBeforeFilter adds the createdBeforeFilter to the get all sessions params -func (o *GetAllSessionsParams) WithCreatedBeforeFilter(createdBeforeFilter *strfmt.DateTime) *GetAllSessionsParams { - o.SetCreatedBeforeFilter(createdBeforeFilter) - return o -} - -// SetCreatedBeforeFilter adds the createdBeforeFilter to the get all sessions params -func (o *GetAllSessionsParams) SetCreatedBeforeFilter(createdBeforeFilter *strfmt.DateTime) { - o.CreatedBeforeFilter = createdBeforeFilter -} - -// WithEndedAfterFilter adds the endedAfterFilter to the get all sessions params -func (o *GetAllSessionsParams) WithEndedAfterFilter(endedAfterFilter *strfmt.DateTime) *GetAllSessionsParams { - o.SetEndedAfterFilter(endedAfterFilter) - return o -} - -// SetEndedAfterFilter adds the endedAfterFilter to the get all sessions params -func (o *GetAllSessionsParams) SetEndedAfterFilter(endedAfterFilter *strfmt.DateTime) { - o.EndedAfterFilter = endedAfterFilter -} - -// WithEndedBeforeFilter adds the endedBeforeFilter to the get all sessions params -func (o *GetAllSessionsParams) WithEndedBeforeFilter(endedBeforeFilter *strfmt.DateTime) *GetAllSessionsParams { - o.SetEndedBeforeFilter(endedBeforeFilter) - return o -} - -// SetEndedBeforeFilter adds the endedBeforeFilter to the get all sessions params -func (o *GetAllSessionsParams) SetEndedBeforeFilter(endedBeforeFilter *strfmt.DateTime) { - o.EndedBeforeFilter = endedBeforeFilter -} - -// WithJobIDFilter adds the jobIDFilter to the get all sessions params -func (o *GetAllSessionsParams) WithJobIDFilter(jobIDFilter *strfmt.UUID) *GetAllSessionsParams { - o.SetJobIDFilter(jobIDFilter) - return o -} - -// SetJobIDFilter adds the jobIdFilter to the get all sessions params -func (o *GetAllSessionsParams) SetJobIDFilter(jobIDFilter *strfmt.UUID) { - o.JobIDFilter = jobIDFilter -} - -// WithLimit adds the limit to the get all sessions params -func (o *GetAllSessionsParams) WithLimit(limit *int32) *GetAllSessionsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the get all sessions params -func (o *GetAllSessionsParams) SetLimit(limit *int32) { - o.Limit = limit -} - -// WithNameFilter adds the nameFilter to the get all sessions params -func (o *GetAllSessionsParams) WithNameFilter(nameFilter *string) *GetAllSessionsParams { - o.SetNameFilter(nameFilter) - return o -} - -// SetNameFilter adds the nameFilter to the get all sessions params -func (o *GetAllSessionsParams) SetNameFilter(nameFilter *string) { - o.NameFilter = nameFilter -} - -// WithOrderAsc adds the orderAsc to the get all sessions params -func (o *GetAllSessionsParams) WithOrderAsc(orderAsc *bool) *GetAllSessionsParams { - o.SetOrderAsc(orderAsc) - return o -} - -// SetOrderAsc adds the orderAsc to the get all sessions params -func (o *GetAllSessionsParams) SetOrderAsc(orderAsc *bool) { - o.OrderAsc = orderAsc -} - -// WithOrderColumn adds the orderColumn to the get all sessions params -func (o *GetAllSessionsParams) WithOrderColumn(orderColumn *string) *GetAllSessionsParams { - o.SetOrderColumn(orderColumn) - return o -} - -// SetOrderColumn adds the orderColumn to the get all sessions params -func (o *GetAllSessionsParams) SetOrderColumn(orderColumn *string) { - o.OrderColumn = orderColumn -} - -// WithResultFilter adds the resultFilter to the get all sessions params -func (o *GetAllSessionsParams) WithResultFilter(resultFilter *string) *GetAllSessionsParams { - o.SetResultFilter(resultFilter) - return o -} - -// SetResultFilter adds the resultFilter to the get all sessions params -func (o *GetAllSessionsParams) SetResultFilter(resultFilter *string) { - o.ResultFilter = resultFilter -} - -// WithSkip adds the skip to the get all sessions params -func (o *GetAllSessionsParams) WithSkip(skip *int32) *GetAllSessionsParams { - o.SetSkip(skip) - return o -} - -// SetSkip adds the skip to the get all sessions params -func (o *GetAllSessionsParams) SetSkip(skip *int32) { - o.Skip = skip -} - -// WithStateFilter adds the stateFilter to the get all sessions params -func (o *GetAllSessionsParams) WithStateFilter(stateFilter *string) *GetAllSessionsParams { - o.SetStateFilter(stateFilter) - return o -} - -// SetStateFilter adds the stateFilter to the get all sessions params -func (o *GetAllSessionsParams) SetStateFilter(stateFilter *string) { - o.StateFilter = stateFilter -} - -// WithTypeFilter adds the typeFilter to the get all sessions params -func (o *GetAllSessionsParams) WithTypeFilter(typeFilter *string) *GetAllSessionsParams { - o.SetTypeFilter(typeFilter) - return o -} - -// SetTypeFilter adds the typeFilter to the get all sessions params -func (o *GetAllSessionsParams) SetTypeFilter(typeFilter *string) { - o.TypeFilter = typeFilter -} - -// WithXAPIVersion adds the xAPIVersion to the get all sessions params -func (o *GetAllSessionsParams) WithXAPIVersion(xAPIVersion string) *GetAllSessionsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all sessions params -func (o *GetAllSessionsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.CreatedAfterFilter != nil { - - // query param createdAfterFilter - var qrCreatedAfterFilter strfmt.DateTime - - if o.CreatedAfterFilter != nil { - qrCreatedAfterFilter = *o.CreatedAfterFilter - } - qCreatedAfterFilter := qrCreatedAfterFilter.String() - if qCreatedAfterFilter != "" { - - if err := r.SetQueryParam("createdAfterFilter", qCreatedAfterFilter); err != nil { - return err - } - } - } - - if o.CreatedBeforeFilter != nil { - - // query param createdBeforeFilter - var qrCreatedBeforeFilter strfmt.DateTime - - if o.CreatedBeforeFilter != nil { - qrCreatedBeforeFilter = *o.CreatedBeforeFilter - } - qCreatedBeforeFilter := qrCreatedBeforeFilter.String() - if qCreatedBeforeFilter != "" { - - if err := r.SetQueryParam("createdBeforeFilter", qCreatedBeforeFilter); err != nil { - return err - } - } - } - - if o.EndedAfterFilter != nil { - - // query param endedAfterFilter - var qrEndedAfterFilter strfmt.DateTime - - if o.EndedAfterFilter != nil { - qrEndedAfterFilter = *o.EndedAfterFilter - } - qEndedAfterFilter := qrEndedAfterFilter.String() - if qEndedAfterFilter != "" { - - if err := r.SetQueryParam("endedAfterFilter", qEndedAfterFilter); err != nil { - return err - } - } - } - - if o.EndedBeforeFilter != nil { - - // query param endedBeforeFilter - var qrEndedBeforeFilter strfmt.DateTime - - if o.EndedBeforeFilter != nil { - qrEndedBeforeFilter = *o.EndedBeforeFilter - } - qEndedBeforeFilter := qrEndedBeforeFilter.String() - if qEndedBeforeFilter != "" { - - if err := r.SetQueryParam("endedBeforeFilter", qEndedBeforeFilter); err != nil { - return err - } - } - } - - if o.JobIDFilter != nil { - - // query param jobIdFilter - var qrJobIDFilter strfmt.UUID - - if o.JobIDFilter != nil { - qrJobIDFilter = *o.JobIDFilter - } - qJobIDFilter := qrJobIDFilter.String() - if qJobIDFilter != "" { - - if err := r.SetQueryParam("jobIdFilter", qJobIDFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int32 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt32(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.NameFilter != nil { - - // query param nameFilter - var qrNameFilter string - - if o.NameFilter != nil { - qrNameFilter = *o.NameFilter - } - qNameFilter := qrNameFilter - if qNameFilter != "" { - - if err := r.SetQueryParam("nameFilter", qNameFilter); err != nil { - return err - } - } - } - - if o.OrderAsc != nil { - - // query param orderAsc - var qrOrderAsc bool - - if o.OrderAsc != nil { - qrOrderAsc = *o.OrderAsc - } - qOrderAsc := swag.FormatBool(qrOrderAsc) - if qOrderAsc != "" { - - if err := r.SetQueryParam("orderAsc", qOrderAsc); err != nil { - return err - } - } - } - - if o.OrderColumn != nil { - - // query param orderColumn - var qrOrderColumn string - - if o.OrderColumn != nil { - qrOrderColumn = *o.OrderColumn - } - qOrderColumn := qrOrderColumn - if qOrderColumn != "" { - - if err := r.SetQueryParam("orderColumn", qOrderColumn); err != nil { - return err - } - } - } - - if o.ResultFilter != nil { - - // query param resultFilter - var qrResultFilter string - - if o.ResultFilter != nil { - qrResultFilter = *o.ResultFilter - } - qResultFilter := qrResultFilter - if qResultFilter != "" { - - if err := r.SetQueryParam("resultFilter", qResultFilter); err != nil { - return err - } - } - } - - if o.Skip != nil { - - // query param skip - var qrSkip int32 - - if o.Skip != nil { - qrSkip = *o.Skip - } - qSkip := swag.FormatInt32(qrSkip) - if qSkip != "" { - - if err := r.SetQueryParam("skip", qSkip); err != nil { - return err - } - } - } - - if o.StateFilter != nil { - - // query param stateFilter - var qrStateFilter string - - if o.StateFilter != nil { - qrStateFilter = *o.StateFilter - } - qStateFilter := qrStateFilter - if qStateFilter != "" { - - if err := r.SetQueryParam("stateFilter", qStateFilter); err != nil { - return err - } - } - } - - if o.TypeFilter != nil { - - // query param typeFilter - var qrTypeFilter string - - if o.TypeFilter != nil { - qrTypeFilter = *o.TypeFilter - } - qTypeFilter := qrTypeFilter - if qTypeFilter != "" { - - if err := r.SetQueryParam("typeFilter", qTypeFilter); err != nil { - return err - } - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/sessions/get_all_sessions_responses.go b/client/sessions/get_all_sessions_responses.go deleted file mode 100644 index e03dd88..0000000 --- a/client/sessions/get_all_sessions_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllSessionsReader is a Reader for the GetAllSessions structure. -type GetAllSessionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllSessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllSessionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllSessionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllSessionsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllSessionsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllSessionsOK creates a GetAllSessionsOK with default headers values -func NewGetAllSessionsOK() *GetAllSessionsOK { - return &GetAllSessionsOK{} -} - -/* GetAllSessionsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllSessionsOK struct { - Payload *models.SessionsResult -} - -func (o *GetAllSessionsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions][%d] getAllSessionsOK %+v", 200, o.Payload) -} -func (o *GetAllSessionsOK) GetPayload() *models.SessionsResult { - return o.Payload -} - -func (o *GetAllSessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionsResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllSessionsUnauthorized creates a GetAllSessionsUnauthorized with default headers values -func NewGetAllSessionsUnauthorized() *GetAllSessionsUnauthorized { - return &GetAllSessionsUnauthorized{} -} - -/* GetAllSessionsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllSessionsUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllSessionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions][%d] getAllSessionsUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllSessionsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllSessionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllSessionsForbidden creates a GetAllSessionsForbidden with default headers values -func NewGetAllSessionsForbidden() *GetAllSessionsForbidden { - return &GetAllSessionsForbidden{} -} - -/* GetAllSessionsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllSessionsForbidden struct { - Payload *models.Error -} - -func (o *GetAllSessionsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions][%d] getAllSessionsForbidden %+v", 403, o.Payload) -} -func (o *GetAllSessionsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllSessionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllSessionsInternalServerError creates a GetAllSessionsInternalServerError with default headers values -func NewGetAllSessionsInternalServerError() *GetAllSessionsInternalServerError { - return &GetAllSessionsInternalServerError{} -} - -/* GetAllSessionsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllSessionsInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllSessionsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions][%d] getAllSessionsInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllSessionsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllSessionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/sessions/get_session_logs_parameters.go b/client/sessions/get_session_logs_parameters.go deleted file mode 100644 index b9eda07..0000000 --- a/client/sessions/get_session_logs_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetSessionLogsParams creates a new GetSessionLogsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetSessionLogsParams() *GetSessionLogsParams { - return &GetSessionLogsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetSessionLogsParamsWithTimeout creates a new GetSessionLogsParams object -// with the ability to set a timeout on a request. -func NewGetSessionLogsParamsWithTimeout(timeout time.Duration) *GetSessionLogsParams { - return &GetSessionLogsParams{ - timeout: timeout, - } -} - -// NewGetSessionLogsParamsWithContext creates a new GetSessionLogsParams object -// with the ability to set a context for a request. -func NewGetSessionLogsParamsWithContext(ctx context.Context) *GetSessionLogsParams { - return &GetSessionLogsParams{ - Context: ctx, - } -} - -// NewGetSessionLogsParamsWithHTTPClient creates a new GetSessionLogsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetSessionLogsParamsWithHTTPClient(client *http.Client) *GetSessionLogsParams { - return &GetSessionLogsParams{ - HTTPClient: client, - } -} - -/* GetSessionLogsParams contains all the parameters to send to the API endpoint - for the get session logs operation. - - Typically these are written to a http.Request. -*/ -type GetSessionLogsParams struct { - - /* ID. - - ID of the session. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get session logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSessionLogsParams) WithDefaults() *GetSessionLogsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get session logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSessionLogsParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetSessionLogsParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get session logs params -func (o *GetSessionLogsParams) WithTimeout(timeout time.Duration) *GetSessionLogsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get session logs params -func (o *GetSessionLogsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get session logs params -func (o *GetSessionLogsParams) WithContext(ctx context.Context) *GetSessionLogsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get session logs params -func (o *GetSessionLogsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get session logs params -func (o *GetSessionLogsParams) WithHTTPClient(client *http.Client) *GetSessionLogsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get session logs params -func (o *GetSessionLogsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get session logs params -func (o *GetSessionLogsParams) WithID(id strfmt.UUID) *GetSessionLogsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get session logs params -func (o *GetSessionLogsParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get session logs params -func (o *GetSessionLogsParams) WithXAPIVersion(xAPIVersion string) *GetSessionLogsParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get session logs params -func (o *GetSessionLogsParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetSessionLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/sessions/get_session_logs_responses.go b/client/sessions/get_session_logs_responses.go deleted file mode 100644 index fea7cf9..0000000 --- a/client/sessions/get_session_logs_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetSessionLogsReader is a Reader for the GetSessionLogs structure. -type GetSessionLogsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetSessionLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetSessionLogsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetSessionLogsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetSessionLogsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetSessionLogsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetSessionLogsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetSessionLogsOK creates a GetSessionLogsOK with default headers values -func NewGetSessionLogsOK() *GetSessionLogsOK { - return &GetSessionLogsOK{} -} - -/* GetSessionLogsOK describes a response with status code 200, with default header values. - -OK -*/ -type GetSessionLogsOK struct { - Payload *models.SessionLogResult -} - -func (o *GetSessionLogsOK) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}/logs][%d] getSessionLogsOK %+v", 200, o.Payload) -} -func (o *GetSessionLogsOK) GetPayload() *models.SessionLogResult { - return o.Payload -} - -func (o *GetSessionLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionLogResult) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetSessionLogsUnauthorized creates a GetSessionLogsUnauthorized with default headers values -func NewGetSessionLogsUnauthorized() *GetSessionLogsUnauthorized { - return &GetSessionLogsUnauthorized{} -} - -/* GetSessionLogsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetSessionLogsUnauthorized struct { - Payload *models.Error -} - -func (o *GetSessionLogsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}/logs][%d] getSessionLogsUnauthorized %+v", 401, o.Payload) -} -func (o *GetSessionLogsUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetSessionLogsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetSessionLogsForbidden creates a GetSessionLogsForbidden with default headers values -func NewGetSessionLogsForbidden() *GetSessionLogsForbidden { - return &GetSessionLogsForbidden{} -} - -/* GetSessionLogsForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetSessionLogsForbidden struct { - Payload *models.Error -} - -func (o *GetSessionLogsForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}/logs][%d] getSessionLogsForbidden %+v", 403, o.Payload) -} -func (o *GetSessionLogsForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetSessionLogsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetSessionLogsNotFound creates a GetSessionLogsNotFound with default headers values -func NewGetSessionLogsNotFound() *GetSessionLogsNotFound { - return &GetSessionLogsNotFound{} -} - -/* GetSessionLogsNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetSessionLogsNotFound struct { - Payload *models.Error -} - -func (o *GetSessionLogsNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}/logs][%d] getSessionLogsNotFound %+v", 404, o.Payload) -} -func (o *GetSessionLogsNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetSessionLogsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetSessionLogsInternalServerError creates a GetSessionLogsInternalServerError with default headers values -func NewGetSessionLogsInternalServerError() *GetSessionLogsInternalServerError { - return &GetSessionLogsInternalServerError{} -} - -/* GetSessionLogsInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetSessionLogsInternalServerError struct { - Payload *models.Error -} - -func (o *GetSessionLogsInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}/logs][%d] getSessionLogsInternalServerError %+v", 500, o.Payload) -} -func (o *GetSessionLogsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetSessionLogsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/sessions/get_session_parameters.go b/client/sessions/get_session_parameters.go deleted file mode 100644 index 7a02d04..0000000 --- a/client/sessions/get_session_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetSessionParams creates a new GetSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetSessionParams() *GetSessionParams { - return &GetSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetSessionParamsWithTimeout creates a new GetSessionParams object -// with the ability to set a timeout on a request. -func NewGetSessionParamsWithTimeout(timeout time.Duration) *GetSessionParams { - return &GetSessionParams{ - timeout: timeout, - } -} - -// NewGetSessionParamsWithContext creates a new GetSessionParams object -// with the ability to set a context for a request. -func NewGetSessionParamsWithContext(ctx context.Context) *GetSessionParams { - return &GetSessionParams{ - Context: ctx, - } -} - -// NewGetSessionParamsWithHTTPClient creates a new GetSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetSessionParamsWithHTTPClient(client *http.Client) *GetSessionParams { - return &GetSessionParams{ - HTTPClient: client, - } -} - -/* GetSessionParams contains all the parameters to send to the API endpoint - for the get session operation. - - Typically these are written to a http.Request. -*/ -type GetSessionParams struct { - - /* ID. - - ID of the session. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSessionParams) WithDefaults() *GetSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSessionParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetSessionParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get session params -func (o *GetSessionParams) WithTimeout(timeout time.Duration) *GetSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get session params -func (o *GetSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get session params -func (o *GetSessionParams) WithContext(ctx context.Context) *GetSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get session params -func (o *GetSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get session params -func (o *GetSessionParams) WithHTTPClient(client *http.Client) *GetSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get session params -func (o *GetSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get session params -func (o *GetSessionParams) WithID(id strfmt.UUID) *GetSessionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get session params -func (o *GetSessionParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the get session params -func (o *GetSessionParams) WithXAPIVersion(xAPIVersion string) *GetSessionParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get session params -func (o *GetSessionParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/sessions/get_session_responses.go b/client/sessions/get_session_responses.go deleted file mode 100644 index 1548fa8..0000000 --- a/client/sessions/get_session_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetSessionReader is a Reader for the GetSession structure. -type GetSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetSessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetSessionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetSessionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetSessionInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetSessionOK creates a GetSessionOK with default headers values -func NewGetSessionOK() *GetSessionOK { - return &GetSessionOK{} -} - -/* GetSessionOK describes a response with status code 200, with default header values. - -OK -*/ -type GetSessionOK struct { - Payload *models.SessionModel -} - -func (o *GetSessionOK) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}][%d] getSessionOK %+v", 200, o.Payload) -} -func (o *GetSessionOK) GetPayload() *models.SessionModel { - return o.Payload -} - -func (o *GetSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SessionModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetSessionUnauthorized creates a GetSessionUnauthorized with default headers values -func NewGetSessionUnauthorized() *GetSessionUnauthorized { - return &GetSessionUnauthorized{} -} - -/* GetSessionUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetSessionUnauthorized struct { - Payload *models.Error -} - -func (o *GetSessionUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}][%d] getSessionUnauthorized %+v", 401, o.Payload) -} -func (o *GetSessionUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetSessionForbidden creates a GetSessionForbidden with default headers values -func NewGetSessionForbidden() *GetSessionForbidden { - return &GetSessionForbidden{} -} - -/* GetSessionForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetSessionForbidden struct { - Payload *models.Error -} - -func (o *GetSessionForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}][%d] getSessionForbidden %+v", 403, o.Payload) -} -func (o *GetSessionForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetSessionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetSessionNotFound creates a GetSessionNotFound with default headers values -func NewGetSessionNotFound() *GetSessionNotFound { - return &GetSessionNotFound{} -} - -/* GetSessionNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type GetSessionNotFound struct { - Payload *models.Error -} - -func (o *GetSessionNotFound) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}][%d] getSessionNotFound %+v", 404, o.Payload) -} -func (o *GetSessionNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetSessionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetSessionInternalServerError creates a GetSessionInternalServerError with default headers values -func NewGetSessionInternalServerError() *GetSessionInternalServerError { - return &GetSessionInternalServerError{} -} - -/* GetSessionInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetSessionInternalServerError struct { - Payload *models.Error -} - -func (o *GetSessionInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/sessions/{id}][%d] getSessionInternalServerError %+v", 500, o.Payload) -} -func (o *GetSessionInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetSessionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/sessions/sessions_client.go b/client/sessions/sessions_client.go deleted file mode 100644 index d4a969d..0000000 --- a/client/sessions/sessions_client.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new sessions API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for sessions API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetAllSessions(params *GetAllSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllSessionsOK, error) - - GetSession(params *GetSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSessionOK, error) - - GetSessionLogs(params *GetSessionLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSessionLogsOK, error) - - StopSession(params *StopSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopSessionOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAllSessions gets all sessions - - The HTTP GET request to the `/api/v1/sessions` path allows you to get an array of sessions performed on the backup server. -*/ -func (a *Client) GetAllSessions(params *GetAllSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllSessionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllSessionsParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllSessions", - Method: "GET", - PathPattern: "/api/v1/sessions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllSessionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllSessionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllSessions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetSession gets session - - The HTTP GET request to the `/api/v1/sessions/{id}` path allows you to get a session that has the specified `id`. -*/ -func (a *Client) GetSession(params *GetSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSessionParams() - } - op := &runtime.ClientOperation{ - ID: "GetSession", - Method: "GET", - PathPattern: "/api/v1/sessions/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetSessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetSessionLogs gets session logs - - The HTTP GET request to the `/api/v1/sessions/{id}/logs` path allows you to get an array of log records of a session that has the specified `id`. -*/ -func (a *Client) GetSessionLogs(params *GetSessionLogsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSessionLogsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSessionLogsParams() - } - op := &runtime.ClientOperation{ - ID: "GetSessionLogs", - Method: "GET", - PathPattern: "/api/v1/sessions/{id}/logs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetSessionLogsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetSessionLogsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetSessionLogs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - StopSession stops session - - The HTTP POST request to the `/api/v1/sessions/{id}/stop` path allows you to stop a session that has the specified `id`. -*/ -func (a *Client) StopSession(params *StopSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*StopSessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewStopSessionParams() - } - op := &runtime.ClientOperation{ - ID: "StopSession", - Method: "POST", - PathPattern: "/api/v1/sessions/{id}/stop", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &StopSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*StopSessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for StopSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/sessions/stop_session_parameters.go b/client/sessions/stop_session_parameters.go deleted file mode 100644 index e659be9..0000000 --- a/client/sessions/stop_session_parameters.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewStopSessionParams creates a new StopSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewStopSessionParams() *StopSessionParams { - return &StopSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewStopSessionParamsWithTimeout creates a new StopSessionParams object -// with the ability to set a timeout on a request. -func NewStopSessionParamsWithTimeout(timeout time.Duration) *StopSessionParams { - return &StopSessionParams{ - timeout: timeout, - } -} - -// NewStopSessionParamsWithContext creates a new StopSessionParams object -// with the ability to set a context for a request. -func NewStopSessionParamsWithContext(ctx context.Context) *StopSessionParams { - return &StopSessionParams{ - Context: ctx, - } -} - -// NewStopSessionParamsWithHTTPClient creates a new StopSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewStopSessionParamsWithHTTPClient(client *http.Client) *StopSessionParams { - return &StopSessionParams{ - HTTPClient: client, - } -} - -/* StopSessionParams contains all the parameters to send to the API endpoint - for the stop session operation. - - Typically these are written to a http.Request. -*/ -type StopSessionParams struct { - - /* ID. - - ID of the session. - - Format: uuid - */ - ID strfmt.UUID - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the stop session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StopSessionParams) WithDefaults() *StopSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the stop session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *StopSessionParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := StopSessionParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the stop session params -func (o *StopSessionParams) WithTimeout(timeout time.Duration) *StopSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the stop session params -func (o *StopSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the stop session params -func (o *StopSessionParams) WithContext(ctx context.Context) *StopSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the stop session params -func (o *StopSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the stop session params -func (o *StopSessionParams) WithHTTPClient(client *http.Client) *StopSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the stop session params -func (o *StopSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the stop session params -func (o *StopSessionParams) WithID(id strfmt.UUID) *StopSessionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the stop session params -func (o *StopSessionParams) SetID(id strfmt.UUID) { - o.ID = id -} - -// WithXAPIVersion adds the xAPIVersion to the stop session params -func (o *StopSessionParams) WithXAPIVersion(xAPIVersion string) *StopSessionParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the stop session params -func (o *StopSessionParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *StopSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID.String()); err != nil { - return err - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/sessions/stop_session_responses.go b/client/sessions/stop_session_responses.go deleted file mode 100644 index 6debae2..0000000 --- a/client/sessions/stop_session_responses.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package sessions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// StopSessionReader is a Reader for the StopSession structure. -type StopSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StopSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewStopSessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewStopSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewStopSessionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewStopSessionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewStopSessionInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewStopSessionOK creates a StopSessionOK with default headers values -func NewStopSessionOK() *StopSessionOK { - return &StopSessionOK{} -} - -/* StopSessionOK describes a response with status code 200, with default header values. - -OK -*/ -type StopSessionOK struct { - Payload models.EmptySuccessResponse -} - -func (o *StopSessionOK) Error() string { - return fmt.Sprintf("[POST /api/v1/sessions/{id}/stop][%d] stopSessionOK %+v", 200, o.Payload) -} -func (o *StopSessionOK) GetPayload() models.EmptySuccessResponse { - return o.Payload -} - -func (o *StopSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopSessionUnauthorized creates a StopSessionUnauthorized with default headers values -func NewStopSessionUnauthorized() *StopSessionUnauthorized { - return &StopSessionUnauthorized{} -} - -/* StopSessionUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type StopSessionUnauthorized struct { - Payload *models.Error -} - -func (o *StopSessionUnauthorized) Error() string { - return fmt.Sprintf("[POST /api/v1/sessions/{id}/stop][%d] stopSessionUnauthorized %+v", 401, o.Payload) -} -func (o *StopSessionUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopSessionForbidden creates a StopSessionForbidden with default headers values -func NewStopSessionForbidden() *StopSessionForbidden { - return &StopSessionForbidden{} -} - -/* StopSessionForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type StopSessionForbidden struct { - Payload *models.Error -} - -func (o *StopSessionForbidden) Error() string { - return fmt.Sprintf("[POST /api/v1/sessions/{id}/stop][%d] stopSessionForbidden %+v", 403, o.Payload) -} -func (o *StopSessionForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopSessionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopSessionNotFound creates a StopSessionNotFound with default headers values -func NewStopSessionNotFound() *StopSessionNotFound { - return &StopSessionNotFound{} -} - -/* StopSessionNotFound describes a response with status code 404, with default header values. - -Not found. No object was found with the path parameter specified in the request. -*/ -type StopSessionNotFound struct { - Payload *models.Error -} - -func (o *StopSessionNotFound) Error() string { - return fmt.Sprintf("[POST /api/v1/sessions/{id}/stop][%d] stopSessionNotFound %+v", 404, o.Payload) -} -func (o *StopSessionNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopSessionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStopSessionInternalServerError creates a StopSessionInternalServerError with default headers values -func NewStopSessionInternalServerError() *StopSessionInternalServerError { - return &StopSessionInternalServerError{} -} - -/* StopSessionInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type StopSessionInternalServerError struct { - Payload *models.Error -} - -func (o *StopSessionInternalServerError) Error() string { - return fmt.Sprintf("[POST /api/v1/sessions/{id}/stop][%d] stopSessionInternalServerError %+v", 500, o.Payload) -} -func (o *StopSessionInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *StopSessionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/traffic_rules/get_all_traffic_rules_parameters.go b/client/traffic_rules/get_all_traffic_rules_parameters.go deleted file mode 100644 index bf9a936..0000000 --- a/client/traffic_rules/get_all_traffic_rules_parameters.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package traffic_rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetAllTrafficRulesParams creates a new GetAllTrafficRulesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetAllTrafficRulesParams() *GetAllTrafficRulesParams { - return &GetAllTrafficRulesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetAllTrafficRulesParamsWithTimeout creates a new GetAllTrafficRulesParams object -// with the ability to set a timeout on a request. -func NewGetAllTrafficRulesParamsWithTimeout(timeout time.Duration) *GetAllTrafficRulesParams { - return &GetAllTrafficRulesParams{ - timeout: timeout, - } -} - -// NewGetAllTrafficRulesParamsWithContext creates a new GetAllTrafficRulesParams object -// with the ability to set a context for a request. -func NewGetAllTrafficRulesParamsWithContext(ctx context.Context) *GetAllTrafficRulesParams { - return &GetAllTrafficRulesParams{ - Context: ctx, - } -} - -// NewGetAllTrafficRulesParamsWithHTTPClient creates a new GetAllTrafficRulesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetAllTrafficRulesParamsWithHTTPClient(client *http.Client) *GetAllTrafficRulesParams { - return &GetAllTrafficRulesParams{ - HTTPClient: client, - } -} - -/* GetAllTrafficRulesParams contains all the parameters to send to the API endpoint - for the get all traffic rules operation. - - Typically these are written to a http.Request. -*/ -type GetAllTrafficRulesParams struct { - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get all traffic rules params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllTrafficRulesParams) WithDefaults() *GetAllTrafficRulesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get all traffic rules params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetAllTrafficRulesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := GetAllTrafficRulesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get all traffic rules params -func (o *GetAllTrafficRulesParams) WithTimeout(timeout time.Duration) *GetAllTrafficRulesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get all traffic rules params -func (o *GetAllTrafficRulesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get all traffic rules params -func (o *GetAllTrafficRulesParams) WithContext(ctx context.Context) *GetAllTrafficRulesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get all traffic rules params -func (o *GetAllTrafficRulesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get all traffic rules params -func (o *GetAllTrafficRulesParams) WithHTTPClient(client *http.Client) *GetAllTrafficRulesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get all traffic rules params -func (o *GetAllTrafficRulesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXAPIVersion adds the xAPIVersion to the get all traffic rules params -func (o *GetAllTrafficRulesParams) WithXAPIVersion(xAPIVersion string) *GetAllTrafficRulesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the get all traffic rules params -func (o *GetAllTrafficRulesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAllTrafficRulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/traffic_rules/get_all_traffic_rules_responses.go b/client/traffic_rules/get_all_traffic_rules_responses.go deleted file mode 100644 index ad29d56..0000000 --- a/client/traffic_rules/get_all_traffic_rules_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package traffic_rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// GetAllTrafficRulesReader is a Reader for the GetAllTrafficRules structure. -type GetAllTrafficRulesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAllTrafficRulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAllTrafficRulesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetAllTrafficRulesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetAllTrafficRulesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAllTrafficRulesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetAllTrafficRulesOK creates a GetAllTrafficRulesOK with default headers values -func NewGetAllTrafficRulesOK() *GetAllTrafficRulesOK { - return &GetAllTrafficRulesOK{} -} - -/* GetAllTrafficRulesOK describes a response with status code 200, with default header values. - -OK -*/ -type GetAllTrafficRulesOK struct { - Payload *models.GlobalNetworkTrafficRulesModel -} - -func (o *GetAllTrafficRulesOK) Error() string { - return fmt.Sprintf("[GET /api/v1/trafficRules][%d] getAllTrafficRulesOK %+v", 200, o.Payload) -} -func (o *GetAllTrafficRulesOK) GetPayload() *models.GlobalNetworkTrafficRulesModel { - return o.Payload -} - -func (o *GetAllTrafficRulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GlobalNetworkTrafficRulesModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllTrafficRulesUnauthorized creates a GetAllTrafficRulesUnauthorized with default headers values -func NewGetAllTrafficRulesUnauthorized() *GetAllTrafficRulesUnauthorized { - return &GetAllTrafficRulesUnauthorized{} -} - -/* GetAllTrafficRulesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type GetAllTrafficRulesUnauthorized struct { - Payload *models.Error -} - -func (o *GetAllTrafficRulesUnauthorized) Error() string { - return fmt.Sprintf("[GET /api/v1/trafficRules][%d] getAllTrafficRulesUnauthorized %+v", 401, o.Payload) -} -func (o *GetAllTrafficRulesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllTrafficRulesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllTrafficRulesForbidden creates a GetAllTrafficRulesForbidden with default headers values -func NewGetAllTrafficRulesForbidden() *GetAllTrafficRulesForbidden { - return &GetAllTrafficRulesForbidden{} -} - -/* GetAllTrafficRulesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type GetAllTrafficRulesForbidden struct { - Payload *models.Error -} - -func (o *GetAllTrafficRulesForbidden) Error() string { - return fmt.Sprintf("[GET /api/v1/trafficRules][%d] getAllTrafficRulesForbidden %+v", 403, o.Payload) -} -func (o *GetAllTrafficRulesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllTrafficRulesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAllTrafficRulesInternalServerError creates a GetAllTrafficRulesInternalServerError with default headers values -func NewGetAllTrafficRulesInternalServerError() *GetAllTrafficRulesInternalServerError { - return &GetAllTrafficRulesInternalServerError{} -} - -/* GetAllTrafficRulesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type GetAllTrafficRulesInternalServerError struct { - Payload *models.Error -} - -func (o *GetAllTrafficRulesInternalServerError) Error() string { - return fmt.Sprintf("[GET /api/v1/trafficRules][%d] getAllTrafficRulesInternalServerError %+v", 500, o.Payload) -} -func (o *GetAllTrafficRulesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetAllTrafficRulesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/traffic_rules/traffic_rules_client.go b/client/traffic_rules/traffic_rules_client.go deleted file mode 100644 index a703325..0000000 --- a/client/traffic_rules/traffic_rules_client.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package traffic_rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new traffic rules API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for traffic rules API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetAllTrafficRules(params *GetAllTrafficRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllTrafficRulesOK, error) - - UpdateTrafficRules(params *UpdateTrafficRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTrafficRulesCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAllTrafficRules gets traffic rules - - The HTTP GET request to the `/api/v1/trafficRules` path allows you to get network traffic rules that control traffic transferred between backup infrastructure components. -*/ -func (a *Client) GetAllTrafficRules(params *GetAllTrafficRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAllTrafficRulesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAllTrafficRulesParams() - } - op := &runtime.ClientOperation{ - ID: "GetAllTrafficRules", - Method: "GET", - PathPattern: "/api/v1/trafficRules", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAllTrafficRulesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetAllTrafficRulesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetAllTrafficRules: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateTrafficRules edits traffic rules - - The HTTP PUT request to the `/api/v1/trafficRules` path allows you to edit network traffic rules that are configured on the backup server. -*/ -func (a *Client) UpdateTrafficRules(params *UpdateTrafficRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTrafficRulesCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateTrafficRulesParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateTrafficRules", - Method: "PUT", - PathPattern: "/api/v1/trafficRules", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateTrafficRulesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateTrafficRulesCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateTrafficRules: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/client/traffic_rules/update_traffic_rules_parameters.go b/client/traffic_rules/update_traffic_rules_parameters.go deleted file mode 100644 index 233d45f..0000000 --- a/client/traffic_rules/update_traffic_rules_parameters.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package traffic_rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// NewUpdateTrafficRulesParams creates a new UpdateTrafficRulesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateTrafficRulesParams() *UpdateTrafficRulesParams { - return &UpdateTrafficRulesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateTrafficRulesParamsWithTimeout creates a new UpdateTrafficRulesParams object -// with the ability to set a timeout on a request. -func NewUpdateTrafficRulesParamsWithTimeout(timeout time.Duration) *UpdateTrafficRulesParams { - return &UpdateTrafficRulesParams{ - timeout: timeout, - } -} - -// NewUpdateTrafficRulesParamsWithContext creates a new UpdateTrafficRulesParams object -// with the ability to set a context for a request. -func NewUpdateTrafficRulesParamsWithContext(ctx context.Context) *UpdateTrafficRulesParams { - return &UpdateTrafficRulesParams{ - Context: ctx, - } -} - -// NewUpdateTrafficRulesParamsWithHTTPClient creates a new UpdateTrafficRulesParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateTrafficRulesParamsWithHTTPClient(client *http.Client) *UpdateTrafficRulesParams { - return &UpdateTrafficRulesParams{ - HTTPClient: client, - } -} - -/* UpdateTrafficRulesParams contains all the parameters to send to the API endpoint - for the update traffic rules operation. - - Typically these are written to a http.Request. -*/ -type UpdateTrafficRulesParams struct { - - // Body. - Body *models.GlobalNetworkTrafficRulesModel - - /* XAPIVersion. - - Version and revision of the client REST API. Must be in the following - format: *\-\*. - - - Default: "1.0-rev1" - */ - XAPIVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update traffic rules params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateTrafficRulesParams) WithDefaults() *UpdateTrafficRulesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update traffic rules params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateTrafficRulesParams) SetDefaults() { - var ( - xAPIVersionDefault = string("1.0-rev1") - ) - - val := UpdateTrafficRulesParams{ - XAPIVersion: xAPIVersionDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the update traffic rules params -func (o *UpdateTrafficRulesParams) WithTimeout(timeout time.Duration) *UpdateTrafficRulesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update traffic rules params -func (o *UpdateTrafficRulesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update traffic rules params -func (o *UpdateTrafficRulesParams) WithContext(ctx context.Context) *UpdateTrafficRulesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update traffic rules params -func (o *UpdateTrafficRulesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update traffic rules params -func (o *UpdateTrafficRulesParams) WithHTTPClient(client *http.Client) *UpdateTrafficRulesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update traffic rules params -func (o *UpdateTrafficRulesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update traffic rules params -func (o *UpdateTrafficRulesParams) WithBody(body *models.GlobalNetworkTrafficRulesModel) *UpdateTrafficRulesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update traffic rules params -func (o *UpdateTrafficRulesParams) SetBody(body *models.GlobalNetworkTrafficRulesModel) { - o.Body = body -} - -// WithXAPIVersion adds the xAPIVersion to the update traffic rules params -func (o *UpdateTrafficRulesParams) WithXAPIVersion(xAPIVersion string) *UpdateTrafficRulesParams { - o.SetXAPIVersion(xAPIVersion) - return o -} - -// SetXAPIVersion adds the xApiVersion to the update traffic rules params -func (o *UpdateTrafficRulesParams) SetXAPIVersion(xAPIVersion string) { - o.XAPIVersion = xAPIVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateTrafficRulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // header param x-api-version - if err := r.SetHeaderParam("x-api-version", o.XAPIVersion); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/client/traffic_rules/update_traffic_rules_responses.go b/client/traffic_rules/update_traffic_rules_responses.go deleted file mode 100644 index 7f67e60..0000000 --- a/client/traffic_rules/update_traffic_rules_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package traffic_rules - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/models" -) - -// UpdateTrafficRulesReader is a Reader for the UpdateTrafficRules structure. -type UpdateTrafficRulesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateTrafficRulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewUpdateTrafficRulesCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateTrafficRulesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateTrafficRulesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateTrafficRulesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateTrafficRulesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateTrafficRulesCreated creates a UpdateTrafficRulesCreated with default headers values -func NewUpdateTrafficRulesCreated() *UpdateTrafficRulesCreated { - return &UpdateTrafficRulesCreated{} -} - -/* UpdateTrafficRulesCreated describes a response with status code 201, with default header values. - -Infrastructure session has been created to edit the traffic rules. To check the progress, track the session `state`. -*/ -type UpdateTrafficRulesCreated struct { - Payload *models.GlobalNetworkTrafficRulesModel -} - -func (o *UpdateTrafficRulesCreated) Error() string { - return fmt.Sprintf("[PUT /api/v1/trafficRules][%d] updateTrafficRulesCreated %+v", 201, o.Payload) -} -func (o *UpdateTrafficRulesCreated) GetPayload() *models.GlobalNetworkTrafficRulesModel { - return o.Payload -} - -func (o *UpdateTrafficRulesCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GlobalNetworkTrafficRulesModel) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTrafficRulesBadRequest creates a UpdateTrafficRulesBadRequest with default headers values -func NewUpdateTrafficRulesBadRequest() *UpdateTrafficRulesBadRequest { - return &UpdateTrafficRulesBadRequest{} -} - -/* UpdateTrafficRulesBadRequest describes a response with status code 400, with default header values. - -Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid. -*/ -type UpdateTrafficRulesBadRequest struct { - Payload *models.Error -} - -func (o *UpdateTrafficRulesBadRequest) Error() string { - return fmt.Sprintf("[PUT /api/v1/trafficRules][%d] updateTrafficRulesBadRequest %+v", 400, o.Payload) -} -func (o *UpdateTrafficRulesBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateTrafficRulesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTrafficRulesUnauthorized creates a UpdateTrafficRulesUnauthorized with default headers values -func NewUpdateTrafficRulesUnauthorized() *UpdateTrafficRulesUnauthorized { - return &UpdateTrafficRulesUnauthorized{} -} - -/* UpdateTrafficRulesUnauthorized describes a response with status code 401, with default header values. - -Unauthorized. The authorization header has been expected but not found (or found but is expired). -*/ -type UpdateTrafficRulesUnauthorized struct { - Payload *models.Error -} - -func (o *UpdateTrafficRulesUnauthorized) Error() string { - return fmt.Sprintf("[PUT /api/v1/trafficRules][%d] updateTrafficRulesUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateTrafficRulesUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateTrafficRulesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTrafficRulesForbidden creates a UpdateTrafficRulesForbidden with default headers values -func NewUpdateTrafficRulesForbidden() *UpdateTrafficRulesForbidden { - return &UpdateTrafficRulesForbidden{} -} - -/* UpdateTrafficRulesForbidden describes a response with status code 403, with default header values. - -Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request. -*/ -type UpdateTrafficRulesForbidden struct { - Payload *models.Error -} - -func (o *UpdateTrafficRulesForbidden) Error() string { - return fmt.Sprintf("[PUT /api/v1/trafficRules][%d] updateTrafficRulesForbidden %+v", 403, o.Payload) -} -func (o *UpdateTrafficRulesForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateTrafficRulesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTrafficRulesInternalServerError creates a UpdateTrafficRulesInternalServerError with default headers values -func NewUpdateTrafficRulesInternalServerError() *UpdateTrafficRulesInternalServerError { - return &UpdateTrafficRulesInternalServerError{} -} - -/* UpdateTrafficRulesInternalServerError describes a response with status code 500, with default header values. - -Internal server error. The request has been received but could not be completed because of an internal error at the server side. -*/ -type UpdateTrafficRulesInternalServerError struct { - Payload *models.Error -} - -func (o *UpdateTrafficRulesInternalServerError) Error() string { - return fmt.Sprintf("[PUT /api/v1/trafficRules][%d] updateTrafficRulesInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateTrafficRulesInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateTrafficRulesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/client/veeam_vbr_client.go b/client/veeam_vbr_client.go deleted file mode 100644 index dce7abb..0000000 --- a/client/veeam_vbr_client.go +++ /dev/null @@ -1,207 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/veeamhub/veeam-vbr-sdk-go/client/automation" - "github.com/veeamhub/veeam-vbr-sdk-go/client/backup_objects" - "github.com/veeamhub/veeam-vbr-sdk-go/client/backups" - "github.com/veeamhub/veeam-vbr-sdk-go/client/configuration_backup" - "github.com/veeamhub/veeam-vbr-sdk-go/client/connection" - "github.com/veeamhub/veeam-vbr-sdk-go/client/credentials" - "github.com/veeamhub/veeam-vbr-sdk-go/client/encryption" - "github.com/veeamhub/veeam-vbr-sdk-go/client/general_options" - "github.com/veeamhub/veeam-vbr-sdk-go/client/inventory_browser" - "github.com/veeamhub/veeam-vbr-sdk-go/client/jobs" - "github.com/veeamhub/veeam-vbr-sdk-go/client/login" - "github.com/veeamhub/veeam-vbr-sdk-go/client/managed_servers" - "github.com/veeamhub/veeam-vbr-sdk-go/client/object_restore_points" - "github.com/veeamhub/veeam-vbr-sdk-go/client/proxies" - "github.com/veeamhub/veeam-vbr-sdk-go/client/repositories" - "github.com/veeamhub/veeam-vbr-sdk-go/client/restore" - "github.com/veeamhub/veeam-vbr-sdk-go/client/service" - "github.com/veeamhub/veeam-vbr-sdk-go/client/services" - "github.com/veeamhub/veeam-vbr-sdk-go/client/sessions" - "github.com/veeamhub/veeam-vbr-sdk-go/client/traffic_rules" -) - -// Default veeam vbr HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new veeam vbr HTTP client. -func NewHTTPClient(formats strfmt.Registry) *VeeamVbr { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new veeam vbr HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *VeeamVbr { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new veeam vbr client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *VeeamVbr { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(VeeamVbr) - cli.Transport = transport - cli.Automation = automation.New(transport, formats) - cli.BackupObjects = backup_objects.New(transport, formats) - cli.Backups = backups.New(transport, formats) - cli.ConfigurationBackup = configuration_backup.New(transport, formats) - cli.Connection = connection.New(transport, formats) - cli.Credentials = credentials.New(transport, formats) - cli.Encryption = encryption.New(transport, formats) - cli.GeneralOptions = general_options.New(transport, formats) - cli.InventoryBrowser = inventory_browser.New(transport, formats) - cli.Jobs = jobs.New(transport, formats) - cli.Login = login.New(transport, formats) - cli.ManagedServers = managed_servers.New(transport, formats) - cli.ObjectRestorePoints = object_restore_points.New(transport, formats) - cli.Proxies = proxies.New(transport, formats) - cli.Repositories = repositories.New(transport, formats) - cli.Restore = restore.New(transport, formats) - cli.Service = service.New(transport, formats) - cli.Services = services.New(transport, formats) - cli.Sessions = sessions.New(transport, formats) - cli.TrafficRules = traffic_rules.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// VeeamVbr is a client for veeam vbr -type VeeamVbr struct { - Automation automation.ClientService - - BackupObjects backup_objects.ClientService - - Backups backups.ClientService - - ConfigurationBackup configuration_backup.ClientService - - Connection connection.ClientService - - Credentials credentials.ClientService - - Encryption encryption.ClientService - - GeneralOptions general_options.ClientService - - InventoryBrowser inventory_browser.ClientService - - Jobs jobs.ClientService - - Login login.ClientService - - ManagedServers managed_servers.ClientService - - ObjectRestorePoints object_restore_points.ClientService - - Proxies proxies.ClientService - - Repositories repositories.ClientService - - Restore restore.ClientService - - Service service.ClientService - - Services services.ClientService - - Sessions sessions.ClientService - - TrafficRules traffic_rules.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *VeeamVbr) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Automation.SetTransport(transport) - c.BackupObjects.SetTransport(transport) - c.Backups.SetTransport(transport) - c.ConfigurationBackup.SetTransport(transport) - c.Connection.SetTransport(transport) - c.Credentials.SetTransport(transport) - c.Encryption.SetTransport(transport) - c.GeneralOptions.SetTransport(transport) - c.InventoryBrowser.SetTransport(transport) - c.Jobs.SetTransport(transport) - c.Login.SetTransport(transport) - c.ManagedServers.SetTransport(transport) - c.ObjectRestorePoints.SetTransport(transport) - c.Proxies.SetTransport(transport) - c.Repositories.SetTransport(transport) - c.Restore.SetTransport(transport) - c.Service.SetTransport(transport) - c.Services.SetTransport(transport) - c.Sessions.SetTransport(transport) - c.TrafficRules.SetTransport(transport) -} diff --git a/go.mod b/go.mod deleted file mode 100644 index 6c3c39e..0000000 --- a/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module github.com/veeamhub/veeam-vbr-sdk-go - -go 1.16 - -require ( - github.com/go-openapi/errors v0.20.0 - github.com/go-openapi/runtime v0.19.27 - github.com/go-openapi/strfmt v0.20.1 - github.com/go-openapi/swag v0.19.15 - github.com/go-openapi/validate v0.20.2 -) diff --git a/go.sum b/go.sum deleted file mode 100644 index 3427abb..0000000 --- a/go.sum +++ /dev/null @@ -1,308 +0,0 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/analysis v0.19.16/go.mod h1:GLInF007N83Ad3m8a/CbQ5TPzdnGT7workfHwuVjNVk= -github.com/go-openapi/analysis v0.20.0 h1:UN09o0kNhleunxW7LR+KnltD0YrJ8FF03pSqvAN3Vro= -github.com/go-openapi/analysis v0.20.0/go.mod h1:BMchjvaHDykmRMsK40iPtvyOfFdMMxlOmQr9FBZk+Og= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.0 h1:Sxpo9PjEHDzhs3FbnGNonvDgWcMW2U7wGTcDDSFSceM= -github.com/go-openapi/errors v0.20.0/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.20.0/go.mod h1:2LhKquiE513rN5xC6Aan6lYOSddlL8Mp20AW9kpviM4= -github.com/go-openapi/loads v0.20.2 h1:z5p5Xf5wujMxS1y8aP+vxwW5qYT2zdJBbXKmQUG3lcc= -github.com/go-openapi/loads v0.20.2/go.mod h1:hTVUotJ+UonAMMZsvakEgmWKgtulweO9vYP2bQYKA/o= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= -github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/runtime v0.19.27 h1:4zrQCJoP7rqNCUaApDv1MdPkaa5TuPfO05Lq5WLhX9I= -github.com/go-openapi/runtime v0.19.27/go.mod h1:BvrQtn6iVb2QmiVXRsFAm6ZCAZBpbVKFfN6QWCp582M= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.15/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.1/go.mod h1:93x7oh+d+FQsmsieroS4cmR3u0p/ywH649a3qwC9OsQ= -github.com/go-openapi/spec v0.20.3 h1:uH9RQ6vdyPSs2pSy9fL8QPspDF2AMIMPtmK5coSSjtQ= -github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/strfmt v0.20.1 h1:1VgxvehFne1mbChGeCmZ5pc0LxUf6yaACVSIYAR91Xc= -github.com/go-openapi/strfmt v0.20.1/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= -github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= -github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= -github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= -github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= -github.com/go-openapi/validate v0.20.2 h1:AhqDegYV3J3iQkMPJSXkvzymHKMTw0BST3RK3hTT4ts= -github.com/go-openapi/validate v0.20.2/go.mod h1:e7OJoKNgd0twXZwIn0A43tHbvIcr/rZIVCbJBpTUoY0= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= -go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/models/active_full_settings_model.go b/models/active_full_settings_model.go deleted file mode 100644 index b31b8ec..0000000 --- a/models/active_full_settings_model.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ActiveFullSettingsModel Active full backup settings. -// -// swagger:model ActiveFullSettingsModel -type ActiveFullSettingsModel struct { - - // If *true*, active full backups are enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // monthly - Monthly *AdvancedStorageScheduleMonthlyModel `json:"monthly,omitempty"` - - // weekly - Weekly *AdvancedStorageScheduleWeeklyModel `json:"weekly,omitempty"` -} - -// Validate validates this active full settings model -func (m *ActiveFullSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMonthly(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeekly(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ActiveFullSettingsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *ActiveFullSettingsModel) validateMonthly(formats strfmt.Registry) error { - if swag.IsZero(m.Monthly) { // not required - return nil - } - - if m.Monthly != nil { - if err := m.Monthly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *ActiveFullSettingsModel) validateWeekly(formats strfmt.Registry) error { - if swag.IsZero(m.Weekly) { // not required - return nil - } - - if m.Weekly != nil { - if err := m.Weekly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weekly") - } - return err - } - } - - return nil -} - -// ContextValidate validate this active full settings model based on the context it is used -func (m *ActiveFullSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMonthly(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeekly(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ActiveFullSettingsModel) contextValidateMonthly(ctx context.Context, formats strfmt.Registry) error { - - if m.Monthly != nil { - if err := m.Monthly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *ActiveFullSettingsModel) contextValidateWeekly(ctx context.Context, formats strfmt.Registry) error { - - if m.Weekly != nil { - if err := m.Weekly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weekly") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ActiveFullSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ActiveFullSettingsModel) UnmarshalBinary(b []byte) error { - var res ActiveFullSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/advanced_smtp_options_model.go b/models/advanced_smtp_options_model.go deleted file mode 100644 index 6e744ce..0000000 --- a/models/advanced_smtp_options_model.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AdvancedSMTPOptionsModel advanced global email notification settings. -// -// swagger:model AdvancedSmtpOptionsModel -type AdvancedSMTPOptionsModel struct { - - // If *true*, secure connection for email operations is used. - // Required: true - SSLEnabled *bool `json:"SSLEnabled"` - - // If *true*, the `credentialsId` credentials are used to connect to the SMTP server. - // Required: true - AuthRequred *bool `json:"authRequred"` - - // ID of the credentials used to connect to the server. - // Format: uuid - CredentialsID strfmt.UUID `json:"credentialsId,omitempty"` - - // Port number for the SMTP server. - // Required: true - Port *int32 `json:"port"` - - // Connection timeout for the SMTP server. - // Required: true - TimeoutMs *int32 `json:"timeoutMs"` -} - -// Validate validates this advanced Smtp options model -func (m *AdvancedSMTPOptionsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSSLEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAuthRequred(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredentialsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePort(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeoutMs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AdvancedSMTPOptionsModel) validateSSLEnabled(formats strfmt.Registry) error { - - if err := validate.Required("SSLEnabled", "body", m.SSLEnabled); err != nil { - return err - } - - return nil -} - -func (m *AdvancedSMTPOptionsModel) validateAuthRequred(formats strfmt.Registry) error { - - if err := validate.Required("authRequred", "body", m.AuthRequred); err != nil { - return err - } - - return nil -} - -func (m *AdvancedSMTPOptionsModel) validateCredentialsID(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialsID) { // not required - return nil - } - - if err := validate.FormatOf("credentialsId", "body", "uuid", m.CredentialsID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *AdvancedSMTPOptionsModel) validatePort(formats strfmt.Registry) error { - - if err := validate.Required("port", "body", m.Port); err != nil { - return err - } - - return nil -} - -func (m *AdvancedSMTPOptionsModel) validateTimeoutMs(formats strfmt.Registry) error { - - if err := validate.Required("timeoutMs", "body", m.TimeoutMs); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this advanced Smtp options model based on context it is used -func (m *AdvancedSMTPOptionsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AdvancedSMTPOptionsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AdvancedSMTPOptionsModel) UnmarshalBinary(b []byte) error { - var res AdvancedSMTPOptionsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/advanced_storage_schedule_monthly_model.go b/models/advanced_storage_schedule_monthly_model.go deleted file mode 100644 index 0d67241..0000000 --- a/models/advanced_storage_schedule_monthly_model.go +++ /dev/null @@ -1,207 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AdvancedStorageScheduleMonthlyModel Monthly schedule settings. -// -// swagger:model AdvancedStorageScheduleMonthlyModel -type AdvancedStorageScheduleMonthlyModel struct { - - // day number in month - DayNumberInMonth EDayNumberInMonth `json:"dayNumberInMonth,omitempty"` - - // Day of the month when the operation is performed. - DayOfMonths int64 `json:"dayOfMonths,omitempty"` - - // day of week - DayOfWeek EDayOfWeek `json:"dayOfWeek,omitempty"` - - // If *true*, the monthly schedule is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // Months when the operation is performed. - // Unique: true - Months []EMonth `json:"months"` -} - -// Validate validates this advanced storage schedule monthly model -func (m *AdvancedStorageScheduleMonthlyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDayNumberInMonth(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDayOfWeek(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMonths(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AdvancedStorageScheduleMonthlyModel) validateDayNumberInMonth(formats strfmt.Registry) error { - if swag.IsZero(m.DayNumberInMonth) { // not required - return nil - } - - if err := m.DayNumberInMonth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayNumberInMonth") - } - return err - } - - return nil -} - -func (m *AdvancedStorageScheduleMonthlyModel) validateDayOfWeek(formats strfmt.Registry) error { - if swag.IsZero(m.DayOfWeek) { // not required - return nil - } - - if err := m.DayOfWeek.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayOfWeek") - } - return err - } - - return nil -} - -func (m *AdvancedStorageScheduleMonthlyModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *AdvancedStorageScheduleMonthlyModel) validateMonths(formats strfmt.Registry) error { - if swag.IsZero(m.Months) { // not required - return nil - } - - if err := validate.UniqueItems("months", "body", m.Months); err != nil { - return err - } - - for i := 0; i < len(m.Months); i++ { - - if err := m.Months[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("months" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this advanced storage schedule monthly model based on the context it is used -func (m *AdvancedStorageScheduleMonthlyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDayNumberInMonth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDayOfWeek(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMonths(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AdvancedStorageScheduleMonthlyModel) contextValidateDayNumberInMonth(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DayNumberInMonth.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayNumberInMonth") - } - return err - } - - return nil -} - -func (m *AdvancedStorageScheduleMonthlyModel) contextValidateDayOfWeek(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DayOfWeek.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayOfWeek") - } - return err - } - - return nil -} - -func (m *AdvancedStorageScheduleMonthlyModel) contextValidateMonths(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Months); i++ { - - if err := m.Months[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("months" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AdvancedStorageScheduleMonthlyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AdvancedStorageScheduleMonthlyModel) UnmarshalBinary(b []byte) error { - var res AdvancedStorageScheduleMonthlyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/advanced_storage_schedule_weekly_model.go b/models/advanced_storage_schedule_weekly_model.go deleted file mode 100644 index c7bf6d8..0000000 --- a/models/advanced_storage_schedule_weekly_model.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AdvancedStorageScheduleWeeklyModel Weekly schedule settings. -// -// swagger:model AdvancedStorageScheduleWeeklyModel -type AdvancedStorageScheduleWeeklyModel struct { - - // Days of the week when the operation is performed. - // Unique: true - Days []EDayOfWeek `json:"days"` - - // If *true*, the weekly schedule is enabled. - // Required: true - IsEnabled bool `json:"isEnabled"` -} - -// Validate validates this advanced storage schedule weekly model -func (m *AdvancedStorageScheduleWeeklyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDays(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AdvancedStorageScheduleWeeklyModel) validateDays(formats strfmt.Registry) error { - if swag.IsZero(m.Days) { // not required - return nil - } - - if err := validate.UniqueItems("days", "body", m.Days); err != nil { - return err - } - - for i := 0; i < len(m.Days); i++ { - - if err := m.Days[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("days" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *AdvancedStorageScheduleWeeklyModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", bool(m.IsEnabled)); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this advanced storage schedule weekly model based on the context it is used -func (m *AdvancedStorageScheduleWeeklyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDays(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AdvancedStorageScheduleWeeklyModel) contextValidateDays(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Days); i++ { - - if err := m.Days[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("days" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AdvancedStorageScheduleWeeklyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AdvancedStorageScheduleWeeklyModel) UnmarshalBinary(b []byte) error { - var res AdvancedStorageScheduleWeeklyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/archive_tier_advanced_settings_model.go b/models/archive_tier_advanced_settings_model.go deleted file mode 100644 index 6b6f8da..0000000 --- a/models/archive_tier_advanced_settings_model.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ArchiveTierAdvancedSettingsModel Advanced settings of the archive tier. -// -// swagger:model ArchiveTierAdvancedSettingsModel -type ArchiveTierAdvancedSettingsModel struct { - - // If *true*, each backup is stored as a delta to the previous one. - ArchiveDeduplicationEnabled bool `json:"archiveDeduplicationEnabled,omitempty"` - - // If *true*, backups are archived if the remaining retention time is above minimum storage period for the repository. - CostOptimizedArchiveEnabled bool `json:"costOptimizedArchiveEnabled,omitempty"` -} - -// Validate validates this archive tier advanced settings model -func (m *ArchiveTierAdvancedSettingsModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this archive tier advanced settings model based on context it is used -func (m *ArchiveTierAdvancedSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ArchiveTierAdvancedSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ArchiveTierAdvancedSettingsModel) UnmarshalBinary(b []byte) error { - var res ArchiveTierAdvancedSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/archive_tier_model.go b/models/archive_tier_model.go deleted file mode 100644 index f1b3824..0000000 --- a/models/archive_tier_model.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ArchiveTierModel Archive tier. -// -// swagger:model ArchiveTierModel -type ArchiveTierModel struct { - - // advanced settings - AdvancedSettings *ArchiveTierAdvancedSettingsModel `json:"advancedSettings,omitempty"` - - // Number of days after which backup chains on the capacity extent are moved to the archive extent. Specify *0* to offload inactive backup chains on the same day they are created. - ArchivePeriodDays int64 `json:"archivePeriodDays,omitempty"` - - // ID of an object storage repository added as an archive extent. - // Format: uuid - ExtentID strfmt.UUID `json:"extentId,omitempty"` - - // If *true*, the archive tier is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` -} - -// Validate validates this archive tier model -func (m *ArchiveTierModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdvancedSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExtentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ArchiveTierModel) validateAdvancedSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AdvancedSettings) { // not required - return nil - } - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -func (m *ArchiveTierModel) validateExtentID(formats strfmt.Registry) error { - if swag.IsZero(m.ExtentID) { // not required - return nil - } - - if err := validate.FormatOf("extentId", "body", "uuid", m.ExtentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ArchiveTierModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this archive tier model based on the context it is used -func (m *ArchiveTierModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvancedSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ArchiveTierModel) contextValidateAdvancedSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ArchiveTierModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ArchiveTierModel) UnmarshalBinary(b []byte) error { - var res ArchiveTierModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/authorization_code_model.go b/models/authorization_code_model.go deleted file mode 100644 index b17a445..0000000 --- a/models/authorization_code_model.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthorizationCodeModel authorization code model -// -// swagger:model AuthorizationCodeModel -type AuthorizationCodeModel struct { - - // String that is used to obtain an access token. Lifetime of the authorization code is 60 seconds. - // Required: true - Code *string `json:"code"` -} - -// Validate validates this authorization code model -func (m *AuthorizationCodeModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthorizationCodeModel) validateCode(formats strfmt.Registry) error { - - if err := validate.Required("code", "body", m.Code); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this authorization code model based on context it is used -func (m *AuthorizationCodeModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthorizationCodeModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthorizationCodeModel) UnmarshalBinary(b []byte) error { - var res AuthorizationCodeModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_application_aware_processing_import_model.go b/models/backup_application_aware_processing_import_model.go deleted file mode 100644 index ea63e66..0000000 --- a/models/backup_application_aware_processing_import_model.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupApplicationAwareProcessingImportModel Application-aware processing settings. -// -// swagger:model BackupApplicationAwareProcessingImportModel -type BackupApplicationAwareProcessingImportModel struct { - - // Array of VMware objects and their application settings. - AppSettings []*BackupApplicationSettingsImportModel `json:"appSettings"` - - // If *true*, application-aware processing is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` -} - -// Validate validates this backup application aware processing import model -func (m *BackupApplicationAwareProcessingImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupApplicationAwareProcessingImportModel) validateAppSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AppSettings) { // not required - return nil - } - - for i := 0; i < len(m.AppSettings); i++ { - if swag.IsZero(m.AppSettings[i]) { // not required - continue - } - - if m.AppSettings[i] != nil { - if err := m.AppSettings[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appSettings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupApplicationAwareProcessingImportModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backup application aware processing import model based on the context it is used -func (m *BackupApplicationAwareProcessingImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupApplicationAwareProcessingImportModel) contextValidateAppSettings(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.AppSettings); i++ { - - if m.AppSettings[i] != nil { - if err := m.AppSettings[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appSettings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupApplicationAwareProcessingImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupApplicationAwareProcessingImportModel) UnmarshalBinary(b []byte) error { - var res BackupApplicationAwareProcessingImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_application_aware_processing_model.go b/models/backup_application_aware_processing_model.go deleted file mode 100644 index 1abf6f0..0000000 --- a/models/backup_application_aware_processing_model.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupApplicationAwareProcessingModel Application-aware processing settings. -// -// swagger:model BackupApplicationAwareProcessingModel -type BackupApplicationAwareProcessingModel struct { - - // Array of VMware objects and their application settings. - AppSettings []*BackupApplicationSettingsModel `json:"appSettings"` - - // If *true*, application-aware processing is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` -} - -// Validate validates this backup application aware processing model -func (m *BackupApplicationAwareProcessingModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupApplicationAwareProcessingModel) validateAppSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AppSettings) { // not required - return nil - } - - for i := 0; i < len(m.AppSettings); i++ { - if swag.IsZero(m.AppSettings[i]) { // not required - continue - } - - if m.AppSettings[i] != nil { - if err := m.AppSettings[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appSettings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupApplicationAwareProcessingModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backup application aware processing model based on the context it is used -func (m *BackupApplicationAwareProcessingModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupApplicationAwareProcessingModel) contextValidateAppSettings(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.AppSettings); i++ { - - if m.AppSettings[i] != nil { - if err := m.AppSettings[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appSettings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupApplicationAwareProcessingModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupApplicationAwareProcessingModel) UnmarshalBinary(b []byte) error { - var res BackupApplicationAwareProcessingModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_application_settings_import_model.go b/models/backup_application_settings_import_model.go deleted file mode 100644 index a507f11..0000000 --- a/models/backup_application_settings_import_model.go +++ /dev/null @@ -1,360 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupApplicationSettingsImportModel backup application settings import model -// -// swagger:model BackupApplicationSettingsImportModel -type BackupApplicationSettingsImportModel struct { - - // exclusions - Exclusions *BackupFSExclusionsModel `json:"exclusions,omitempty"` - - // oracle - Oracle *BackupOracleSettingsImportModel `json:"oracle,omitempty"` - - // scripts - Scripts *BackupScriptSettingsModel `json:"scripts,omitempty"` - - // sql - SQL *BackupSQLSettingsImportModel `json:"sql,omitempty"` - - // transaction logs - TransactionLogs ETransactionLogsSettings `json:"transactionLogs,omitempty"` - - // If *true*, persistent guest agent is used. - UsePersistentGuestAgent bool `json:"usePersistentGuestAgent,omitempty"` - - // vm object - // Required: true - VMObject *VmwareObjectModel `json:"vmObject"` - - // vss - // Required: true - Vss *EApplicationSettingsVSS `json:"vss"` -} - -// Validate validates this backup application settings import model -func (m *BackupApplicationSettingsImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExclusions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOracle(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScripts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSQL(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransactionLogs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVMObject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVss(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupApplicationSettingsImportModel) validateExclusions(formats strfmt.Registry) error { - if swag.IsZero(m.Exclusions) { // not required - return nil - } - - if m.Exclusions != nil { - if err := m.Exclusions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("exclusions") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) validateOracle(formats strfmt.Registry) error { - if swag.IsZero(m.Oracle) { // not required - return nil - } - - if m.Oracle != nil { - if err := m.Oracle.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("oracle") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) validateScripts(formats strfmt.Registry) error { - if swag.IsZero(m.Scripts) { // not required - return nil - } - - if m.Scripts != nil { - if err := m.Scripts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("scripts") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) validateSQL(formats strfmt.Registry) error { - if swag.IsZero(m.SQL) { // not required - return nil - } - - if m.SQL != nil { - if err := m.SQL.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sql") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) validateTransactionLogs(formats strfmt.Registry) error { - if swag.IsZero(m.TransactionLogs) { // not required - return nil - } - - if err := m.TransactionLogs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transactionLogs") - } - return err - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) validateVMObject(formats strfmt.Registry) error { - - if err := validate.Required("vmObject", "body", m.VMObject); err != nil { - return err - } - - if m.VMObject != nil { - if err := m.VMObject.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) validateVss(formats strfmt.Registry) error { - - if err := validate.Required("vss", "body", m.Vss); err != nil { - return err - } - - if err := validate.Required("vss", "body", m.Vss); err != nil { - return err - } - - if m.Vss != nil { - if err := m.Vss.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vss") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup application settings import model based on the context it is used -func (m *BackupApplicationSettingsImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateExclusions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOracle(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateScripts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSQL(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransactionLogs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVMObject(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVss(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupApplicationSettingsImportModel) contextValidateExclusions(ctx context.Context, formats strfmt.Registry) error { - - if m.Exclusions != nil { - if err := m.Exclusions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("exclusions") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) contextValidateOracle(ctx context.Context, formats strfmt.Registry) error { - - if m.Oracle != nil { - if err := m.Oracle.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("oracle") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) contextValidateScripts(ctx context.Context, formats strfmt.Registry) error { - - if m.Scripts != nil { - if err := m.Scripts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("scripts") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) contextValidateSQL(ctx context.Context, formats strfmt.Registry) error { - - if m.SQL != nil { - if err := m.SQL.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sql") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) contextValidateTransactionLogs(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TransactionLogs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transactionLogs") - } - return err - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) contextValidateVMObject(ctx context.Context, formats strfmt.Registry) error { - - if m.VMObject != nil { - if err := m.VMObject.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsImportModel) contextValidateVss(ctx context.Context, formats strfmt.Registry) error { - - if m.Vss != nil { - if err := m.Vss.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vss") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupApplicationSettingsImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupApplicationSettingsImportModel) UnmarshalBinary(b []byte) error { - var res BackupApplicationSettingsImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_application_settings_model.go b/models/backup_application_settings_model.go deleted file mode 100644 index 1ac3828..0000000 --- a/models/backup_application_settings_model.go +++ /dev/null @@ -1,360 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupApplicationSettingsModel backup application settings model -// -// swagger:model BackupApplicationSettingsModel -type BackupApplicationSettingsModel struct { - - // exclusions - Exclusions *BackupFSExclusionsModel `json:"exclusions,omitempty"` - - // oracle - Oracle *BackupOracleSettingsModel `json:"oracle,omitempty"` - - // scripts - Scripts *BackupScriptSettingsModel `json:"scripts,omitempty"` - - // sql - SQL *BackupSQLSettingsModel `json:"sql,omitempty"` - - // transaction logs - TransactionLogs ETransactionLogsSettings `json:"transactionLogs,omitempty"` - - // If *true*, persistent guest agent is used. - UsePersistentGuestAgent bool `json:"usePersistentGuestAgent,omitempty"` - - // vm object - // Required: true - VMObject *VmwareObjectModel `json:"vmObject"` - - // vss - // Required: true - Vss *EApplicationSettingsVSS `json:"vss"` -} - -// Validate validates this backup application settings model -func (m *BackupApplicationSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExclusions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOracle(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScripts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSQL(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransactionLogs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVMObject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVss(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupApplicationSettingsModel) validateExclusions(formats strfmt.Registry) error { - if swag.IsZero(m.Exclusions) { // not required - return nil - } - - if m.Exclusions != nil { - if err := m.Exclusions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("exclusions") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) validateOracle(formats strfmt.Registry) error { - if swag.IsZero(m.Oracle) { // not required - return nil - } - - if m.Oracle != nil { - if err := m.Oracle.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("oracle") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) validateScripts(formats strfmt.Registry) error { - if swag.IsZero(m.Scripts) { // not required - return nil - } - - if m.Scripts != nil { - if err := m.Scripts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("scripts") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) validateSQL(formats strfmt.Registry) error { - if swag.IsZero(m.SQL) { // not required - return nil - } - - if m.SQL != nil { - if err := m.SQL.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sql") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) validateTransactionLogs(formats strfmt.Registry) error { - if swag.IsZero(m.TransactionLogs) { // not required - return nil - } - - if err := m.TransactionLogs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transactionLogs") - } - return err - } - - return nil -} - -func (m *BackupApplicationSettingsModel) validateVMObject(formats strfmt.Registry) error { - - if err := validate.Required("vmObject", "body", m.VMObject); err != nil { - return err - } - - if m.VMObject != nil { - if err := m.VMObject.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) validateVss(formats strfmt.Registry) error { - - if err := validate.Required("vss", "body", m.Vss); err != nil { - return err - } - - if err := validate.Required("vss", "body", m.Vss); err != nil { - return err - } - - if m.Vss != nil { - if err := m.Vss.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vss") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup application settings model based on the context it is used -func (m *BackupApplicationSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateExclusions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOracle(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateScripts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSQL(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransactionLogs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVMObject(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVss(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupApplicationSettingsModel) contextValidateExclusions(ctx context.Context, formats strfmt.Registry) error { - - if m.Exclusions != nil { - if err := m.Exclusions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("exclusions") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) contextValidateOracle(ctx context.Context, formats strfmt.Registry) error { - - if m.Oracle != nil { - if err := m.Oracle.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("oracle") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) contextValidateScripts(ctx context.Context, formats strfmt.Registry) error { - - if m.Scripts != nil { - if err := m.Scripts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("scripts") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) contextValidateSQL(ctx context.Context, formats strfmt.Registry) error { - - if m.SQL != nil { - if err := m.SQL.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sql") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) contextValidateTransactionLogs(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TransactionLogs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transactionLogs") - } - return err - } - - return nil -} - -func (m *BackupApplicationSettingsModel) contextValidateVMObject(ctx context.Context, formats strfmt.Registry) error { - - if m.VMObject != nil { - if err := m.VMObject.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -func (m *BackupApplicationSettingsModel) contextValidateVss(ctx context.Context, formats strfmt.Registry) error { - - if m.Vss != nil { - if err := m.Vss.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vss") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupApplicationSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupApplicationSettingsModel) UnmarshalBinary(b []byte) error { - var res BackupApplicationSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_f_s_exclusions_model.go b/models/backup_f_s_exclusions_model.go deleted file mode 100644 index caebf76..0000000 --- a/models/backup_f_s_exclusions_model.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupFSExclusionsModel VM guest OS file exclusion. -// -// swagger:model BackupFSExclusionsModel -type BackupFSExclusionsModel struct { - - // exclusion policy - // Required: true - ExclusionPolicy *EBackupExclusionPolicy `json:"exclusionPolicy"` - - // Array of files and folders. Full paths to files and folders, environmental variables and file masks with the asterisk (*) and question mark (?) characters can be used. - ItemsList []string `json:"itemsList"` -} - -// Validate validates this backup f s exclusions model -func (m *BackupFSExclusionsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExclusionPolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupFSExclusionsModel) validateExclusionPolicy(formats strfmt.Registry) error { - - if err := validate.Required("exclusionPolicy", "body", m.ExclusionPolicy); err != nil { - return err - } - - if err := validate.Required("exclusionPolicy", "body", m.ExclusionPolicy); err != nil { - return err - } - - if m.ExclusionPolicy != nil { - if err := m.ExclusionPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("exclusionPolicy") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup f s exclusions model based on the context it is used -func (m *BackupFSExclusionsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateExclusionPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupFSExclusionsModel) contextValidateExclusionPolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.ExclusionPolicy != nil { - if err := m.ExclusionPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("exclusionPolicy") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupFSExclusionsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupFSExclusionsModel) UnmarshalBinary(b []byte) error { - var res BackupFSExclusionsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_health_check_settings_models.go b/models/backup_health_check_settings_models.go deleted file mode 100644 index 30f8c78..0000000 --- a/models/backup_health_check_settings_models.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupHealthCheckSettingsModels Health check settings for the for the latest restore point in the backup chain. -// -// swagger:model BackupHealthCheckSettingsModels -type BackupHealthCheckSettingsModels struct { - - // If *true*, the health check is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // monthly - Monthly *AdvancedStorageScheduleMonthlyModel `json:"monthly,omitempty"` - - // weekly - Weekly *AdvancedStorageScheduleWeeklyModel `json:"weekly,omitempty"` -} - -// Validate validates this backup health check settings models -func (m *BackupHealthCheckSettingsModels) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMonthly(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeekly(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupHealthCheckSettingsModels) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *BackupHealthCheckSettingsModels) validateMonthly(formats strfmt.Registry) error { - if swag.IsZero(m.Monthly) { // not required - return nil - } - - if m.Monthly != nil { - if err := m.Monthly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *BackupHealthCheckSettingsModels) validateWeekly(formats strfmt.Registry) error { - if swag.IsZero(m.Weekly) { // not required - return nil - } - - if m.Weekly != nil { - if err := m.Weekly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weekly") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup health check settings models based on the context it is used -func (m *BackupHealthCheckSettingsModels) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMonthly(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeekly(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupHealthCheckSettingsModels) contextValidateMonthly(ctx context.Context, formats strfmt.Registry) error { - - if m.Monthly != nil { - if err := m.Monthly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *BackupHealthCheckSettingsModels) contextValidateWeekly(ctx context.Context, formats strfmt.Registry) error { - - if m.Weekly != nil { - if err := m.Weekly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weekly") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupHealthCheckSettingsModels) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupHealthCheckSettingsModels) UnmarshalBinary(b []byte) error { - var res BackupHealthCheckSettingsModels - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_indexing_settings_model.go b/models/backup_indexing_settings_model.go deleted file mode 100644 index 985999e..0000000 --- a/models/backup_indexing_settings_model.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupIndexingSettingsModel backup indexing settings model -// -// swagger:model BackupIndexingSettingsModel -type BackupIndexingSettingsModel struct { - - // linux indexing - LinuxIndexing *BackupObjectIndexingModel `json:"LinuxIndexing,omitempty"` - - // windows indexing - WindowsIndexing *BackupObjectIndexingModel `json:"WindowsIndexing,omitempty"` - - // vm object - // Required: true - VMObject *VmwareObjectModel `json:"vmObject"` -} - -// Validate validates this backup indexing settings model -func (m *BackupIndexingSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinuxIndexing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWindowsIndexing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVMObject(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupIndexingSettingsModel) validateLinuxIndexing(formats strfmt.Registry) error { - if swag.IsZero(m.LinuxIndexing) { // not required - return nil - } - - if m.LinuxIndexing != nil { - if err := m.LinuxIndexing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("LinuxIndexing") - } - return err - } - } - - return nil -} - -func (m *BackupIndexingSettingsModel) validateWindowsIndexing(formats strfmt.Registry) error { - if swag.IsZero(m.WindowsIndexing) { // not required - return nil - } - - if m.WindowsIndexing != nil { - if err := m.WindowsIndexing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("WindowsIndexing") - } - return err - } - } - - return nil -} - -func (m *BackupIndexingSettingsModel) validateVMObject(formats strfmt.Registry) error { - - if err := validate.Required("vmObject", "body", m.VMObject); err != nil { - return err - } - - if m.VMObject != nil { - if err := m.VMObject.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup indexing settings model based on the context it is used -func (m *BackupIndexingSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinuxIndexing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWindowsIndexing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVMObject(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupIndexingSettingsModel) contextValidateLinuxIndexing(ctx context.Context, formats strfmt.Registry) error { - - if m.LinuxIndexing != nil { - if err := m.LinuxIndexing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("LinuxIndexing") - } - return err - } - } - - return nil -} - -func (m *BackupIndexingSettingsModel) contextValidateWindowsIndexing(ctx context.Context, formats strfmt.Registry) error { - - if m.WindowsIndexing != nil { - if err := m.WindowsIndexing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("WindowsIndexing") - } - return err - } - } - - return nil -} - -func (m *BackupIndexingSettingsModel) contextValidateVMObject(ctx context.Context, formats strfmt.Registry) error { - - if m.VMObject != nil { - if err := m.VMObject.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupIndexingSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupIndexingSettingsModel) UnmarshalBinary(b []byte) error { - var res BackupIndexingSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_advanced_settings_model.go b/models/backup_job_advanced_settings_model.go deleted file mode 100644 index 00ca0e9..0000000 --- a/models/backup_job_advanced_settings_model.go +++ /dev/null @@ -1,485 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobAdvancedSettingsModel Advanced settings of the backup job. -// -// swagger:model BackupJobAdvancedSettingsModel -type BackupJobAdvancedSettingsModel struct { - - // active fulls - ActiveFulls *ActiveFullSettingsModel `json:"activeFulls,omitempty"` - - // backup health - BackupHealth *BackupHealthCheckSettingsModels `json:"backupHealth,omitempty"` - - // backup mode type - // Required: true - BackupModeType *EBackupModeType `json:"backupModeType"` - - // full backup maintenance - FullBackupMaintenance *FullBackupMaintenanceModel `json:"fullBackupMaintenance,omitempty"` - - // notifications - Notifications *NotificationSettingsModel `json:"notifications,omitempty"` - - // scripts - Scripts *JobScriptsSettingsModel `json:"scripts,omitempty"` - - // storage data - StorageData *BackupStorageSettingModel `json:"storageData,omitempty"` - - // storage integration - StorageIntegration *PrimaryStorageIntegrationSettingsModel `json:"storageIntegration,omitempty"` - - // synthentic fulls - SynthenticFulls *SyntheticFullSettingsModel `json:"synthenticFulls,omitempty"` - - // v sphere - VSphere *BackupJobAdvancedSettingsVSphereModel `json:"vSphere,omitempty"` -} - -// Validate validates this backup job advanced settings model -func (m *BackupJobAdvancedSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActiveFulls(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupHealth(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupModeType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullBackupMaintenance(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifications(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScripts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageIntegration(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSynthenticFulls(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVSphere(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateActiveFulls(formats strfmt.Registry) error { - if swag.IsZero(m.ActiveFulls) { // not required - return nil - } - - if m.ActiveFulls != nil { - if err := m.ActiveFulls.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("activeFulls") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateBackupHealth(formats strfmt.Registry) error { - if swag.IsZero(m.BackupHealth) { // not required - return nil - } - - if m.BackupHealth != nil { - if err := m.BackupHealth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupHealth") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateBackupModeType(formats strfmt.Registry) error { - - if err := validate.Required("backupModeType", "body", m.BackupModeType); err != nil { - return err - } - - if err := validate.Required("backupModeType", "body", m.BackupModeType); err != nil { - return err - } - - if m.BackupModeType != nil { - if err := m.BackupModeType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupModeType") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateFullBackupMaintenance(formats strfmt.Registry) error { - if swag.IsZero(m.FullBackupMaintenance) { // not required - return nil - } - - if m.FullBackupMaintenance != nil { - if err := m.FullBackupMaintenance.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fullBackupMaintenance") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateNotifications(formats strfmt.Registry) error { - if swag.IsZero(m.Notifications) { // not required - return nil - } - - if m.Notifications != nil { - if err := m.Notifications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("notifications") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateScripts(formats strfmt.Registry) error { - if swag.IsZero(m.Scripts) { // not required - return nil - } - - if m.Scripts != nil { - if err := m.Scripts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("scripts") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateStorageData(formats strfmt.Registry) error { - if swag.IsZero(m.StorageData) { // not required - return nil - } - - if m.StorageData != nil { - if err := m.StorageData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageData") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateStorageIntegration(formats strfmt.Registry) error { - if swag.IsZero(m.StorageIntegration) { // not required - return nil - } - - if m.StorageIntegration != nil { - if err := m.StorageIntegration.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageIntegration") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateSynthenticFulls(formats strfmt.Registry) error { - if swag.IsZero(m.SynthenticFulls) { // not required - return nil - } - - if m.SynthenticFulls != nil { - if err := m.SynthenticFulls.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("synthenticFulls") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) validateVSphere(formats strfmt.Registry) error { - if swag.IsZero(m.VSphere) { // not required - return nil - } - - if m.VSphere != nil { - if err := m.VSphere.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vSphere") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job advanced settings model based on the context it is used -func (m *BackupJobAdvancedSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateActiveFulls(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupHealth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupModeType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFullBackupMaintenance(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNotifications(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateScripts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageIntegration(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSynthenticFulls(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVSphere(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateActiveFulls(ctx context.Context, formats strfmt.Registry) error { - - if m.ActiveFulls != nil { - if err := m.ActiveFulls.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("activeFulls") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateBackupHealth(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupHealth != nil { - if err := m.BackupHealth.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupHealth") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateBackupModeType(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupModeType != nil { - if err := m.BackupModeType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupModeType") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateFullBackupMaintenance(ctx context.Context, formats strfmt.Registry) error { - - if m.FullBackupMaintenance != nil { - if err := m.FullBackupMaintenance.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fullBackupMaintenance") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateNotifications(ctx context.Context, formats strfmt.Registry) error { - - if m.Notifications != nil { - if err := m.Notifications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("notifications") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateScripts(ctx context.Context, formats strfmt.Registry) error { - - if m.Scripts != nil { - if err := m.Scripts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("scripts") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateStorageData(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageData != nil { - if err := m.StorageData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageData") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateStorageIntegration(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageIntegration != nil { - if err := m.StorageIntegration.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageIntegration") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateSynthenticFulls(ctx context.Context, formats strfmt.Registry) error { - - if m.SynthenticFulls != nil { - if err := m.SynthenticFulls.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("synthenticFulls") - } - return err - } - } - - return nil -} - -func (m *BackupJobAdvancedSettingsModel) contextValidateVSphere(ctx context.Context, formats strfmt.Registry) error { - - if m.VSphere != nil { - if err := m.VSphere.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vSphere") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobAdvancedSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobAdvancedSettingsModel) UnmarshalBinary(b []byte) error { - var res BackupJobAdvancedSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_advanced_settings_v_sphere_model.go b/models/backup_job_advanced_settings_v_sphere_model.go deleted file mode 100644 index f5a779d..0000000 --- a/models/backup_job_advanced_settings_v_sphere_model.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BackupJobAdvancedSettingsVSphereModel VMware vSphere settings for the backup job. -// -// swagger:model BackupJobAdvancedSettingsVSphereModel -type BackupJobAdvancedSettingsVSphereModel struct { - - // changed block tracking - ChangedBlockTracking *VSphereChangedBlockTrackingSettingsModel `json:"changedBlockTracking,omitempty"` - - // If *true*, VMware Tools quiescence is enabled for freezing the VM file system and application data. - EnableVMWareToolsQuiescence bool `json:"enableVMWareToolsQuiescence,omitempty"` -} - -// Validate validates this backup job advanced settings v sphere model -func (m *BackupJobAdvancedSettingsVSphereModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateChangedBlockTracking(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobAdvancedSettingsVSphereModel) validateChangedBlockTracking(formats strfmt.Registry) error { - if swag.IsZero(m.ChangedBlockTracking) { // not required - return nil - } - - if m.ChangedBlockTracking != nil { - if err := m.ChangedBlockTracking.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("changedBlockTracking") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job advanced settings v sphere model based on the context it is used -func (m *BackupJobAdvancedSettingsVSphereModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateChangedBlockTracking(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobAdvancedSettingsVSphereModel) contextValidateChangedBlockTracking(ctx context.Context, formats strfmt.Registry) error { - - if m.ChangedBlockTracking != nil { - if err := m.ChangedBlockTracking.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("changedBlockTracking") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobAdvancedSettingsVSphereModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobAdvancedSettingsVSphereModel) UnmarshalBinary(b []byte) error { - var res BackupJobAdvancedSettingsVSphereModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_exclusions.go b/models/backup_job_exclusions.go deleted file mode 100644 index 95f767f..0000000 --- a/models/backup_job_exclusions.go +++ /dev/null @@ -1,207 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BackupJobExclusions backup job exclusions -// -// swagger:model BackupJobExclusions -type BackupJobExclusions struct { - - // Array of VM disks excluded from the backup. - Disks []*VmwareObjectDiskModel `json:"disks"` - - // Array of VM templates excluded from the backup. OUTSIDE - Templates *BackupJobExclusionsTemplates `json:"templates,omitempty"` - - // Array of VMs excluded from the backup. - Vms []*VmwareObjectSizeModel `json:"vms"` -} - -// Validate validates this backup job exclusions -func (m *BackupJobExclusions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTemplates(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVms(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobExclusions) validateDisks(formats strfmt.Registry) error { - if swag.IsZero(m.Disks) { // not required - return nil - } - - for i := 0; i < len(m.Disks); i++ { - if swag.IsZero(m.Disks[i]) { // not required - continue - } - - if m.Disks[i] != nil { - if err := m.Disks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupJobExclusions) validateTemplates(formats strfmt.Registry) error { - if swag.IsZero(m.Templates) { // not required - return nil - } - - if m.Templates != nil { - if err := m.Templates.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("templates") - } - return err - } - } - - return nil -} - -func (m *BackupJobExclusions) validateVms(formats strfmt.Registry) error { - if swag.IsZero(m.Vms) { // not required - return nil - } - - for i := 0; i < len(m.Vms); i++ { - if swag.IsZero(m.Vms[i]) { // not required - continue - } - - if m.Vms[i] != nil { - if err := m.Vms[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vms" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this backup job exclusions based on the context it is used -func (m *BackupJobExclusions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDisks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTemplates(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVms(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobExclusions) contextValidateDisks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Disks); i++ { - - if m.Disks[i] != nil { - if err := m.Disks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupJobExclusions) contextValidateTemplates(ctx context.Context, formats strfmt.Registry) error { - - if m.Templates != nil { - if err := m.Templates.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("templates") - } - return err - } - } - - return nil -} - -func (m *BackupJobExclusions) contextValidateVms(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Vms); i++ { - - if m.Vms[i] != nil { - if err := m.Vms[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vms" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobExclusions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobExclusions) UnmarshalBinary(b []byte) error { - var res BackupJobExclusions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_exclusions_spec.go b/models/backup_job_exclusions_spec.go deleted file mode 100644 index f846f81..0000000 --- a/models/backup_job_exclusions_spec.go +++ /dev/null @@ -1,207 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BackupJobExclusionsSpec backup job exclusions spec -// -// swagger:model BackupJobExclusionsSpec -type BackupJobExclusionsSpec struct { - - // disks - Disks []*VmwareObjectDiskModel `json:"disks"` - - // templates - Templates *BackupJobExclusionsTemplates `json:"templates,omitempty"` - - // vms - Vms []*VmwareObjectModel `json:"vms"` -} - -// Validate validates this backup job exclusions spec -func (m *BackupJobExclusionsSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTemplates(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVms(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobExclusionsSpec) validateDisks(formats strfmt.Registry) error { - if swag.IsZero(m.Disks) { // not required - return nil - } - - for i := 0; i < len(m.Disks); i++ { - if swag.IsZero(m.Disks[i]) { // not required - continue - } - - if m.Disks[i] != nil { - if err := m.Disks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupJobExclusionsSpec) validateTemplates(formats strfmt.Registry) error { - if swag.IsZero(m.Templates) { // not required - return nil - } - - if m.Templates != nil { - if err := m.Templates.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("templates") - } - return err - } - } - - return nil -} - -func (m *BackupJobExclusionsSpec) validateVms(formats strfmt.Registry) error { - if swag.IsZero(m.Vms) { // not required - return nil - } - - for i := 0; i < len(m.Vms); i++ { - if swag.IsZero(m.Vms[i]) { // not required - continue - } - - if m.Vms[i] != nil { - if err := m.Vms[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vms" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this backup job exclusions spec based on the context it is used -func (m *BackupJobExclusionsSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDisks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTemplates(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVms(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobExclusionsSpec) contextValidateDisks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Disks); i++ { - - if m.Disks[i] != nil { - if err := m.Disks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupJobExclusionsSpec) contextValidateTemplates(ctx context.Context, formats strfmt.Registry) error { - - if m.Templates != nil { - if err := m.Templates.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("templates") - } - return err - } - } - - return nil -} - -func (m *BackupJobExclusionsSpec) contextValidateVms(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Vms); i++ { - - if m.Vms[i] != nil { - if err := m.Vms[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vms" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobExclusionsSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobExclusionsSpec) UnmarshalBinary(b []byte) error { - var res BackupJobExclusionsSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_exclusions_templates.go b/models/backup_job_exclusions_templates.go deleted file mode 100644 index 00e6fd1..0000000 --- a/models/backup_job_exclusions_templates.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BackupJobExclusionsTemplates Array of VM templates excluded from the backup. -// -// swagger:model BackupJobExclusionsTemplates -type BackupJobExclusionsTemplates struct { - - // If *true*, the template is excluded from the incremental backup. - ExcludeFromIncremental bool `json:"excludeFromIncremental,omitempty"` - - // If *true*, the template is included into the backup. - IsEnabled bool `json:"isEnabled,omitempty"` -} - -// Validate validates this backup job exclusions templates -func (m *BackupJobExclusionsTemplates) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this backup job exclusions templates based on context it is used -func (m *BackupJobExclusionsTemplates) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobExclusionsTemplates) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobExclusionsTemplates) UnmarshalBinary(b []byte) error { - var res BackupJobExclusionsTemplates - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_guest_processing_import_model.go b/models/backup_job_guest_processing_import_model.go deleted file mode 100644 index 6baecca..0000000 --- a/models/backup_job_guest_processing_import_model.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobGuestProcessingImportModel Guest processing settings. -// -// swagger:model BackupJobGuestProcessingImportModel -type BackupJobGuestProcessingImportModel struct { - - // application aware processing - // Required: true - ApplicationAwareProcessing *BackupApplicationAwareProcessingImportModel `json:"applicationAwareProcessing"` - - // guest credentials - GuestCredentials *GuestOsCredentialsImportModel `json:"guestCredentials,omitempty"` - - // guest file system indexing - // Required: true - GuestFileSystemIndexing *GuestFileSystemIndexingModel `json:"guestFileSystemIndexing"` - - // guest interaction proxies - GuestInteractionProxies *GuestInteractionProxiesSettingsImportModel `json:"guestInteractionProxies,omitempty"` -} - -// Validate validates this backup job guest processing import model -func (m *BackupJobGuestProcessingImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApplicationAwareProcessing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestCredentials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestFileSystemIndexing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestInteractionProxies(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobGuestProcessingImportModel) validateApplicationAwareProcessing(formats strfmt.Registry) error { - - if err := validate.Required("applicationAwareProcessing", "body", m.ApplicationAwareProcessing); err != nil { - return err - } - - if m.ApplicationAwareProcessing != nil { - if err := m.ApplicationAwareProcessing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("applicationAwareProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingImportModel) validateGuestCredentials(formats strfmt.Registry) error { - if swag.IsZero(m.GuestCredentials) { // not required - return nil - } - - if m.GuestCredentials != nil { - if err := m.GuestCredentials.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestCredentials") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingImportModel) validateGuestFileSystemIndexing(formats strfmt.Registry) error { - - if err := validate.Required("guestFileSystemIndexing", "body", m.GuestFileSystemIndexing); err != nil { - return err - } - - if m.GuestFileSystemIndexing != nil { - if err := m.GuestFileSystemIndexing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestFileSystemIndexing") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingImportModel) validateGuestInteractionProxies(formats strfmt.Registry) error { - if swag.IsZero(m.GuestInteractionProxies) { // not required - return nil - } - - if m.GuestInteractionProxies != nil { - if err := m.GuestInteractionProxies.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestInteractionProxies") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job guest processing import model based on the context it is used -func (m *BackupJobGuestProcessingImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateApplicationAwareProcessing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGuestCredentials(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGuestFileSystemIndexing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGuestInteractionProxies(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobGuestProcessingImportModel) contextValidateApplicationAwareProcessing(ctx context.Context, formats strfmt.Registry) error { - - if m.ApplicationAwareProcessing != nil { - if err := m.ApplicationAwareProcessing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("applicationAwareProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingImportModel) contextValidateGuestCredentials(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestCredentials != nil { - if err := m.GuestCredentials.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestCredentials") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingImportModel) contextValidateGuestFileSystemIndexing(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestFileSystemIndexing != nil { - if err := m.GuestFileSystemIndexing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestFileSystemIndexing") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingImportModel) contextValidateGuestInteractionProxies(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestInteractionProxies != nil { - if err := m.GuestInteractionProxies.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestInteractionProxies") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobGuestProcessingImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobGuestProcessingImportModel) UnmarshalBinary(b []byte) error { - var res BackupJobGuestProcessingImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_guest_processing_model.go b/models/backup_job_guest_processing_model.go deleted file mode 100644 index b7c9000..0000000 --- a/models/backup_job_guest_processing_model.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobGuestProcessingModel Guest processing settings. -// -// swagger:model BackupJobGuestProcessingModel -type BackupJobGuestProcessingModel struct { - - // app aware processing - // Required: true - AppAwareProcessing *BackupApplicationAwareProcessingModel `json:"appAwareProcessing"` - - // guest credentials - GuestCredentials *GuestOsCredentialsModel `json:"guestCredentials,omitempty"` - - // guest f s indexing - // Required: true - GuestFSIndexing *GuestFileSystemIndexingModel `json:"guestFSIndexing"` - - // guest interaction proxies - GuestInteractionProxies *GuestInteractionProxiesSettingsModel `json:"guestInteractionProxies,omitempty"` -} - -// Validate validates this backup job guest processing model -func (m *BackupJobGuestProcessingModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppAwareProcessing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestCredentials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestFSIndexing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestInteractionProxies(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobGuestProcessingModel) validateAppAwareProcessing(formats strfmt.Registry) error { - - if err := validate.Required("appAwareProcessing", "body", m.AppAwareProcessing); err != nil { - return err - } - - if m.AppAwareProcessing != nil { - if err := m.AppAwareProcessing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appAwareProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingModel) validateGuestCredentials(formats strfmt.Registry) error { - if swag.IsZero(m.GuestCredentials) { // not required - return nil - } - - if m.GuestCredentials != nil { - if err := m.GuestCredentials.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestCredentials") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingModel) validateGuestFSIndexing(formats strfmt.Registry) error { - - if err := validate.Required("guestFSIndexing", "body", m.GuestFSIndexing); err != nil { - return err - } - - if m.GuestFSIndexing != nil { - if err := m.GuestFSIndexing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestFSIndexing") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingModel) validateGuestInteractionProxies(formats strfmt.Registry) error { - if swag.IsZero(m.GuestInteractionProxies) { // not required - return nil - } - - if m.GuestInteractionProxies != nil { - if err := m.GuestInteractionProxies.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestInteractionProxies") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job guest processing model based on the context it is used -func (m *BackupJobGuestProcessingModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppAwareProcessing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGuestCredentials(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGuestFSIndexing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGuestInteractionProxies(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobGuestProcessingModel) contextValidateAppAwareProcessing(ctx context.Context, formats strfmt.Registry) error { - - if m.AppAwareProcessing != nil { - if err := m.AppAwareProcessing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appAwareProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingModel) contextValidateGuestCredentials(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestCredentials != nil { - if err := m.GuestCredentials.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestCredentials") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingModel) contextValidateGuestFSIndexing(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestFSIndexing != nil { - if err := m.GuestFSIndexing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestFSIndexing") - } - return err - } - } - - return nil -} - -func (m *BackupJobGuestProcessingModel) contextValidateGuestInteractionProxies(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestInteractionProxies != nil { - if err := m.GuestInteractionProxies.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestInteractionProxies") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobGuestProcessingModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobGuestProcessingModel) UnmarshalBinary(b []byte) error { - var res BackupJobGuestProcessingModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_import_proxies_model.go b/models/backup_job_import_proxies_model.go deleted file mode 100644 index 4c50396..0000000 --- a/models/backup_job_import_proxies_model.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobImportProxiesModel Backup proxies. -// -// swagger:model BackupJobImportProxiesModel -type BackupJobImportProxiesModel struct { - - // If *true*, backup proxies are detected and assigned automatically. - // Required: true - AutomaticSelection bool `json:"automaticSelection"` - - // Array of backup proxies. - Proxies []*BackupProxyImportModel `json:"proxies"` -} - -// Validate validates this backup job import proxies model -func (m *BackupJobImportProxiesModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAutomaticSelection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProxies(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobImportProxiesModel) validateAutomaticSelection(formats strfmt.Registry) error { - - if err := validate.Required("automaticSelection", "body", bool(m.AutomaticSelection)); err != nil { - return err - } - - return nil -} - -func (m *BackupJobImportProxiesModel) validateProxies(formats strfmt.Registry) error { - if swag.IsZero(m.Proxies) { // not required - return nil - } - - for i := 0; i < len(m.Proxies); i++ { - if swag.IsZero(m.Proxies[i]) { // not required - continue - } - - if m.Proxies[i] != nil { - if err := m.Proxies[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proxies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this backup job import proxies model based on the context it is used -func (m *BackupJobImportProxiesModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateProxies(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobImportProxiesModel) contextValidateProxies(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Proxies); i++ { - - if m.Proxies[i] != nil { - if err := m.Proxies[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proxies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobImportProxiesModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobImportProxiesModel) UnmarshalBinary(b []byte) error { - var res BackupJobImportProxiesModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_model.go b/models/backup_job_model.go deleted file mode 100644 index 29189a4..0000000 --- a/models/backup_job_model.go +++ /dev/null @@ -1,340 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobModel backup job model -// -// swagger:model BackupJobModel -type BackupJobModel struct { - JobModel - - // guest processing - // Required: true - GuestProcessing *BackupJobGuestProcessingModel `json:"guestProcessing"` - - // If *true*, the job has a high priority in getting backup infrastructure resources. - // Required: true - IsHighPriority *bool `json:"isHighPriority"` - - // schedule - // Required: true - Schedule *BackupScheduleModel `json:"schedule"` - - // storage - // Required: true - Storage *BackupJobStorageModel `json:"storage"` - - // virtual machines - // Required: true - VirtualMachines *BackupJobVirtualMachinesModel `json:"virtualMachines"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *BackupJobModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 JobModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.JobModel = aO0 - - // AO1 - var dataAO1 struct { - GuestProcessing *BackupJobGuestProcessingModel `json:"guestProcessing"` - - IsHighPriority *bool `json:"isHighPriority"` - - Schedule *BackupScheduleModel `json:"schedule"` - - Storage *BackupJobStorageModel `json:"storage"` - - VirtualMachines *BackupJobVirtualMachinesModel `json:"virtualMachines"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.GuestProcessing = dataAO1.GuestProcessing - - m.IsHighPriority = dataAO1.IsHighPriority - - m.Schedule = dataAO1.Schedule - - m.Storage = dataAO1.Storage - - m.VirtualMachines = dataAO1.VirtualMachines - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m BackupJobModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.JobModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - GuestProcessing *BackupJobGuestProcessingModel `json:"guestProcessing"` - - IsHighPriority *bool `json:"isHighPriority"` - - Schedule *BackupScheduleModel `json:"schedule"` - - Storage *BackupJobStorageModel `json:"storage"` - - VirtualMachines *BackupJobVirtualMachinesModel `json:"virtualMachines"` - } - - dataAO1.GuestProcessing = m.GuestProcessing - - dataAO1.IsHighPriority = m.IsHighPriority - - dataAO1.Schedule = m.Schedule - - dataAO1.Storage = m.Storage - - dataAO1.VirtualMachines = m.VirtualMachines - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this backup job model -func (m *BackupJobModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with JobModel - if err := m.JobModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestProcessing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsHighPriority(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSchedule(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualMachines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobModel) validateGuestProcessing(formats strfmt.Registry) error { - - if err := validate.Required("guestProcessing", "body", m.GuestProcessing); err != nil { - return err - } - - if m.GuestProcessing != nil { - if err := m.GuestProcessing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupJobModel) validateIsHighPriority(formats strfmt.Registry) error { - - if err := validate.Required("isHighPriority", "body", m.IsHighPriority); err != nil { - return err - } - - return nil -} - -func (m *BackupJobModel) validateSchedule(formats strfmt.Registry) error { - - if err := validate.Required("schedule", "body", m.Schedule); err != nil { - return err - } - - if m.Schedule != nil { - if err := m.Schedule.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schedule") - } - return err - } - } - - return nil -} - -func (m *BackupJobModel) validateStorage(formats strfmt.Registry) error { - - if err := validate.Required("storage", "body", m.Storage); err != nil { - return err - } - - if m.Storage != nil { - if err := m.Storage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storage") - } - return err - } - } - - return nil -} - -func (m *BackupJobModel) validateVirtualMachines(formats strfmt.Registry) error { - - if err := validate.Required("virtualMachines", "body", m.VirtualMachines); err != nil { - return err - } - - if m.VirtualMachines != nil { - if err := m.VirtualMachines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualMachines") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job model based on the context it is used -func (m *BackupJobModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with JobModel - if err := m.JobModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGuestProcessing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSchedule(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorage(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualMachines(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobModel) contextValidateGuestProcessing(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestProcessing != nil { - if err := m.GuestProcessing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupJobModel) contextValidateSchedule(ctx context.Context, formats strfmt.Registry) error { - - if m.Schedule != nil { - if err := m.Schedule.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schedule") - } - return err - } - } - - return nil -} - -func (m *BackupJobModel) contextValidateStorage(ctx context.Context, formats strfmt.Registry) error { - - if m.Storage != nil { - if err := m.Storage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storage") - } - return err - } - } - - return nil -} - -func (m *BackupJobModel) contextValidateVirtualMachines(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualMachines != nil { - if err := m.VirtualMachines.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualMachines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobModel) UnmarshalBinary(b []byte) error { - var res BackupJobModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_retention_policy_settings_model.go b/models/backup_job_retention_policy_settings_model.go deleted file mode 100644 index 2513aed..0000000 --- a/models/backup_job_retention_policy_settings_model.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobRetentionPolicySettingsModel Retention policy settings. -// -// swagger:model BackupJobRetentionPolicySettingsModel -type BackupJobRetentionPolicySettingsModel struct { - - // Number of restore points or days to keep. - // Required: true - Quantity *int64 `json:"quantity"` - - // type - // Required: true - Type *ERetentionPolicyType `json:"type"` -} - -// Validate validates this backup job retention policy settings model -func (m *BackupJobRetentionPolicySettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateQuantity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobRetentionPolicySettingsModel) validateQuantity(formats strfmt.Registry) error { - - if err := validate.Required("quantity", "body", m.Quantity); err != nil { - return err - } - - return nil -} - -func (m *BackupJobRetentionPolicySettingsModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job retention policy settings model based on the context it is used -func (m *BackupJobRetentionPolicySettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobRetentionPolicySettingsModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobRetentionPolicySettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobRetentionPolicySettingsModel) UnmarshalBinary(b []byte) error { - var res BackupJobRetentionPolicySettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_spec.go b/models/backup_job_spec.go deleted file mode 100644 index e84f061..0000000 --- a/models/backup_job_spec.go +++ /dev/null @@ -1,340 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobSpec backup job spec -// -// swagger:model BackupJobSpec -type BackupJobSpec struct { - JobSpec - - // guest processing - // Required: true - GuestProcessing *BackupJobGuestProcessingModel `json:"guestProcessing"` - - // If *true*, the job has a high priority in getting backup infrastructure resources. - // Required: true - IsHighPriority bool `json:"isHighPriority"` - - // schedule - // Required: true - Schedule *BackupScheduleModel `json:"schedule"` - - // storage - // Required: true - Storage *BackupJobStorageModel `json:"storage"` - - // virtual machines - // Required: true - VirtualMachines *BackupJobVirtualMachinesSpec `json:"virtualMachines"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *BackupJobSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 JobSpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.JobSpec = aO0 - - // AO1 - var dataAO1 struct { - GuestProcessing *BackupJobGuestProcessingModel `json:"guestProcessing"` - - IsHighPriority bool `json:"isHighPriority"` - - Schedule *BackupScheduleModel `json:"schedule"` - - Storage *BackupJobStorageModel `json:"storage"` - - VirtualMachines *BackupJobVirtualMachinesSpec `json:"virtualMachines"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.GuestProcessing = dataAO1.GuestProcessing - - m.IsHighPriority = dataAO1.IsHighPriority - - m.Schedule = dataAO1.Schedule - - m.Storage = dataAO1.Storage - - m.VirtualMachines = dataAO1.VirtualMachines - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m BackupJobSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.JobSpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - GuestProcessing *BackupJobGuestProcessingModel `json:"guestProcessing"` - - IsHighPriority bool `json:"isHighPriority"` - - Schedule *BackupScheduleModel `json:"schedule"` - - Storage *BackupJobStorageModel `json:"storage"` - - VirtualMachines *BackupJobVirtualMachinesSpec `json:"virtualMachines"` - } - - dataAO1.GuestProcessing = m.GuestProcessing - - dataAO1.IsHighPriority = m.IsHighPriority - - dataAO1.Schedule = m.Schedule - - dataAO1.Storage = m.Storage - - dataAO1.VirtualMachines = m.VirtualMachines - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this backup job spec -func (m *BackupJobSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with JobSpec - if err := m.JobSpec.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestProcessing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsHighPriority(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSchedule(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualMachines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobSpec) validateGuestProcessing(formats strfmt.Registry) error { - - if err := validate.Required("guestProcessing", "body", m.GuestProcessing); err != nil { - return err - } - - if m.GuestProcessing != nil { - if err := m.GuestProcessing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupJobSpec) validateIsHighPriority(formats strfmt.Registry) error { - - if err := validate.Required("isHighPriority", "body", bool(m.IsHighPriority)); err != nil { - return err - } - - return nil -} - -func (m *BackupJobSpec) validateSchedule(formats strfmt.Registry) error { - - if err := validate.Required("schedule", "body", m.Schedule); err != nil { - return err - } - - if m.Schedule != nil { - if err := m.Schedule.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schedule") - } - return err - } - } - - return nil -} - -func (m *BackupJobSpec) validateStorage(formats strfmt.Registry) error { - - if err := validate.Required("storage", "body", m.Storage); err != nil { - return err - } - - if m.Storage != nil { - if err := m.Storage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storage") - } - return err - } - } - - return nil -} - -func (m *BackupJobSpec) validateVirtualMachines(formats strfmt.Registry) error { - - if err := validate.Required("virtualMachines", "body", m.VirtualMachines); err != nil { - return err - } - - if m.VirtualMachines != nil { - if err := m.VirtualMachines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualMachines") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job spec based on the context it is used -func (m *BackupJobSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with JobSpec - if err := m.JobSpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGuestProcessing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSchedule(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorage(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualMachines(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobSpec) contextValidateGuestProcessing(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestProcessing != nil { - if err := m.GuestProcessing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupJobSpec) contextValidateSchedule(ctx context.Context, formats strfmt.Registry) error { - - if m.Schedule != nil { - if err := m.Schedule.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schedule") - } - return err - } - } - - return nil -} - -func (m *BackupJobSpec) contextValidateStorage(ctx context.Context, formats strfmt.Registry) error { - - if m.Storage != nil { - if err := m.Storage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storage") - } - return err - } - } - - return nil -} - -func (m *BackupJobSpec) contextValidateVirtualMachines(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualMachines != nil { - if err := m.VirtualMachines.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualMachines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobSpec) UnmarshalBinary(b []byte) error { - var res BackupJobSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_storage_import_model.go b/models/backup_job_storage_import_model.go deleted file mode 100644 index da64ca6..0000000 --- a/models/backup_job_storage_import_model.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobStorageImportModel Backup storage settings. -// -// swagger:model BackupJobStorageImportModel -type BackupJobStorageImportModel struct { - - // advanced settings - AdvancedSettings *BackupJobAdvancedSettingsModel `json:"advancedSettings,omitempty"` - - // backup proxies - // Required: true - BackupProxies *BackupJobImportProxiesModel `json:"backupProxies"` - - // backup repository - // Required: true - BackupRepository *BackupRepositoryImportModel `json:"backupRepository"` - - // gfs policy - GfsPolicy *GFSPolicySettingsModel `json:"gfsPolicy,omitempty"` - - // retention policy - // Required: true - RetentionPolicy *BackupJobRetentionPolicySettingsModel `json:"retentionPolicy"` -} - -// Validate validates this backup job storage import model -func (m *BackupJobStorageImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdvancedSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupProxies(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGfsPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRetentionPolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobStorageImportModel) validateAdvancedSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AdvancedSettings) { // not required - return nil - } - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageImportModel) validateBackupProxies(formats strfmt.Registry) error { - - if err := validate.Required("backupProxies", "body", m.BackupProxies); err != nil { - return err - } - - if m.BackupProxies != nil { - if err := m.BackupProxies.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupProxies") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageImportModel) validateBackupRepository(formats strfmt.Registry) error { - - if err := validate.Required("backupRepository", "body", m.BackupRepository); err != nil { - return err - } - - if m.BackupRepository != nil { - if err := m.BackupRepository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupRepository") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageImportModel) validateGfsPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.GfsPolicy) { // not required - return nil - } - - if m.GfsPolicy != nil { - if err := m.GfsPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gfsPolicy") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageImportModel) validateRetentionPolicy(formats strfmt.Registry) error { - - if err := validate.Required("retentionPolicy", "body", m.RetentionPolicy); err != nil { - return err - } - - if m.RetentionPolicy != nil { - if err := m.RetentionPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retentionPolicy") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job storage import model based on the context it is used -func (m *BackupJobStorageImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvancedSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupProxies(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGfsPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRetentionPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobStorageImportModel) contextValidateAdvancedSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageImportModel) contextValidateBackupProxies(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupProxies != nil { - if err := m.BackupProxies.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupProxies") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageImportModel) contextValidateBackupRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupRepository != nil { - if err := m.BackupRepository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupRepository") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageImportModel) contextValidateGfsPolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.GfsPolicy != nil { - if err := m.GfsPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gfsPolicy") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageImportModel) contextValidateRetentionPolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.RetentionPolicy != nil { - if err := m.RetentionPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retentionPolicy") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobStorageImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobStorageImportModel) UnmarshalBinary(b []byte) error { - var res BackupJobStorageImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_storage_model.go b/models/backup_job_storage_model.go deleted file mode 100644 index 5fda76a..0000000 --- a/models/backup_job_storage_model.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobStorageModel Backup storage settings. -// -// swagger:model BackupJobStorageModel -type BackupJobStorageModel struct { - - // advanced settings - AdvancedSettings *BackupJobAdvancedSettingsModel `json:"advancedSettings,omitempty"` - - // backup proxies - // Required: true - BackupProxies *BackupProxiesSettingsModel `json:"backupProxies"` - - // ID of the backup repository. - // Required: true - // Format: uuid - BackupRepositoryID *strfmt.UUID `json:"backupRepositoryId"` - - // gfs policy - GfsPolicy *GFSPolicySettingsModel `json:"gfsPolicy,omitempty"` - - // retention policy - // Required: true - RetentionPolicy *BackupJobRetentionPolicySettingsModel `json:"retentionPolicy"` -} - -// Validate validates this backup job storage model -func (m *BackupJobStorageModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdvancedSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupProxies(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupRepositoryID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGfsPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRetentionPolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobStorageModel) validateAdvancedSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AdvancedSettings) { // not required - return nil - } - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageModel) validateBackupProxies(formats strfmt.Registry) error { - - if err := validate.Required("backupProxies", "body", m.BackupProxies); err != nil { - return err - } - - if m.BackupProxies != nil { - if err := m.BackupProxies.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupProxies") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageModel) validateBackupRepositoryID(formats strfmt.Registry) error { - - if err := validate.Required("backupRepositoryId", "body", m.BackupRepositoryID); err != nil { - return err - } - - if err := validate.FormatOf("backupRepositoryId", "body", "uuid", m.BackupRepositoryID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupJobStorageModel) validateGfsPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.GfsPolicy) { // not required - return nil - } - - if m.GfsPolicy != nil { - if err := m.GfsPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gfsPolicy") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageModel) validateRetentionPolicy(formats strfmt.Registry) error { - - if err := validate.Required("retentionPolicy", "body", m.RetentionPolicy); err != nil { - return err - } - - if m.RetentionPolicy != nil { - if err := m.RetentionPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retentionPolicy") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup job storage model based on the context it is used -func (m *BackupJobStorageModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvancedSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupProxies(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGfsPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRetentionPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobStorageModel) contextValidateAdvancedSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageModel) contextValidateBackupProxies(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupProxies != nil { - if err := m.BackupProxies.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupProxies") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageModel) contextValidateGfsPolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.GfsPolicy != nil { - if err := m.GfsPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gfsPolicy") - } - return err - } - } - - return nil -} - -func (m *BackupJobStorageModel) contextValidateRetentionPolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.RetentionPolicy != nil { - if err := m.RetentionPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retentionPolicy") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobStorageModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobStorageModel) UnmarshalBinary(b []byte) error { - var res BackupJobStorageModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_virtual_machines_model.go b/models/backup_job_virtual_machines_model.go deleted file mode 100644 index d5d5233..0000000 --- a/models/backup_job_virtual_machines_model.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobVirtualMachinesModel backup job virtual machines model -// -// swagger:model BackupJobVirtualMachinesModel -type BackupJobVirtualMachinesModel struct { - - // excludes - Excludes *BackupJobExclusions `json:"excludes,omitempty"` - - // Array of VM and VM containers processed by the job. - // Required: true - Includes []*VmwareObjectSizeModel `json:"includes"` -} - -// Validate validates this backup job virtual machines model -func (m *BackupJobVirtualMachinesModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExcludes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIncludes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobVirtualMachinesModel) validateExcludes(formats strfmt.Registry) error { - if swag.IsZero(m.Excludes) { // not required - return nil - } - - if m.Excludes != nil { - if err := m.Excludes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("excludes") - } - return err - } - } - - return nil -} - -func (m *BackupJobVirtualMachinesModel) validateIncludes(formats strfmt.Registry) error { - - if err := validate.Required("includes", "body", m.Includes); err != nil { - return err - } - - for i := 0; i < len(m.Includes); i++ { - if swag.IsZero(m.Includes[i]) { // not required - continue - } - - if m.Includes[i] != nil { - if err := m.Includes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("includes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this backup job virtual machines model based on the context it is used -func (m *BackupJobVirtualMachinesModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateExcludes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIncludes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobVirtualMachinesModel) contextValidateExcludes(ctx context.Context, formats strfmt.Registry) error { - - if m.Excludes != nil { - if err := m.Excludes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("excludes") - } - return err - } - } - - return nil -} - -func (m *BackupJobVirtualMachinesModel) contextValidateIncludes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Includes); i++ { - - if m.Includes[i] != nil { - if err := m.Includes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("includes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobVirtualMachinesModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobVirtualMachinesModel) UnmarshalBinary(b []byte) error { - var res BackupJobVirtualMachinesModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_job_virtual_machines_spec.go b/models/backup_job_virtual_machines_spec.go deleted file mode 100644 index 2d8e1a2..0000000 --- a/models/backup_job_virtual_machines_spec.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupJobVirtualMachinesSpec backup job virtual machines spec -// -// swagger:model BackupJobVirtualMachinesSpec -type BackupJobVirtualMachinesSpec struct { - - // excludes - Excludes *BackupJobExclusionsSpec `json:"excludes,omitempty"` - - // includes - // Required: true - Includes []*VmwareObjectModel `json:"includes"` -} - -// Validate validates this backup job virtual machines spec -func (m *BackupJobVirtualMachinesSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExcludes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIncludes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobVirtualMachinesSpec) validateExcludes(formats strfmt.Registry) error { - if swag.IsZero(m.Excludes) { // not required - return nil - } - - if m.Excludes != nil { - if err := m.Excludes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("excludes") - } - return err - } - } - - return nil -} - -func (m *BackupJobVirtualMachinesSpec) validateIncludes(formats strfmt.Registry) error { - - if err := validate.Required("includes", "body", m.Includes); err != nil { - return err - } - - for i := 0; i < len(m.Includes); i++ { - if swag.IsZero(m.Includes[i]) { // not required - continue - } - - if m.Includes[i] != nil { - if err := m.Includes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("includes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this backup job virtual machines spec based on the context it is used -func (m *BackupJobVirtualMachinesSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateExcludes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIncludes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupJobVirtualMachinesSpec) contextValidateExcludes(ctx context.Context, formats strfmt.Registry) error { - - if m.Excludes != nil { - if err := m.Excludes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("excludes") - } - return err - } - } - - return nil -} - -func (m *BackupJobVirtualMachinesSpec) contextValidateIncludes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Includes); i++ { - - if m.Includes[i] != nil { - if err := m.Includes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("includes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupJobVirtualMachinesSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupJobVirtualMachinesSpec) UnmarshalBinary(b []byte) error { - var res BackupJobVirtualMachinesSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_linux_script_model.go b/models/backup_linux_script_model.go deleted file mode 100644 index 34af005..0000000 --- a/models/backup_linux_script_model.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BackupLinuxScriptModel Paths to pre-freeze and post-thaw scripts for Linux VMs. -// -// swagger:model BackupLinuxScriptModel -type BackupLinuxScriptModel struct { - - // Path to a post-thaw script. - PostThawScript string `json:"postThawScript,omitempty"` - - // Path to a pre-freeze script. - PreFreezeScript string `json:"preFreezeScript,omitempty"` -} - -// Validate validates this backup linux script model -func (m *BackupLinuxScriptModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this backup linux script model based on context it is used -func (m *BackupLinuxScriptModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BackupLinuxScriptModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupLinuxScriptModel) UnmarshalBinary(b []byte) error { - var res BackupLinuxScriptModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_log_shipping_servers_import_model.go b/models/backup_log_shipping_servers_import_model.go deleted file mode 100644 index 5e57d4d..0000000 --- a/models/backup_log_shipping_servers_import_model.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupLogShippingServersImportModel Log shipping server used to transport logs. -// -// swagger:model BackupLogShippingServersImportModel -type BackupLogShippingServersImportModel struct { - - // If *true*, Veeam Backup & Replication chooses an optimal log shipping server automatically. - // Required: true - AutoSelection *bool `json:"autoSelection"` - - // Array of servers that are explicitly selected for log shipping. - ShippingServerNames []string `json:"shippingServerNames"` -} - -// Validate validates this backup log shipping servers import model -func (m *BackupLogShippingServersImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAutoSelection(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupLogShippingServersImportModel) validateAutoSelection(formats strfmt.Registry) error { - - if err := validate.Required("autoSelection", "body", m.AutoSelection); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this backup log shipping servers import model based on context it is used -func (m *BackupLogShippingServersImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BackupLogShippingServersImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupLogShippingServersImportModel) UnmarshalBinary(b []byte) error { - var res BackupLogShippingServersImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_log_shipping_servers_model.go b/models/backup_log_shipping_servers_model.go deleted file mode 100644 index 22e873a..0000000 --- a/models/backup_log_shipping_servers_model.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupLogShippingServersModel Log shipping server used to transport logs. -// -// swagger:model BackupLogShippingServersModel -type BackupLogShippingServersModel struct { - - // If *true*, Veeam Backup & Replication chooses an optimal log shipping server automatically. - // Required: true - AutoSelection *bool `json:"autoSelection"` - - // Array of servers that are explicitly selected for log shipping. - ShippingServerIds []strfmt.UUID `json:"shippingServerIds"` -} - -// Validate validates this backup log shipping servers model -func (m *BackupLogShippingServersModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAutoSelection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShippingServerIds(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupLogShippingServersModel) validateAutoSelection(formats strfmt.Registry) error { - - if err := validate.Required("autoSelection", "body", m.AutoSelection); err != nil { - return err - } - - return nil -} - -func (m *BackupLogShippingServersModel) validateShippingServerIds(formats strfmt.Registry) error { - if swag.IsZero(m.ShippingServerIds) { // not required - return nil - } - - for i := 0; i < len(m.ShippingServerIds); i++ { - - if err := validate.FormatOf("shippingServerIds"+"."+strconv.Itoa(i), "body", "uuid", m.ShippingServerIds[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -// ContextValidate validates this backup log shipping servers model based on context it is used -func (m *BackupLogShippingServersModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BackupLogShippingServersModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupLogShippingServersModel) UnmarshalBinary(b []byte) error { - var res BackupLogShippingServersModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_model.go b/models/backup_model.go deleted file mode 100644 index b8947bf..0000000 --- a/models/backup_model.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupModel backup model -// -// swagger:model BackupModel -type BackupModel struct { - - // Date and time when the backup was created. - // Required: true - // Format: date-time - CreationTime *strfmt.DateTime `json:"creationTime"` - - // ID of the backup. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // ID of the job that created the backup. - // Format: uuid - JobID strfmt.UUID `json:"jobId,omitempty"` - - // Name of the job that created the backup. - // Required: true - Name *string `json:"name"` - - // ID of the platform of the backup resource. - // Required: true - // Format: uuid - PlatformID *strfmt.UUID `json:"platformId"` - - // platform name - // Required: true - PlatformName *EPlatformType `json:"platformName"` - - // Tag that identifies retention policy. - PolicyTag string `json:"policyTag,omitempty"` - - // ID of the backup repository where the backup is stored. - // Required: true - // Format: uuid - RepositoryID *strfmt.UUID `json:"repositoryId"` -} - -// Validate validates this backup model -func (m *BackupModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJobID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepositoryID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupModel) validateCreationTime(formats strfmt.Registry) error { - - if err := validate.Required("creationTime", "body", m.CreationTime); err != nil { - return err - } - - if err := validate.FormatOf("creationTime", "body", "date-time", m.CreationTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupModel) validateJobID(formats strfmt.Registry) error { - if swag.IsZero(m.JobID) { // not required - return nil - } - - if err := validate.FormatOf("jobId", "body", "uuid", m.JobID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *BackupModel) validatePlatformID(formats strfmt.Registry) error { - - if err := validate.Required("platformId", "body", m.PlatformID); err != nil { - return err - } - - if err := validate.FormatOf("platformId", "body", "uuid", m.PlatformID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupModel) validatePlatformName(formats strfmt.Registry) error { - - if err := validate.Required("platformName", "body", m.PlatformName); err != nil { - return err - } - - if err := validate.Required("platformName", "body", m.PlatformName); err != nil { - return err - } - - if m.PlatformName != nil { - if err := m.PlatformName.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformName") - } - return err - } - } - - return nil -} - -func (m *BackupModel) validateRepositoryID(formats strfmt.Registry) error { - - if err := validate.Required("repositoryId", "body", m.RepositoryID); err != nil { - return err - } - - if err := validate.FormatOf("repositoryId", "body", "uuid", m.RepositoryID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backup model based on the context it is used -func (m *BackupModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePlatformName(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupModel) contextValidatePlatformName(ctx context.Context, formats strfmt.Registry) error { - - if m.PlatformName != nil { - if err := m.PlatformName.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformName") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupModel) UnmarshalBinary(b []byte) error { - var res BackupModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_object_indexing_model.go b/models/backup_object_indexing_model.go deleted file mode 100644 index e77184b..0000000 --- a/models/backup_object_indexing_model.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupObjectIndexingModel Guest OS indexing options for the VM. -// -// swagger:model BackupObjectIndexingModel -type BackupObjectIndexingModel struct { - - // guest f s indexing mode - // Required: true - GuestFSIndexingMode *EGuestFSIndexingMode `json:"guestFSIndexingMode"` - - // Array of folders. Environmental variables and full paths to folders can be used. - IndexingList []string `json:"indexingList"` -} - -// Validate validates this backup object indexing model -func (m *BackupObjectIndexingModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGuestFSIndexingMode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupObjectIndexingModel) validateGuestFSIndexingMode(formats strfmt.Registry) error { - - if err := validate.Required("guestFSIndexingMode", "body", m.GuestFSIndexingMode); err != nil { - return err - } - - if err := validate.Required("guestFSIndexingMode", "body", m.GuestFSIndexingMode); err != nil { - return err - } - - if m.GuestFSIndexingMode != nil { - if err := m.GuestFSIndexingMode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestFSIndexingMode") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup object indexing model based on the context it is used -func (m *BackupObjectIndexingModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGuestFSIndexingMode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupObjectIndexingModel) contextValidateGuestFSIndexingMode(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestFSIndexingMode != nil { - if err := m.GuestFSIndexingMode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestFSIndexingMode") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupObjectIndexingModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupObjectIndexingModel) UnmarshalBinary(b []byte) error { - var res BackupObjectIndexingModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_object_model.go b/models/backup_object_model.go deleted file mode 100644 index 142c536..0000000 --- a/models/backup_object_model.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupObjectModel backup object model -// -// swagger:model BackupObjectModel -type BackupObjectModel struct { - - // ID of the object. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name of the object. - Name string `json:"name,omitempty"` - - // Id of the platform where the object was created. - // Format: uuid - PlatformID strfmt.UUID `json:"platformId,omitempty"` - - // platform name - // Required: true - PlatformName *EPlatformType `json:"platformName"` - - // Number of restore points. - RestorePointsCount int64 `json:"restorePointsCount,omitempty"` - - // Type of the object. - Type string `json:"type,omitempty"` -} - -// Validate validates this backup object model -func (m *BackupObjectModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupObjectModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupObjectModel) validatePlatformID(formats strfmt.Registry) error { - if swag.IsZero(m.PlatformID) { // not required - return nil - } - - if err := validate.FormatOf("platformId", "body", "uuid", m.PlatformID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupObjectModel) validatePlatformName(formats strfmt.Registry) error { - - if err := validate.Required("platformName", "body", m.PlatformName); err != nil { - return err - } - - if err := validate.Required("platformName", "body", m.PlatformName); err != nil { - return err - } - - if m.PlatformName != nil { - if err := m.PlatformName.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformName") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup object model based on the context it is used -func (m *BackupObjectModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePlatformName(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupObjectModel) contextValidatePlatformName(ctx context.Context, formats strfmt.Registry) error { - - if m.PlatformName != nil { - if err := m.PlatformName.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformName") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupObjectModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupObjectModel) UnmarshalBinary(b []byte) error { - var res BackupObjectModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_objects_filters.go b/models/backup_objects_filters.go deleted file mode 100644 index 68e623d..0000000 --- a/models/backup_objects_filters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupObjectsFilters backup objects filters -// -// swagger:model BackupObjectsFilters -type BackupObjectsFilters struct { - - // limit - Limit int32 `json:"limit,omitempty"` - - // name filter - NameFilter string `json:"nameFilter,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EBackupObjectsFiltersOrderColumn `json:"orderColumn,omitempty"` - - // platform Id filter - // Format: uuid - PlatformIDFilter strfmt.UUID `json:"platformIdFilter,omitempty"` - - // platform name filter - PlatformNameFilter EPlatformType `json:"platformNameFilter,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` - - // type filter - TypeFilter string `json:"typeFilter,omitempty"` - - // vi type filter - ViTypeFilter string `json:"viTypeFilter,omitempty"` -} - -// Validate validates this backup objects filters -func (m *BackupObjectsFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformNameFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupObjectsFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *BackupObjectsFilters) validatePlatformIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.PlatformIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("platformIdFilter", "body", "uuid", m.PlatformIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupObjectsFilters) validatePlatformNameFilter(formats strfmt.Registry) error { - if swag.IsZero(m.PlatformNameFilter) { // not required - return nil - } - - if err := m.PlatformNameFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformNameFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this backup objects filters based on the context it is used -func (m *BackupObjectsFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePlatformNameFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupObjectsFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *BackupObjectsFilters) contextValidatePlatformNameFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PlatformNameFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformNameFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupObjectsFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupObjectsFilters) UnmarshalBinary(b []byte) error { - var res BackupObjectsFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_objects_result.go b/models/backup_objects_result.go deleted file mode 100644 index 17bf31d..0000000 --- a/models/backup_objects_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupObjectsResult backup objects result -// -// swagger:model BackupObjectsResult -type BackupObjectsResult struct { - - // Array of backup objects. - // Required: true - Data []*BackupObjectModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this backup objects result -func (m *BackupObjectsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupObjectsResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupObjectsResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup objects result based on the context it is used -func (m *BackupObjectsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupObjectsResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupObjectsResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupObjectsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupObjectsResult) UnmarshalBinary(b []byte) error { - var res BackupObjectsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_oracle_settings_import_model.go b/models/backup_oracle_settings_import_model.go deleted file mode 100644 index 7c776b7..0000000 --- a/models/backup_oracle_settings_import_model.go +++ /dev/null @@ -1,261 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupOracleSettingsImportModel Oracle archived log settings. -// -// swagger:model BackupOracleSettingsImportModel -type BackupOracleSettingsImportModel struct { - - // archive logs - // Required: true - ArchiveLogs *EBackupOracleLogsSettings `json:"archiveLogs"` - - // If *true*, archived logs are backed up. - BackupLogs bool `json:"backupLogs,omitempty"` - - // Frequency of archived log backup, in minutes. - BackupMinsCount int64 `json:"backupMinsCount,omitempty"` - - // credentials - Credentials *CredentialsImportModel `json:"credentials,omitempty"` - - // Maximum size for archived logs in GB. This parameter should be specified if the `EBackupOracleLogsSettings` value is *deleteExpiredGBs*. - DeleteGBsCount int64 `json:"deleteGBsCount,omitempty"` - - // Time period in hours to keep archived logs. This parameter should be specified if the `EBackupOracleLogsSettings` value is *deleteExpiredHours*. - DeleteHoursCount int64 `json:"deleteHoursCount,omitempty"` - - // Number of days to keep archived logs. - KeepDaysCount int64 `json:"keepDaysCount,omitempty"` - - // log shipping servers - LogShippingServers *BackupLogShippingServersImportModel `json:"logShippingServers,omitempty"` - - // retain log backups - RetainLogBackups ERetainLogBackupsType `json:"retainLogBackups,omitempty"` - - // If *true*, Veeam Backup & Replication uses credentials specified in the guest processing settings. - // Required: true - UseGuestCredentials *bool `json:"useGuestCredentials"` -} - -// Validate validates this backup oracle settings import model -func (m *BackupOracleSettingsImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateArchiveLogs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredentials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLogShippingServers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRetainLogBackups(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUseGuestCredentials(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupOracleSettingsImportModel) validateArchiveLogs(formats strfmt.Registry) error { - - if err := validate.Required("archiveLogs", "body", m.ArchiveLogs); err != nil { - return err - } - - if err := validate.Required("archiveLogs", "body", m.ArchiveLogs); err != nil { - return err - } - - if m.ArchiveLogs != nil { - if err := m.ArchiveLogs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("archiveLogs") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsImportModel) validateCredentials(formats strfmt.Registry) error { - if swag.IsZero(m.Credentials) { // not required - return nil - } - - if m.Credentials != nil { - if err := m.Credentials.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsImportModel) validateLogShippingServers(formats strfmt.Registry) error { - if swag.IsZero(m.LogShippingServers) { // not required - return nil - } - - if m.LogShippingServers != nil { - if err := m.LogShippingServers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logShippingServers") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsImportModel) validateRetainLogBackups(formats strfmt.Registry) error { - if swag.IsZero(m.RetainLogBackups) { // not required - return nil - } - - if err := m.RetainLogBackups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retainLogBackups") - } - return err - } - - return nil -} - -func (m *BackupOracleSettingsImportModel) validateUseGuestCredentials(formats strfmt.Registry) error { - - if err := validate.Required("useGuestCredentials", "body", m.UseGuestCredentials); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backup oracle settings import model based on the context it is used -func (m *BackupOracleSettingsImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateArchiveLogs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCredentials(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLogShippingServers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRetainLogBackups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupOracleSettingsImportModel) contextValidateArchiveLogs(ctx context.Context, formats strfmt.Registry) error { - - if m.ArchiveLogs != nil { - if err := m.ArchiveLogs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("archiveLogs") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsImportModel) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { - - if m.Credentials != nil { - if err := m.Credentials.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsImportModel) contextValidateLogShippingServers(ctx context.Context, formats strfmt.Registry) error { - - if m.LogShippingServers != nil { - if err := m.LogShippingServers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logShippingServers") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsImportModel) contextValidateRetainLogBackups(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RetainLogBackups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retainLogBackups") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupOracleSettingsImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupOracleSettingsImportModel) UnmarshalBinary(b []byte) error { - var res BackupOracleSettingsImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_oracle_settings_model.go b/models/backup_oracle_settings_model.go deleted file mode 100644 index 8007a0e..0000000 --- a/models/backup_oracle_settings_model.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupOracleSettingsModel Oracle archived log settings. -// -// swagger:model BackupOracleSettingsModel -type BackupOracleSettingsModel struct { - - // archive logs - // Required: true - ArchiveLogs *EBackupOracleLogsSettings `json:"archiveLogs"` - - // If *true*, archived logs are backed up. - BackupLogs bool `json:"backupLogs,omitempty"` - - // Frequency of archived log backup, in minutes. - BackupMinsCount int64 `json:"backupMinsCount,omitempty"` - - // ID of the credentials record that is used if `useGuestCredentials` is *false*. - // Format: uuid - CredentialsID strfmt.UUID `json:"credentialsId,omitempty"` - - // Maximum size for archived logs in GB. This parameter should be specified if the `EBackupOracleLogsSettings` value is *deleteExpiredGBs*. - DeleteGBsCount int64 `json:"deleteGBsCount,omitempty"` - - // Time period in hours to keep archived logs. This parameter should be specified if the `EBackupOracleLogsSettings` value is *deleteExpiredHours*. - DeleteHoursCount int64 `json:"deleteHoursCount,omitempty"` - - // Number of days to keep archived logs. - KeepDaysCount int64 `json:"keepDaysCount,omitempty"` - - // log shipping servers - LogShippingServers *BackupLogShippingServersModel `json:"logShippingServers,omitempty"` - - // retain log backups - RetainLogBackups ERetainLogBackupsType `json:"retainLogBackups,omitempty"` - - // If *true*, Veeam Backup & Replication uses credentials specified in the guest processing settings. - // Required: true - UseGuestCredentials *bool `json:"useGuestCredentials"` -} - -// Validate validates this backup oracle settings model -func (m *BackupOracleSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateArchiveLogs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredentialsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLogShippingServers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRetainLogBackups(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUseGuestCredentials(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupOracleSettingsModel) validateArchiveLogs(formats strfmt.Registry) error { - - if err := validate.Required("archiveLogs", "body", m.ArchiveLogs); err != nil { - return err - } - - if err := validate.Required("archiveLogs", "body", m.ArchiveLogs); err != nil { - return err - } - - if m.ArchiveLogs != nil { - if err := m.ArchiveLogs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("archiveLogs") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsModel) validateCredentialsID(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialsID) { // not required - return nil - } - - if err := validate.FormatOf("credentialsId", "body", "uuid", m.CredentialsID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupOracleSettingsModel) validateLogShippingServers(formats strfmt.Registry) error { - if swag.IsZero(m.LogShippingServers) { // not required - return nil - } - - if m.LogShippingServers != nil { - if err := m.LogShippingServers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logShippingServers") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsModel) validateRetainLogBackups(formats strfmt.Registry) error { - if swag.IsZero(m.RetainLogBackups) { // not required - return nil - } - - if err := m.RetainLogBackups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retainLogBackups") - } - return err - } - - return nil -} - -func (m *BackupOracleSettingsModel) validateUseGuestCredentials(formats strfmt.Registry) error { - - if err := validate.Required("useGuestCredentials", "body", m.UseGuestCredentials); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backup oracle settings model based on the context it is used -func (m *BackupOracleSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateArchiveLogs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLogShippingServers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRetainLogBackups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupOracleSettingsModel) contextValidateArchiveLogs(ctx context.Context, formats strfmt.Registry) error { - - if m.ArchiveLogs != nil { - if err := m.ArchiveLogs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("archiveLogs") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsModel) contextValidateLogShippingServers(ctx context.Context, formats strfmt.Registry) error { - - if m.LogShippingServers != nil { - if err := m.LogShippingServers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logShippingServers") - } - return err - } - } - - return nil -} - -func (m *BackupOracleSettingsModel) contextValidateRetainLogBackups(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RetainLogBackups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retainLogBackups") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupOracleSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupOracleSettingsModel) UnmarshalBinary(b []byte) error { - var res BackupOracleSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_placement_settings_model.go b/models/backup_placement_settings_model.go deleted file mode 100644 index bc87fd6..0000000 --- a/models/backup_placement_settings_model.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupPlacementSettingsModel Settings of the performance placement policy. -// -// swagger:model BackupPlacementSettingsModel -type BackupPlacementSettingsModel struct { - - // allowed backups - // Required: true - AllowedBackups *EAllowedBackupsType `json:"allowedBackups"` - - // Name of a performance extent. - // Required: true - ExtentName *string `json:"extentName"` -} - -// Validate validates this backup placement settings model -func (m *BackupPlacementSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAllowedBackups(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExtentName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupPlacementSettingsModel) validateAllowedBackups(formats strfmt.Registry) error { - - if err := validate.Required("allowedBackups", "body", m.AllowedBackups); err != nil { - return err - } - - if err := validate.Required("allowedBackups", "body", m.AllowedBackups); err != nil { - return err - } - - if m.AllowedBackups != nil { - if err := m.AllowedBackups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("allowedBackups") - } - return err - } - } - - return nil -} - -func (m *BackupPlacementSettingsModel) validateExtentName(formats strfmt.Registry) error { - - if err := validate.Required("extentName", "body", m.ExtentName); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backup placement settings model based on the context it is used -func (m *BackupPlacementSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAllowedBackups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupPlacementSettingsModel) contextValidateAllowedBackups(ctx context.Context, formats strfmt.Registry) error { - - if m.AllowedBackups != nil { - if err := m.AllowedBackups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("allowedBackups") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupPlacementSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupPlacementSettingsModel) UnmarshalBinary(b []byte) error { - var res BackupPlacementSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_proxies_settings_model.go b/models/backup_proxies_settings_model.go deleted file mode 100644 index 4d33835..0000000 --- a/models/backup_proxies_settings_model.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupProxiesSettingsModel Backup proxy settings. -// -// swagger:model BackupProxiesSettingsModel -type BackupProxiesSettingsModel struct { - - // If *true*, backup proxies are detected and assigned automatically. - // Required: true - AutoSelection bool `json:"autoSelection"` - - // Array of proxy IDs. - // Unique: true - ProxyIds []strfmt.UUID `json:"proxyIds"` -} - -// Validate validates this backup proxies settings model -func (m *BackupProxiesSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAutoSelection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProxyIds(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupProxiesSettingsModel) validateAutoSelection(formats strfmt.Registry) error { - - if err := validate.Required("autoSelection", "body", bool(m.AutoSelection)); err != nil { - return err - } - - return nil -} - -func (m *BackupProxiesSettingsModel) validateProxyIds(formats strfmt.Registry) error { - if swag.IsZero(m.ProxyIds) { // not required - return nil - } - - if err := validate.UniqueItems("proxyIds", "body", m.ProxyIds); err != nil { - return err - } - - for i := 0; i < len(m.ProxyIds); i++ { - - if err := validate.FormatOf("proxyIds"+"."+strconv.Itoa(i), "body", "uuid", m.ProxyIds[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -// ContextValidate validates this backup proxies settings model based on context it is used -func (m *BackupProxiesSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BackupProxiesSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupProxiesSettingsModel) UnmarshalBinary(b []byte) error { - var res BackupProxiesSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_proxy_import_model.go b/models/backup_proxy_import_model.go deleted file mode 100644 index e3578f5..0000000 --- a/models/backup_proxy_import_model.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupProxyImportModel backup proxy import model -// -// swagger:model BackupProxyImportModel -type BackupProxyImportModel struct { - - // Name of the backup proxy. - // Required: true - Name *string `json:"name"` - - // Tag assigned to the backup proxy. - Tag string `json:"tag,omitempty"` - - // type - // Required: true - Type *EBackupProxyImportType `json:"type"` -} - -// Validate validates this backup proxy import model -func (m *BackupProxyImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupProxyImportModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *BackupProxyImportModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup proxy import model based on the context it is used -func (m *BackupProxyImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupProxyImportModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupProxyImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupProxyImportModel) UnmarshalBinary(b []byte) error { - var res BackupProxyImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_repository_import_model.go b/models/backup_repository_import_model.go deleted file mode 100644 index 70e5f4d..0000000 --- a/models/backup_repository_import_model.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupRepositoryImportModel Backup repository. -// -// swagger:model BackupRepositoryImportModel -type BackupRepositoryImportModel struct { - - // Name of the backup repository. - // Required: true - Name *string `json:"name"` - - // Tag assigned to the backup repository. - Tag string `json:"tag,omitempty"` -} - -// Validate validates this backup repository import model -func (m *BackupRepositoryImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupRepositoryImportModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this backup repository import model based on context it is used -func (m *BackupRepositoryImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BackupRepositoryImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupRepositoryImportModel) UnmarshalBinary(b []byte) error { - var res BackupRepositoryImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_schedule_model.go b/models/backup_schedule_model.go deleted file mode 100644 index feb0bb4..0000000 --- a/models/backup_schedule_model.go +++ /dev/null @@ -1,370 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupScheduleModel Job scheduling options. -// -// swagger:model BackupScheduleModel -type BackupScheduleModel struct { - - // after this job - AfterThisJob *ScheduleAfterThisJobModel `json:"afterThisJob,omitempty"` - - // backup window - BackupWindow *ScheduleBackupWindowModel `json:"backupWindow,omitempty"` - - // continuously - Continuously *ScheduleBackupWindowModel `json:"continuously,omitempty"` - - // daily - Daily *ScheduleDailyModel `json:"daily,omitempty"` - - // monthly - Monthly *ScheduleMonthlyModel `json:"monthly,omitempty"` - - // periodically - Periodically *SchedulePeriodicallyModel `json:"periodically,omitempty"` - - // retry - Retry *ScheduleRetryModel `json:"retry,omitempty"` - - // If *true*, job scheduling is enabled. - // Required: true - RunAutomatically bool `json:"runAutomatically"` -} - -// Validate validates this backup schedule model -func (m *BackupScheduleModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAfterThisJob(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupWindow(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContinuously(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDaily(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMonthly(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePeriodically(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRetry(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRunAutomatically(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupScheduleModel) validateAfterThisJob(formats strfmt.Registry) error { - if swag.IsZero(m.AfterThisJob) { // not required - return nil - } - - if m.AfterThisJob != nil { - if err := m.AfterThisJob.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("afterThisJob") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) validateBackupWindow(formats strfmt.Registry) error { - if swag.IsZero(m.BackupWindow) { // not required - return nil - } - - if m.BackupWindow != nil { - if err := m.BackupWindow.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupWindow") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) validateContinuously(formats strfmt.Registry) error { - if swag.IsZero(m.Continuously) { // not required - return nil - } - - if m.Continuously != nil { - if err := m.Continuously.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("continuously") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) validateDaily(formats strfmt.Registry) error { - if swag.IsZero(m.Daily) { // not required - return nil - } - - if m.Daily != nil { - if err := m.Daily.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("daily") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) validateMonthly(formats strfmt.Registry) error { - if swag.IsZero(m.Monthly) { // not required - return nil - } - - if m.Monthly != nil { - if err := m.Monthly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) validatePeriodically(formats strfmt.Registry) error { - if swag.IsZero(m.Periodically) { // not required - return nil - } - - if m.Periodically != nil { - if err := m.Periodically.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("periodically") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) validateRetry(formats strfmt.Registry) error { - if swag.IsZero(m.Retry) { // not required - return nil - } - - if m.Retry != nil { - if err := m.Retry.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retry") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) validateRunAutomatically(formats strfmt.Registry) error { - - if err := validate.Required("runAutomatically", "body", bool(m.RunAutomatically)); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backup schedule model based on the context it is used -func (m *BackupScheduleModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAfterThisJob(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupWindow(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateContinuously(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDaily(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMonthly(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePeriodically(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRetry(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupScheduleModel) contextValidateAfterThisJob(ctx context.Context, formats strfmt.Registry) error { - - if m.AfterThisJob != nil { - if err := m.AfterThisJob.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("afterThisJob") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) contextValidateBackupWindow(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupWindow != nil { - if err := m.BackupWindow.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupWindow") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) contextValidateContinuously(ctx context.Context, formats strfmt.Registry) error { - - if m.Continuously != nil { - if err := m.Continuously.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("continuously") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) contextValidateDaily(ctx context.Context, formats strfmt.Registry) error { - - if m.Daily != nil { - if err := m.Daily.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("daily") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) contextValidateMonthly(ctx context.Context, formats strfmt.Registry) error { - - if m.Monthly != nil { - if err := m.Monthly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) contextValidatePeriodically(ctx context.Context, formats strfmt.Registry) error { - - if m.Periodically != nil { - if err := m.Periodically.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("periodically") - } - return err - } - } - - return nil -} - -func (m *BackupScheduleModel) contextValidateRetry(ctx context.Context, formats strfmt.Registry) error { - - if m.Retry != nil { - if err := m.Retry.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retry") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupScheduleModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupScheduleModel) UnmarshalBinary(b []byte) error { - var res BackupScheduleModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_script_settings_model.go b/models/backup_script_settings_model.go deleted file mode 100644 index 6ada018..0000000 --- a/models/backup_script_settings_model.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupScriptSettingsModel Pre-freeze and post-thaw scripts. -// -// swagger:model BackupScriptSettingsModel -type BackupScriptSettingsModel struct { - - // linux scripts - LinuxScripts *BackupLinuxScriptModel `json:"linuxScripts,omitempty"` - - // script processing mode - // Required: true - ScriptProcessingMode *EBackupScriptProcessingMode `json:"scriptProcessingMode"` - - // windows scripts - WindowsScripts *BackupWindowsScriptModel `json:"windowsScripts,omitempty"` -} - -// Validate validates this backup script settings model -func (m *BackupScriptSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinuxScripts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScriptProcessingMode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWindowsScripts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupScriptSettingsModel) validateLinuxScripts(formats strfmt.Registry) error { - if swag.IsZero(m.LinuxScripts) { // not required - return nil - } - - if m.LinuxScripts != nil { - if err := m.LinuxScripts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("linuxScripts") - } - return err - } - } - - return nil -} - -func (m *BackupScriptSettingsModel) validateScriptProcessingMode(formats strfmt.Registry) error { - - if err := validate.Required("scriptProcessingMode", "body", m.ScriptProcessingMode); err != nil { - return err - } - - if err := validate.Required("scriptProcessingMode", "body", m.ScriptProcessingMode); err != nil { - return err - } - - if m.ScriptProcessingMode != nil { - if err := m.ScriptProcessingMode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("scriptProcessingMode") - } - return err - } - } - - return nil -} - -func (m *BackupScriptSettingsModel) validateWindowsScripts(formats strfmt.Registry) error { - if swag.IsZero(m.WindowsScripts) { // not required - return nil - } - - if m.WindowsScripts != nil { - if err := m.WindowsScripts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("windowsScripts") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backup script settings model based on the context it is used -func (m *BackupScriptSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinuxScripts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateScriptProcessingMode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWindowsScripts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupScriptSettingsModel) contextValidateLinuxScripts(ctx context.Context, formats strfmt.Registry) error { - - if m.LinuxScripts != nil { - if err := m.LinuxScripts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("linuxScripts") - } - return err - } - } - - return nil -} - -func (m *BackupScriptSettingsModel) contextValidateScriptProcessingMode(ctx context.Context, formats strfmt.Registry) error { - - if m.ScriptProcessingMode != nil { - if err := m.ScriptProcessingMode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("scriptProcessingMode") - } - return err - } - } - - return nil -} - -func (m *BackupScriptSettingsModel) contextValidateWindowsScripts(ctx context.Context, formats strfmt.Registry) error { - - if m.WindowsScripts != nil { - if err := m.WindowsScripts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("windowsScripts") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupScriptSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupScriptSettingsModel) UnmarshalBinary(b []byte) error { - var res BackupScriptSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_sql_settings_import_model.go b/models/backup_sql_settings_import_model.go deleted file mode 100644 index 24ddca3..0000000 --- a/models/backup_sql_settings_import_model.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupSQLSettingsImportModel Microsoft SQL Server transaction log settings. -// -// swagger:model BackupSQLSettingsImportModel -type BackupSQLSettingsImportModel struct { - - // Frequency of transaction log backup, in minutes. - BackupMinsCount int64 `json:"backupMinsCount,omitempty"` - - // Number of days to keep transaction logs in the backup repository. - KeepDaysCount int64 `json:"keepDaysCount,omitempty"` - - // log shipping servers - LogShippingServers *BackupLogShippingServersImportModel `json:"logShippingServers,omitempty"` - - // logs processing - // Required: true - LogsProcessing *ESQLLogsProcessing `json:"logsProcessing"` - - // retain log backups - RetainLogBackups ERetainLogBackupsType `json:"retainLogBackups,omitempty"` -} - -// Validate validates this backup SQL settings import model -func (m *BackupSQLSettingsImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLogShippingServers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLogsProcessing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRetainLogBackups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupSQLSettingsImportModel) validateLogShippingServers(formats strfmt.Registry) error { - if swag.IsZero(m.LogShippingServers) { // not required - return nil - } - - if m.LogShippingServers != nil { - if err := m.LogShippingServers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logShippingServers") - } - return err - } - } - - return nil -} - -func (m *BackupSQLSettingsImportModel) validateLogsProcessing(formats strfmt.Registry) error { - - if err := validate.Required("logsProcessing", "body", m.LogsProcessing); err != nil { - return err - } - - if err := validate.Required("logsProcessing", "body", m.LogsProcessing); err != nil { - return err - } - - if m.LogsProcessing != nil { - if err := m.LogsProcessing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logsProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupSQLSettingsImportModel) validateRetainLogBackups(formats strfmt.Registry) error { - if swag.IsZero(m.RetainLogBackups) { // not required - return nil - } - - if err := m.RetainLogBackups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retainLogBackups") - } - return err - } - - return nil -} - -// ContextValidate validate this backup SQL settings import model based on the context it is used -func (m *BackupSQLSettingsImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLogShippingServers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLogsProcessing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRetainLogBackups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupSQLSettingsImportModel) contextValidateLogShippingServers(ctx context.Context, formats strfmt.Registry) error { - - if m.LogShippingServers != nil { - if err := m.LogShippingServers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logShippingServers") - } - return err - } - } - - return nil -} - -func (m *BackupSQLSettingsImportModel) contextValidateLogsProcessing(ctx context.Context, formats strfmt.Registry) error { - - if m.LogsProcessing != nil { - if err := m.LogsProcessing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logsProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupSQLSettingsImportModel) contextValidateRetainLogBackups(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RetainLogBackups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retainLogBackups") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupSQLSettingsImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupSQLSettingsImportModel) UnmarshalBinary(b []byte) error { - var res BackupSQLSettingsImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_sql_settings_model.go b/models/backup_sql_settings_model.go deleted file mode 100644 index 318302b..0000000 --- a/models/backup_sql_settings_model.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupSQLSettingsModel Microsoft SQL Server transaction log settings. -// -// swagger:model BackupSQLSettingsModel -type BackupSQLSettingsModel struct { - - // Frequency of transaction log backup, in minutes. - BackupMinsCount int64 `json:"backupMinsCount,omitempty"` - - // Number of days to keep transaction logs in the backup repository. - KeepDaysCount int64 `json:"keepDaysCount,omitempty"` - - // log shipping servers - LogShippingServers *BackupLogShippingServersModel `json:"logShippingServers,omitempty"` - - // logs processing - // Required: true - LogsProcessing *ESQLLogsProcessing `json:"logsProcessing"` - - // retain log backups - RetainLogBackups ERetainLogBackupsType `json:"retainLogBackups,omitempty"` -} - -// Validate validates this backup SQL settings model -func (m *BackupSQLSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLogShippingServers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLogsProcessing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRetainLogBackups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupSQLSettingsModel) validateLogShippingServers(formats strfmt.Registry) error { - if swag.IsZero(m.LogShippingServers) { // not required - return nil - } - - if m.LogShippingServers != nil { - if err := m.LogShippingServers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logShippingServers") - } - return err - } - } - - return nil -} - -func (m *BackupSQLSettingsModel) validateLogsProcessing(formats strfmt.Registry) error { - - if err := validate.Required("logsProcessing", "body", m.LogsProcessing); err != nil { - return err - } - - if err := validate.Required("logsProcessing", "body", m.LogsProcessing); err != nil { - return err - } - - if m.LogsProcessing != nil { - if err := m.LogsProcessing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logsProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupSQLSettingsModel) validateRetainLogBackups(formats strfmt.Registry) error { - if swag.IsZero(m.RetainLogBackups) { // not required - return nil - } - - if err := m.RetainLogBackups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retainLogBackups") - } - return err - } - - return nil -} - -// ContextValidate validate this backup SQL settings model based on the context it is used -func (m *BackupSQLSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLogShippingServers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLogsProcessing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRetainLogBackups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupSQLSettingsModel) contextValidateLogShippingServers(ctx context.Context, formats strfmt.Registry) error { - - if m.LogShippingServers != nil { - if err := m.LogShippingServers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logShippingServers") - } - return err - } - } - - return nil -} - -func (m *BackupSQLSettingsModel) contextValidateLogsProcessing(ctx context.Context, formats strfmt.Registry) error { - - if m.LogsProcessing != nil { - if err := m.LogsProcessing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("logsProcessing") - } - return err - } - } - - return nil -} - -func (m *BackupSQLSettingsModel) contextValidateRetainLogBackups(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RetainLogBackups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("retainLogBackups") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupSQLSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupSQLSettingsModel) UnmarshalBinary(b []byte) error { - var res BackupSQLSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_storage_setting_model.go b/models/backup_storage_setting_model.go deleted file mode 100644 index 697a306..0000000 --- a/models/backup_storage_setting_model.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BackupStorageSettingModel Storage settings. -// -// swagger:model BackupStorageSettingModel -type BackupStorageSettingModel struct { - - // compression level - CompressionLevel ECompressionLevel `json:"compressionLevel,omitempty"` - - // If *true*, Veeam Backup & Replication deduplicates VM data before storing it in the backup repository. - EnableInlineDataDedup bool `json:"enableInlineDataDedup,omitempty"` - - // encryption - Encryption *BackupStorageSettingsEncryptionModel `json:"encryption,omitempty"` - - // If *true*, Veeam Backup & Replication does not copy deleted file blocks. - ExcludeDeletedFileBlocks bool `json:"excludeDeletedFileBlocks,omitempty"` - - // If *true*, Veeam Backup & Replication excludes swap file blocks from processing. - ExcludeSwapFileBlocks bool `json:"excludeSwapFileBlocks,omitempty"` - - // storage optimization - StorageOptimization EStorageOptimization `json:"storageOptimization,omitempty"` -} - -// Validate validates this backup storage setting model -func (m *BackupStorageSettingModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCompressionLevel(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageOptimization(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupStorageSettingModel) validateCompressionLevel(formats strfmt.Registry) error { - if swag.IsZero(m.CompressionLevel) { // not required - return nil - } - - if err := m.CompressionLevel.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("compressionLevel") - } - return err - } - - return nil -} - -func (m *BackupStorageSettingModel) validateEncryption(formats strfmt.Registry) error { - if swag.IsZero(m.Encryption) { // not required - return nil - } - - if m.Encryption != nil { - if err := m.Encryption.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryption") - } - return err - } - } - - return nil -} - -func (m *BackupStorageSettingModel) validateStorageOptimization(formats strfmt.Registry) error { - if swag.IsZero(m.StorageOptimization) { // not required - return nil - } - - if err := m.StorageOptimization.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageOptimization") - } - return err - } - - return nil -} - -// ContextValidate validate this backup storage setting model based on the context it is used -func (m *BackupStorageSettingModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCompressionLevel(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEncryption(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageOptimization(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupStorageSettingModel) contextValidateCompressionLevel(ctx context.Context, formats strfmt.Registry) error { - - if err := m.CompressionLevel.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("compressionLevel") - } - return err - } - - return nil -} - -func (m *BackupStorageSettingModel) contextValidateEncryption(ctx context.Context, formats strfmt.Registry) error { - - if m.Encryption != nil { - if err := m.Encryption.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryption") - } - return err - } - } - - return nil -} - -func (m *BackupStorageSettingModel) contextValidateStorageOptimization(ctx context.Context, formats strfmt.Registry) error { - - if err := m.StorageOptimization.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageOptimization") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupStorageSettingModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupStorageSettingModel) UnmarshalBinary(b []byte) error { - var res BackupStorageSettingModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_storage_settings_encryption_model.go b/models/backup_storage_settings_encryption_model.go deleted file mode 100644 index 06541a7..0000000 --- a/models/backup_storage_settings_encryption_model.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupStorageSettingsEncryptionModel Encription of backup files. -// -// swagger:model BackupStorageSettingsEncryptionModel -type BackupStorageSettingsEncryptionModel struct { - - // ID of the password used for encryption. The value is *null* for exported objects. - // Format: uuid - EncryptionPasswordIDOrNull strfmt.UUID `json:"encryptionPasswordIdOrNull,omitempty"` - - // Tag used to identify the password. - EncryptionPasswordTag string `json:"encryptionPasswordTag,omitempty"` - - // If *true*, the content of backup files is encrypted. - // Required: true - IsEnabled *bool `json:"isEnabled"` -} - -// Validate validates this backup storage settings encryption model -func (m *BackupStorageSettingsEncryptionModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEncryptionPasswordIDOrNull(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupStorageSettingsEncryptionModel) validateEncryptionPasswordIDOrNull(formats strfmt.Registry) error { - if swag.IsZero(m.EncryptionPasswordIDOrNull) { // not required - return nil - } - - if err := validate.FormatOf("encryptionPasswordIdOrNull", "body", "uuid", m.EncryptionPasswordIDOrNull.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupStorageSettingsEncryptionModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this backup storage settings encryption model based on context it is used -func (m *BackupStorageSettingsEncryptionModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BackupStorageSettingsEncryptionModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupStorageSettingsEncryptionModel) UnmarshalBinary(b []byte) error { - var res BackupStorageSettingsEncryptionModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_window_day_hours_model.go b/models/backup_window_day_hours_model.go deleted file mode 100644 index cc38b40..0000000 --- a/models/backup_window_day_hours_model.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupWindowDayHoursModel Hourly scheme for a day. -// -// swagger:model BackupWindowDayHoursModel -type BackupWindowDayHoursModel struct { - - // day - // Required: true - Day *EDayOfWeek `json:"day"` - - // String of hours in the following format: - // *1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1* - // where *1* means enabled, *0* means disabled. - // - // Required: true - Hours *string `json:"hours"` -} - -// Validate validates this backup window day hours model -func (m *BackupWindowDayHoursModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDay(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHours(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupWindowDayHoursModel) validateDay(formats strfmt.Registry) error { - - if err := validate.Required("day", "body", m.Day); err != nil { - return err - } - - if err := validate.Required("day", "body", m.Day); err != nil { - return err - } - - if m.Day != nil { - if err := m.Day.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("day") - } - return err - } - } - - return nil -} - -func (m *BackupWindowDayHoursModel) validateHours(formats strfmt.Registry) error { - - if err := validate.Required("hours", "body", m.Hours); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backup window day hours model based on the context it is used -func (m *BackupWindowDayHoursModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDay(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupWindowDayHoursModel) contextValidateDay(ctx context.Context, formats strfmt.Registry) error { - - if m.Day != nil { - if err := m.Day.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("day") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupWindowDayHoursModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupWindowDayHoursModel) UnmarshalBinary(b []byte) error { - var res BackupWindowDayHoursModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_window_setting_model.go b/models/backup_window_setting_model.go deleted file mode 100644 index 093bb46..0000000 --- a/models/backup_window_setting_model.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupWindowSettingModel Time scheme. -// -// swagger:model BackupWindowSettingModel -type BackupWindowSettingModel struct { - - // Array of per-day schemes. - // Required: true - Days []*BackupWindowDayHoursModel `json:"days"` -} - -// Validate validates this backup window setting model -func (m *BackupWindowSettingModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDays(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupWindowSettingModel) validateDays(formats strfmt.Registry) error { - - if err := validate.Required("days", "body", m.Days); err != nil { - return err - } - - for i := 0; i < len(m.Days); i++ { - if swag.IsZero(m.Days[i]) { // not required - continue - } - - if m.Days[i] != nil { - if err := m.Days[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("days" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this backup window setting model based on the context it is used -func (m *BackupWindowSettingModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDays(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupWindowSettingModel) contextValidateDays(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Days); i++ { - - if m.Days[i] != nil { - if err := m.Days[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("days" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupWindowSettingModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupWindowSettingModel) UnmarshalBinary(b []byte) error { - var res BackupWindowSettingModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backup_windows_script_model.go b/models/backup_windows_script_model.go deleted file mode 100644 index 74ea394..0000000 --- a/models/backup_windows_script_model.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BackupWindowsScriptModel Paths to pre-freeze and post-thaw scripts for Microsoft Windows VMs. -// -// swagger:model BackupWindowsScriptModel -type BackupWindowsScriptModel struct { - - // Path to a post-thaw script. - PostThawScript string `json:"postThawScript,omitempty"` - - // Path to a pre-freeze script. - PreFreezeScript string `json:"preFreezeScript,omitempty"` -} - -// Validate validates this backup windows script model -func (m *BackupWindowsScriptModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this backup windows script model based on context it is used -func (m *BackupWindowsScriptModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BackupWindowsScriptModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupWindowsScriptModel) UnmarshalBinary(b []byte) error { - var res BackupWindowsScriptModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backups_filters.go b/models/backups_filters.go deleted file mode 100644 index ebe7a7d..0000000 --- a/models/backups_filters.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupsFilters backups filters -// -// swagger:model BackupsFilters -type BackupsFilters struct { - - // created after filter - // Format: date-time - CreatedAfterFilter strfmt.DateTime `json:"createdAfterFilter,omitempty"` - - // created before filter - // Format: date-time - CreatedBeforeFilter strfmt.DateTime `json:"createdBeforeFilter,omitempty"` - - // job Id filter - // Format: uuid - JobIDFilter strfmt.UUID `json:"jobIdFilter,omitempty"` - - // limit - Limit int32 `json:"limit,omitempty"` - - // name filter - NameFilter string `json:"nameFilter,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EBackupsFiltersOrderColumn `json:"orderColumn,omitempty"` - - // platform Id filter - // Format: uuid - PlatformIDFilter strfmt.UUID `json:"platformIdFilter,omitempty"` - - // policy tag filter - PolicyTagFilter string `json:"policyTagFilter,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` -} - -// Validate validates this backups filters -func (m *BackupsFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAfterFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedBeforeFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJobIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformIDFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupsFilters) validateCreatedAfterFilter(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAfterFilter) { // not required - return nil - } - - if err := validate.FormatOf("createdAfterFilter", "body", "date-time", m.CreatedAfterFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupsFilters) validateCreatedBeforeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedBeforeFilter) { // not required - return nil - } - - if err := validate.FormatOf("createdBeforeFilter", "body", "date-time", m.CreatedBeforeFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupsFilters) validateJobIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.JobIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("jobIdFilter", "body", "uuid", m.JobIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BackupsFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *BackupsFilters) validatePlatformIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.PlatformIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("platformIdFilter", "body", "uuid", m.PlatformIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this backups filters based on the context it is used -func (m *BackupsFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupsFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupsFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupsFilters) UnmarshalBinary(b []byte) error { - var res BackupsFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/backups_result.go b/models/backups_result.go deleted file mode 100644 index b7e8fcd..0000000 --- a/models/backups_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BackupsResult backups result -// -// swagger:model BackupsResult -type BackupsResult struct { - - // Array of backups. - // Required: true - Data []*BackupModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this backups result -func (m *BackupsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupsResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupsResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this backups result based on the context it is used -func (m *BackupsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BackupsResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *BackupsResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BackupsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BackupsResult) UnmarshalBinary(b []byte) error { - var res BackupsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/capacity_tier_model.go b/models/capacity_tier_model.go deleted file mode 100644 index 609758d..0000000 --- a/models/capacity_tier_model.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CapacityTierModel Capacity tier. -// -// swagger:model CapacityTierModel -type CapacityTierModel struct { - - // If *true*, Veeam Backup & Replication copies backups from the performance extents to the capacity extent as soon as the backups are created. - CopyPolicyEnabled bool `json:"copyPolicyEnabled,omitempty"` - - // If *true*, the capacity tier is enabled. - Enabled bool `json:"enabled,omitempty"` - - // encryption - Encryption *BackupStorageSettingsEncryptionModel `json:"encryption,omitempty"` - - // ID of an object storage repository added as a capacity extent. - // Format: uuid - ExtentID strfmt.UUID `json:"extentId,omitempty"` - - // If *true*, Veeam Backup & Replication moves backup files that belong to inactive backup chains from the performance extents to the capacity extent. - MovePolicyEnabled bool `json:"movePolicyEnabled,omitempty"` - - // offload window - OffloadWindow *BackupWindowSettingModel `json:"offloadWindow,omitempty"` - - // Number of days after which inactive backup chains on the performance extents are moved to the capacity extent. Specify *0* to offload inactive backup chains on the same day they are created. - OperationalRestorePeriodDays int64 `json:"operationalRestorePeriodDays,omitempty"` - - // override policy - OverridePolicy *CapacityTierOverridePolicyModel `json:"overridePolicy,omitempty"` -} - -// Validate validates this capacity tier model -func (m *CapacityTierModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExtentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOffloadWindow(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOverridePolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CapacityTierModel) validateEncryption(formats strfmt.Registry) error { - if swag.IsZero(m.Encryption) { // not required - return nil - } - - if m.Encryption != nil { - if err := m.Encryption.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryption") - } - return err - } - } - - return nil -} - -func (m *CapacityTierModel) validateExtentID(formats strfmt.Registry) error { - if swag.IsZero(m.ExtentID) { // not required - return nil - } - - if err := validate.FormatOf("extentId", "body", "uuid", m.ExtentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CapacityTierModel) validateOffloadWindow(formats strfmt.Registry) error { - if swag.IsZero(m.OffloadWindow) { // not required - return nil - } - - if m.OffloadWindow != nil { - if err := m.OffloadWindow.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("offloadWindow") - } - return err - } - } - - return nil -} - -func (m *CapacityTierModel) validateOverridePolicy(formats strfmt.Registry) error { - if swag.IsZero(m.OverridePolicy) { // not required - return nil - } - - if m.OverridePolicy != nil { - if err := m.OverridePolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("overridePolicy") - } - return err - } - } - - return nil -} - -// ContextValidate validate this capacity tier model based on the context it is used -func (m *CapacityTierModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEncryption(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOffloadWindow(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOverridePolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CapacityTierModel) contextValidateEncryption(ctx context.Context, formats strfmt.Registry) error { - - if m.Encryption != nil { - if err := m.Encryption.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryption") - } - return err - } - } - - return nil -} - -func (m *CapacityTierModel) contextValidateOffloadWindow(ctx context.Context, formats strfmt.Registry) error { - - if m.OffloadWindow != nil { - if err := m.OffloadWindow.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("offloadWindow") - } - return err - } - } - - return nil -} - -func (m *CapacityTierModel) contextValidateOverridePolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.OverridePolicy != nil { - if err := m.OverridePolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("overridePolicy") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CapacityTierModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CapacityTierModel) UnmarshalBinary(b []byte) error { - var res CapacityTierModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/capacity_tier_override_policy_model.go b/models/capacity_tier_override_policy_model.go deleted file mode 100644 index f5505dd..0000000 --- a/models/capacity_tier_override_policy_model.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CapacityTierOverridePolicyModel Override policy. -// -// swagger:model CapacityTierOverridePolicyModel -type CapacityTierOverridePolicyModel struct { - - // If *true*, Veeam Backup & Replication moves oldest backup files sooner if scale-out backup repository is reaching the threshold. - IsEnabled bool `json:"isEnabled,omitempty"` - - // Space threshold of the scale-out backup repository, in percent. - OverrideSpaceThresholdPercents int64 `json:"overrideSpaceThresholdPercents,omitempty"` -} - -// Validate validates this capacity tier override policy model -func (m *CapacityTierOverridePolicyModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this capacity tier override policy model based on context it is used -func (m *CapacityTierOverridePolicyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CapacityTierOverridePolicyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CapacityTierOverridePolicyModel) UnmarshalBinary(b []byte) error { - var res CapacityTierOverridePolicyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/certificate_model.go b/models/certificate_model.go deleted file mode 100644 index 4e06270..0000000 --- a/models/certificate_model.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CertificateModel certificate model -// -// swagger:model CertificateModel -type CertificateModel struct { - - // Issuer of the certificate. - // Required: true - IssuedBy *string `json:"issuedBy"` - - // Acquirer of the certificate. - // Required: true - IssuedTo *string `json:"issuedTo"` - - // Key algorithm of the certificate. - // Required: true - KeyAlgorithm *string `json:"keyAlgorithm"` - - // Key size of the certificate. - // Required: true - KeySize *string `json:"keySize"` - - // Serial number of the certificate. - // Required: true - SerialNumber *string `json:"serialNumber"` - - // Subject of the certificate. - // Required: true - Subject *string `json:"subject"` - - // Thumbprint of the certificate. - // Required: true - Thumbprint *string `json:"thumbprint"` - - // Expiration date and time of the certificate. - // Required: true - // Format: date-time - ValidBy *strfmt.DateTime `json:"validBy"` - - // Date and time the certificate is valid from. - // Required: true - // Format: date-time - ValidFrom *strfmt.DateTime `json:"validFrom"` -} - -// Validate validates this certificate model -func (m *CertificateModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIssuedBy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssuedTo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyAlgorithm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeySize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSerialNumber(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateThumbprint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValidBy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValidFrom(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CertificateModel) validateIssuedBy(formats strfmt.Registry) error { - - if err := validate.Required("issuedBy", "body", m.IssuedBy); err != nil { - return err - } - - return nil -} - -func (m *CertificateModel) validateIssuedTo(formats strfmt.Registry) error { - - if err := validate.Required("issuedTo", "body", m.IssuedTo); err != nil { - return err - } - - return nil -} - -func (m *CertificateModel) validateKeyAlgorithm(formats strfmt.Registry) error { - - if err := validate.Required("keyAlgorithm", "body", m.KeyAlgorithm); err != nil { - return err - } - - return nil -} - -func (m *CertificateModel) validateKeySize(formats strfmt.Registry) error { - - if err := validate.Required("keySize", "body", m.KeySize); err != nil { - return err - } - - return nil -} - -func (m *CertificateModel) validateSerialNumber(formats strfmt.Registry) error { - - if err := validate.Required("serialNumber", "body", m.SerialNumber); err != nil { - return err - } - - return nil -} - -func (m *CertificateModel) validateSubject(formats strfmt.Registry) error { - - if err := validate.Required("subject", "body", m.Subject); err != nil { - return err - } - - return nil -} - -func (m *CertificateModel) validateThumbprint(formats strfmt.Registry) error { - - if err := validate.Required("thumbprint", "body", m.Thumbprint); err != nil { - return err - } - - return nil -} - -func (m *CertificateModel) validateValidBy(formats strfmt.Registry) error { - - if err := validate.Required("validBy", "body", m.ValidBy); err != nil { - return err - } - - if err := validate.FormatOf("validBy", "body", "date-time", m.ValidBy.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CertificateModel) validateValidFrom(formats strfmt.Registry) error { - - if err := validate.Required("validFrom", "body", m.ValidFrom); err != nil { - return err - } - - if err := validate.FormatOf("validFrom", "body", "date-time", m.ValidFrom.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this certificate model based on context it is used -func (m *CertificateModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CertificateModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CertificateModel) UnmarshalBinary(b []byte) error { - var res CertificateModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/config_backup_encryption_model.go b/models/config_backup_encryption_model.go deleted file mode 100644 index 5b772d3..0000000 --- a/models/config_backup_encryption_model.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigBackupEncryptionModel Encryption settings. -// -// swagger:model ConfigBackupEncryptionModel -type ConfigBackupEncryptionModel struct { - - // If *true*, backup encryption is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // ID of the password used for encryption. - // Required: true - // Format: uuid - PasswordID *strfmt.UUID `json:"passwordId"` -} - -// Validate validates this config backup encryption model -func (m *ConfigBackupEncryptionModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePasswordID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupEncryptionModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupEncryptionModel) validatePasswordID(formats strfmt.Registry) error { - - if err := validate.Required("passwordId", "body", m.PasswordID); err != nil { - return err - } - - if err := validate.FormatOf("passwordId", "body", "uuid", m.PasswordID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this config backup encryption model based on context it is used -func (m *ConfigBackupEncryptionModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigBackupEncryptionModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigBackupEncryptionModel) UnmarshalBinary(b []byte) error { - var res ConfigBackupEncryptionModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/config_backup_last_successful_model.go b/models/config_backup_last_successful_model.go deleted file mode 100644 index b2cb6a6..0000000 --- a/models/config_backup_last_successful_model.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigBackupLastSuccessfulModel Last successful backup. -// -// swagger:model ConfigBackupLastSuccessfulModel -type ConfigBackupLastSuccessfulModel struct { - - // Date and time when the last successful backup was created. - // Format: date-time - LastSuccessfulTime strfmt.DateTime `json:"lastSuccessfulTime,omitempty"` - - // ID of the job session. - // Format: uuid - SessionID strfmt.UUID `json:"sessionId,omitempty"` -} - -// Validate validates this config backup last successful model -func (m *ConfigBackupLastSuccessfulModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLastSuccessfulTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSessionID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupLastSuccessfulModel) validateLastSuccessfulTime(formats strfmt.Registry) error { - if swag.IsZero(m.LastSuccessfulTime) { // not required - return nil - } - - if err := validate.FormatOf("lastSuccessfulTime", "body", "date-time", m.LastSuccessfulTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupLastSuccessfulModel) validateSessionID(formats strfmt.Registry) error { - if swag.IsZero(m.SessionID) { // not required - return nil - } - - if err := validate.FormatOf("sessionId", "body", "uuid", m.SessionID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this config backup last successful model based on context it is used -func (m *ConfigBackupLastSuccessfulModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigBackupLastSuccessfulModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigBackupLastSuccessfulModel) UnmarshalBinary(b []byte) error { - var res ConfigBackupLastSuccessfulModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/config_backup_model.go b/models/config_backup_model.go deleted file mode 100644 index a271230..0000000 --- a/models/config_backup_model.go +++ /dev/null @@ -1,291 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigBackupModel config backup model -// -// swagger:model ConfigBackupModel -type ConfigBackupModel struct { - - // ID of the backup repository on which the configuration backup is stored. - // Required: true - // Format: uuid - BackupRepositoryID *strfmt.UUID `json:"backupRepositoryId"` - - // encryption - // Required: true - Encryption *ConfigBackupEncryptionModel `json:"encryption"` - - // If *true*, configuration backup is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // last successful backup - // Required: true - LastSuccessfulBackup *ConfigBackupLastSuccessfulModel `json:"lastSuccessfulBackup"` - - // notifications - // Required: true - Notifications *ConfigBackupNotificationsModel `json:"notifications"` - - // Number of restore points to keep in the backup repository. - // Required: true - RestorePointsToKeep *int32 `json:"restorePointsToKeep"` - - // schedule - // Required: true - Schedule *ConfigBackupScheduleModel `json:"schedule"` -} - -// Validate validates this config backup model -func (m *ConfigBackupModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackupRepositoryID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastSuccessfulBackup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifications(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRestorePointsToKeep(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSchedule(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupModel) validateBackupRepositoryID(formats strfmt.Registry) error { - - if err := validate.Required("backupRepositoryId", "body", m.BackupRepositoryID); err != nil { - return err - } - - if err := validate.FormatOf("backupRepositoryId", "body", "uuid", m.BackupRepositoryID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupModel) validateEncryption(formats strfmt.Registry) error { - - if err := validate.Required("encryption", "body", m.Encryption); err != nil { - return err - } - - if m.Encryption != nil { - if err := m.Encryption.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryption") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupModel) validateLastSuccessfulBackup(formats strfmt.Registry) error { - - if err := validate.Required("lastSuccessfulBackup", "body", m.LastSuccessfulBackup); err != nil { - return err - } - - if m.LastSuccessfulBackup != nil { - if err := m.LastSuccessfulBackup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lastSuccessfulBackup") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupModel) validateNotifications(formats strfmt.Registry) error { - - if err := validate.Required("notifications", "body", m.Notifications); err != nil { - return err - } - - if m.Notifications != nil { - if err := m.Notifications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("notifications") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupModel) validateRestorePointsToKeep(formats strfmt.Registry) error { - - if err := validate.Required("restorePointsToKeep", "body", m.RestorePointsToKeep); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupModel) validateSchedule(formats strfmt.Registry) error { - - if err := validate.Required("schedule", "body", m.Schedule); err != nil { - return err - } - - if m.Schedule != nil { - if err := m.Schedule.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schedule") - } - return err - } - } - - return nil -} - -// ContextValidate validate this config backup model based on the context it is used -func (m *ConfigBackupModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEncryption(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLastSuccessfulBackup(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNotifications(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSchedule(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupModel) contextValidateEncryption(ctx context.Context, formats strfmt.Registry) error { - - if m.Encryption != nil { - if err := m.Encryption.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryption") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupModel) contextValidateLastSuccessfulBackup(ctx context.Context, formats strfmt.Registry) error { - - if m.LastSuccessfulBackup != nil { - if err := m.LastSuccessfulBackup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lastSuccessfulBackup") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupModel) contextValidateNotifications(ctx context.Context, formats strfmt.Registry) error { - - if m.Notifications != nil { - if err := m.Notifications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("notifications") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupModel) contextValidateSchedule(ctx context.Context, formats strfmt.Registry) error { - - if m.Schedule != nil { - if err := m.Schedule.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schedule") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigBackupModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigBackupModel) UnmarshalBinary(b []byte) error { - var res ConfigBackupModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/config_backup_notifications_model.go b/models/config_backup_notifications_model.go deleted file mode 100644 index e0abc7e..0000000 --- a/models/config_backup_notifications_model.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigBackupNotificationsModel Notification settings. -// -// swagger:model ConfigBackupNotificationsModel -type ConfigBackupNotificationsModel struct { - - // SMTP settings - SMTPSettings *ConfigBackupSMTPSettigsModel `json:"SMTPSettings,omitempty"` - - // If *true*, SNMP traps are enabled for this job. - // Required: true - SNMPEnabled *bool `json:"SNMPEnabled"` -} - -// Validate validates this config backup notifications model -func (m *ConfigBackupNotificationsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSMTPSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSNMPEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupNotificationsModel) validateSMTPSettings(formats strfmt.Registry) error { - if swag.IsZero(m.SMTPSettings) { // not required - return nil - } - - if m.SMTPSettings != nil { - if err := m.SMTPSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("SMTPSettings") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupNotificationsModel) validateSNMPEnabled(formats strfmt.Registry) error { - - if err := validate.Required("SNMPEnabled", "body", m.SNMPEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this config backup notifications model based on the context it is used -func (m *ConfigBackupNotificationsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSMTPSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupNotificationsModel) contextValidateSMTPSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.SMTPSettings != nil { - if err := m.SMTPSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("SMTPSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigBackupNotificationsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigBackupNotificationsModel) UnmarshalBinary(b []byte) error { - var res ConfigBackupNotificationsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/config_backup_schedule_model.go b/models/config_backup_schedule_model.go deleted file mode 100644 index 6f186b6..0000000 --- a/models/config_backup_schedule_model.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigBackupScheduleModel Scheduling settings. -// -// swagger:model ConfigBackupScheduleModel -type ConfigBackupScheduleModel struct { - - // daily - Daily *ScheduleDailyModel `json:"daily,omitempty"` - - // If *true*, backup scheduling is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // monthly - Monthly *ScheduleMonthlyModel `json:"monthly,omitempty"` -} - -// Validate validates this config backup schedule model -func (m *ConfigBackupScheduleModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDaily(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMonthly(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupScheduleModel) validateDaily(formats strfmt.Registry) error { - if swag.IsZero(m.Daily) { // not required - return nil - } - - if m.Daily != nil { - if err := m.Daily.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("daily") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupScheduleModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupScheduleModel) validateMonthly(formats strfmt.Registry) error { - if swag.IsZero(m.Monthly) { // not required - return nil - } - - if m.Monthly != nil { - if err := m.Monthly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -// ContextValidate validate this config backup schedule model based on the context it is used -func (m *ConfigBackupScheduleModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDaily(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMonthly(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupScheduleModel) contextValidateDaily(ctx context.Context, formats strfmt.Registry) error { - - if m.Daily != nil { - if err := m.Daily.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("daily") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupScheduleModel) contextValidateMonthly(ctx context.Context, formats strfmt.Registry) error { - - if m.Monthly != nil { - if err := m.Monthly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigBackupScheduleModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigBackupScheduleModel) UnmarshalBinary(b []byte) error { - var res ConfigBackupScheduleModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/config_backup_smtp_settigs_model.go b/models/config_backup_smtp_settigs_model.go deleted file mode 100644 index f4d39ff..0000000 --- a/models/config_backup_smtp_settigs_model.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigBackupSMTPSettigsModel Email notification settings. -// -// swagger:model ConfigBackupSMTPSettigsModel -type ConfigBackupSMTPSettigsModel struct { - - // If *true*, email notifications are enabled for this job. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // If *true*, email notifications are sent when the job fails. - // Required: true - NotifyOnError *bool `json:"notifyOnError"` - - // If *true*, email notifications are sent when the job completes successfully. - // Required: true - NotifyOnSuccess *bool `json:"notifyOnSuccess"` - - // If *true*, email notifications are sent when the job completes with a warning. - // Required: true - NotifyOnWarning *bool `json:"notifyOnWarning"` - - // Array of recipients' email addresses. - // Required: true - Recipients []string `json:"recipients"` - - // settings type - // Required: true - SettingsType *EConfigBackupSMTPSettingsType `json:"settingsType"` - - // Notification subject. Use the following variables in the subject: *%JobResult%*, *%JobName%*, *%Time%* (completion time). - // - // Required: true - Subject *string `json:"subject"` -} - -// Validate validates this config backup SMTP settigs model -func (m *ConfigBackupSMTPSettigsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnError(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnSuccess(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnWarning(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecipients(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSettingsType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubject(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupSMTPSettigsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupSMTPSettigsModel) validateNotifyOnError(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnError", "body", m.NotifyOnError); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupSMTPSettigsModel) validateNotifyOnSuccess(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnSuccess", "body", m.NotifyOnSuccess); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupSMTPSettigsModel) validateNotifyOnWarning(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnWarning", "body", m.NotifyOnWarning); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupSMTPSettigsModel) validateRecipients(formats strfmt.Registry) error { - - if err := validate.Required("recipients", "body", m.Recipients); err != nil { - return err - } - - return nil -} - -func (m *ConfigBackupSMTPSettigsModel) validateSettingsType(formats strfmt.Registry) error { - - if err := validate.Required("settingsType", "body", m.SettingsType); err != nil { - return err - } - - if err := validate.Required("settingsType", "body", m.SettingsType); err != nil { - return err - } - - if m.SettingsType != nil { - if err := m.SettingsType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("settingsType") - } - return err - } - } - - return nil -} - -func (m *ConfigBackupSMTPSettigsModel) validateSubject(formats strfmt.Registry) error { - - if err := validate.Required("subject", "body", m.Subject); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this config backup SMTP settigs model based on the context it is used -func (m *ConfigBackupSMTPSettigsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSettingsType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigBackupSMTPSettigsModel) contextValidateSettingsType(ctx context.Context, formats strfmt.Registry) error { - - if m.SettingsType != nil { - if err := m.SettingsType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("settingsType") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigBackupSMTPSettigsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigBackupSMTPSettigsModel) UnmarshalBinary(b []byte) error { - var res ConfigBackupSMTPSettigsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/connection_certificate_model.go b/models/connection_certificate_model.go deleted file mode 100644 index adc157d..0000000 --- a/models/connection_certificate_model.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ConnectionCertificateModel connection certificate model -// -// swagger:model ConnectionCertificateModel -type ConnectionCertificateModel struct { - - // certificate - Certificate *CertificateModel `json:"certificate,omitempty"` - - // SSH key fingerprint used to verify the server identity. - Fingerprint string `json:"fingerprint,omitempty"` -} - -// Validate validates this connection certificate model -func (m *ConnectionCertificateModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertificate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConnectionCertificateModel) validateCertificate(formats strfmt.Registry) error { - if swag.IsZero(m.Certificate) { // not required - return nil - } - - if m.Certificate != nil { - if err := m.Certificate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certificate") - } - return err - } - } - - return nil -} - -// ContextValidate validate this connection certificate model based on the context it is used -func (m *ConnectionCertificateModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCertificate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConnectionCertificateModel) contextValidateCertificate(ctx context.Context, formats strfmt.Registry) error { - - if m.Certificate != nil { - if err := m.Certificate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certificate") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConnectionCertificateModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConnectionCertificateModel) UnmarshalBinary(b []byte) error { - var res ConnectionCertificateModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_export_spec.go b/models/credentials_export_spec.go deleted file mode 100644 index f478219..0000000 --- a/models/credentials_export_spec.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CredentialsExportSpec credentials export spec -// -// swagger:model CredentialsExportSpec -type CredentialsExportSpec struct { - - // Array of credentials IDs. - // Unique: true - Ids []strfmt.UUID `json:"ids"` - - // Array of credentials user names. Wildcard characters are supported. - // Unique: true - Names []string `json:"names"` - - // If *true*, service credentials are exported. - ShowHiddenCreds bool `json:"showHiddenCreds,omitempty"` - - // Array of credentials types. - // Unique: true - Types []ECredentialsType `json:"types"` -} - -// Validate validates this credentials export spec -func (m *CredentialsExportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNames(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsExportSpec) validateIds(formats strfmt.Registry) error { - if swag.IsZero(m.Ids) { // not required - return nil - } - - if err := validate.UniqueItems("ids", "body", m.Ids); err != nil { - return err - } - - for i := 0; i < len(m.Ids); i++ { - - if err := validate.FormatOf("ids"+"."+strconv.Itoa(i), "body", "uuid", m.Ids[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -func (m *CredentialsExportSpec) validateNames(formats strfmt.Registry) error { - if swag.IsZero(m.Names) { // not required - return nil - } - - if err := validate.UniqueItems("names", "body", m.Names); err != nil { - return err - } - - return nil -} - -func (m *CredentialsExportSpec) validateTypes(formats strfmt.Registry) error { - if swag.IsZero(m.Types) { // not required - return nil - } - - if err := validate.UniqueItems("types", "body", m.Types); err != nil { - return err - } - - for i := 0; i < len(m.Types); i++ { - - if err := m.Types[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("types" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this credentials export spec based on the context it is used -func (m *CredentialsExportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsExportSpec) contextValidateTypes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Types); i++ { - - if err := m.Types[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("types" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsExportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsExportSpec) UnmarshalBinary(b []byte) error { - var res CredentialsExportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_filters.go b/models/credentials_filters.go deleted file mode 100644 index 44e09cb..0000000 --- a/models/credentials_filters.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CredentialsFilters credentials filters -// -// swagger:model CredentialsFilters -type CredentialsFilters struct { - - // Maximum number of credentials records to return. - Limit int32 `json:"limit,omitempty"` - - // Filters credentials by the `nameFilter` pattern. The pattern can match any credentials parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - NameFilter string `json:"nameFilter,omitempty"` - - // Sorts credentials in the ascending order by the `orderColumn` parameter. - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn ECredentialsFiltersOrderColumn `json:"orderColumn,omitempty"` - - // Number of credentials records to skip. - Skip int32 `json:"skip,omitempty"` -} - -// Validate validates this credentials filters -func (m *CredentialsFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// ContextValidate validate this credentials filters based on the context it is used -func (m *CredentialsFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsFilters) UnmarshalBinary(b []byte) error { - var res CredentialsFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_import_model.go b/models/credentials_import_model.go deleted file mode 100644 index bca22a1..0000000 --- a/models/credentials_import_model.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CredentialsImportModel credentials import model -// -// swagger:model CredentialsImportModel -type CredentialsImportModel struct { - - // User name, account name or access key. - // Required: true - CredentialsName *string `json:"credentialsName"` - - // Tag used to identify the credentials record. - CredentialsTag string `json:"credentialsTag,omitempty"` -} - -// Validate validates this credentials import model -func (m *CredentialsImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentialsName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsImportModel) validateCredentialsName(formats strfmt.Registry) error { - - if err := validate.Required("credentialsName", "body", m.CredentialsName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this credentials import model based on context it is used -func (m *CredentialsImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsImportModel) UnmarshalBinary(b []byte) error { - var res CredentialsImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_import_spec.go b/models/credentials_import_spec.go deleted file mode 100644 index a5ac00a..0000000 --- a/models/credentials_import_spec.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CredentialsImportSpec credentials import spec -// -// swagger:model CredentialsImportSpec -type CredentialsImportSpec struct { - - // Description of the credentials record. - Description string `json:"description,omitempty"` - - // linux additional settings - LinuxAdditionalSettings *CredentialsLinuxSettingsImportModel `json:"linuxAdditionalSettings,omitempty"` - - // Password. - Password string `json:"password,omitempty"` - - // Tag used to identify the credentials record. - // Required: true - Tag *string `json:"tag"` - - // type - // Required: true - Type *ECredentialsType `json:"type"` - - // User name. - // Required: true - Username *string `json:"username"` -} - -// Validate validates this credentials import spec -func (m *CredentialsImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinuxAdditionalSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsername(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsImportSpec) validateLinuxAdditionalSettings(formats strfmt.Registry) error { - if swag.IsZero(m.LinuxAdditionalSettings) { // not required - return nil - } - - if m.LinuxAdditionalSettings != nil { - if err := m.LinuxAdditionalSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("linuxAdditionalSettings") - } - return err - } - } - - return nil -} - -func (m *CredentialsImportSpec) validateTag(formats strfmt.Registry) error { - - if err := validate.Required("tag", "body", m.Tag); err != nil { - return err - } - - return nil -} - -func (m *CredentialsImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *CredentialsImportSpec) validateUsername(formats strfmt.Registry) error { - - if err := validate.Required("username", "body", m.Username); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this credentials import spec based on the context it is used -func (m *CredentialsImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinuxAdditionalSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsImportSpec) contextValidateLinuxAdditionalSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.LinuxAdditionalSettings != nil { - if err := m.LinuxAdditionalSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("linuxAdditionalSettings") - } - return err - } - } - - return nil -} - -func (m *CredentialsImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsImportSpec) UnmarshalBinary(b []byte) error { - var res CredentialsImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_import_spec_collection.go b/models/credentials_import_spec_collection.go deleted file mode 100644 index 2e455c5..0000000 --- a/models/credentials_import_spec_collection.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CredentialsImportSpecCollection credentials import spec collection -// -// swagger:model CredentialsImportSpecCollection -type CredentialsImportSpecCollection struct { - - // Array of credentials. - // Required: true - // Unique: true - Credentials []*CredentialsImportSpec `json:"credentials"` -} - -// Validate validates this credentials import spec collection -func (m *CredentialsImportSpecCollection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentials(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsImportSpecCollection) validateCredentials(formats strfmt.Registry) error { - - if err := validate.Required("credentials", "body", m.Credentials); err != nil { - return err - } - - if err := validate.UniqueItems("credentials", "body", m.Credentials); err != nil { - return err - } - - for i := 0; i < len(m.Credentials); i++ { - if swag.IsZero(m.Credentials[i]) { // not required - continue - } - - if m.Credentials[i] != nil { - if err := m.Credentials[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this credentials import spec collection based on the context it is used -func (m *CredentialsImportSpecCollection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCredentials(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsImportSpecCollection) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Credentials); i++ { - - if m.Credentials[i] != nil { - if err := m.Credentials[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsImportSpecCollection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsImportSpecCollection) UnmarshalBinary(b []byte) error { - var res CredentialsImportSpecCollection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_linux_settings_import_model.go b/models/credentials_linux_settings_import_model.go deleted file mode 100644 index 6efca3d..0000000 --- a/models/credentials_linux_settings_import_model.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CredentialsLinuxSettingsImportModel credentials linux settings import model -// -// swagger:model CredentialsLinuxSettingsImportModel -type CredentialsLinuxSettingsImportModel struct { - - // SSH port used to connect to a Linux server. - SSHPort int64 `json:"SSHPort,omitempty"` - - // If *true*, the account is automatically added to the sudoers file. - AddToSudoers bool `json:"addToSudoers,omitempty"` - - // If *true*, the permissions of the account are automatically elevated to the root user. - AutoElevated bool `json:"autoElevated,omitempty"` - - // Passphrase that protects the private key. - Passphrase string `json:"passphrase,omitempty"` - - // Private key. - PrivateKey string `json:"privateKey,omitempty"` - - // Password for the root account. - RootPassword string `json:"rootPassword,omitempty"` - - // If *true*, the `su` command is used for Linux distributions where the `sudo` command is not available. - UseSu bool `json:"useSu,omitempty"` -} - -// Validate validates this credentials linux settings import model -func (m *CredentialsLinuxSettingsImportModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this credentials linux settings import model based on context it is used -func (m *CredentialsLinuxSettingsImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsLinuxSettingsImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsLinuxSettingsImportModel) UnmarshalBinary(b []byte) error { - var res CredentialsLinuxSettingsImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_model.go b/models/credentials_model.go deleted file mode 100644 index ed9c208..0000000 --- a/models/credentials_model.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CredentialsModel credentials model -// -// swagger:model CredentialsModel -type CredentialsModel struct { - - // Date and time when the credentials were created. - // Required: true - // Format: date-time - CreationTime *strfmt.DateTime `json:"creationTime"` - - // Description of the credentials record. - // Required: true - Description *string `json:"description"` - - // ID of the credentials record. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // type - // Required: true - Type *ECredentialsType `json:"type"` - - // User name. - // Required: true - Username *string `json:"username"` -} - -// Validate validates this credentials model -func (m *CredentialsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsername(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsModel) validateCreationTime(formats strfmt.Registry) error { - - if err := validate.Required("creationTime", "body", m.CreationTime); err != nil { - return err - } - - if err := validate.FormatOf("creationTime", "body", "date-time", m.CreationTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CredentialsModel) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *CredentialsModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CredentialsModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *CredentialsModel) validateUsername(formats strfmt.Registry) error { - - if err := validate.Required("username", "body", m.Username); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this credentials model based on the context it is used -func (m *CredentialsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsModel) UnmarshalBinary(b []byte) error { - var res CredentialsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_password_change_spec.go b/models/credentials_password_change_spec.go deleted file mode 100644 index 7b14d79..0000000 --- a/models/credentials_password_change_spec.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CredentialsPasswordChangeSpec credentials password change spec -// -// swagger:model CredentialsPasswordChangeSpec -type CredentialsPasswordChangeSpec struct { - - // New password. - // Required: true - Password *string `json:"password"` -} - -// Validate validates this credentials password change spec -func (m *CredentialsPasswordChangeSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePassword(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsPasswordChangeSpec) validatePassword(formats strfmt.Registry) error { - - if err := validate.Required("password", "body", m.Password); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this credentials password change spec based on context it is used -func (m *CredentialsPasswordChangeSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsPasswordChangeSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsPasswordChangeSpec) UnmarshalBinary(b []byte) error { - var res CredentialsPasswordChangeSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_result.go b/models/credentials_result.go deleted file mode 100644 index febceab..0000000 --- a/models/credentials_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CredentialsResult credentials result -// -// swagger:model CredentialsResult -type CredentialsResult struct { - - // Array of credentials. - // Required: true - Data []*CredentialsModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this credentials result -func (m *CredentialsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *CredentialsResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this credentials result based on the context it is used -func (m *CredentialsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *CredentialsResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsResult) UnmarshalBinary(b []byte) error { - var res CredentialsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/credentials_spec.go b/models/credentials_spec.go deleted file mode 100644 index e0781c1..0000000 --- a/models/credentials_spec.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CredentialsSpec credentials spec -// -// swagger:model CredentialsSpec -type CredentialsSpec struct { - - // Description of the credentials record. - Description string `json:"description,omitempty"` - - // Password. - Password string `json:"password,omitempty"` - - // type - // Required: true - Type *ECredentialsType `json:"type"` - - // User name. - // Required: true - Username *string `json:"username"` -} - -// Validate validates this credentials spec -func (m *CredentialsSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsername(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *CredentialsSpec) validateUsername(formats strfmt.Registry) error { - - if err := validate.Required("username", "body", m.Username); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this credentials spec based on the context it is used -func (m *CredentialsSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CredentialsSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CredentialsSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CredentialsSpec) UnmarshalBinary(b []byte) error { - var res CredentialsSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/delete_repository_filters.go b/models/delete_repository_filters.go deleted file mode 100644 index 3b60542..0000000 --- a/models/delete_repository_filters.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeleteRepositoryFilters delete repository filters -// -// swagger:model DeleteRepositoryFilters -type DeleteRepositoryFilters struct { - - // delete backups - DeleteBackups bool `json:"deleteBackups,omitempty"` -} - -// Validate validates this delete repository filters -func (m *DeleteRepositoryFilters) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this delete repository filters based on context it is used -func (m *DeleteRepositoryFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DeleteRepositoryFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeleteRepositoryFilters) UnmarshalBinary(b []byte) error { - var res DeleteRepositoryFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/e_allowed_backups_type.go b/models/e_allowed_backups_type.go deleted file mode 100644 index 4ddf581..0000000 --- a/models/e_allowed_backups_type.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EAllowedBackupsType Type of backup files that can be stored on the extent. -// -// swagger:model EAllowedBackupsType -type EAllowedBackupsType string - -func NewEAllowedBackupsType(value EAllowedBackupsType) *EAllowedBackupsType { - v := value - return &v -} - -const ( - - // EAllowedBackupsTypeAll captures enum value "All" - EAllowedBackupsTypeAll EAllowedBackupsType = "All" - - // EAllowedBackupsTypeFullsOnly captures enum value "FullsOnly" - EAllowedBackupsTypeFullsOnly EAllowedBackupsType = "FullsOnly" - - // EAllowedBackupsTypeIncrementsOnly captures enum value "IncrementsOnly" - EAllowedBackupsTypeIncrementsOnly EAllowedBackupsType = "IncrementsOnly" -) - -// for schema -var eAllowedBackupsTypeEnum []interface{} - -func init() { - var res []EAllowedBackupsType - if err := json.Unmarshal([]byte(`["All","FullsOnly","IncrementsOnly"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eAllowedBackupsTypeEnum = append(eAllowedBackupsTypeEnum, v) - } -} - -func (m EAllowedBackupsType) validateEAllowedBackupsTypeEnum(path, location string, value EAllowedBackupsType) error { - if err := validate.EnumCase(path, location, value, eAllowedBackupsTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e allowed backups type -func (m EAllowedBackupsType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEAllowedBackupsTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e allowed backups type based on context it is used -func (m EAllowedBackupsType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_application_settings_v_s_s.go b/models/e_application_settings_v_s_s.go deleted file mode 100644 index a6e0105..0000000 --- a/models/e_application_settings_v_s_s.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EApplicationSettingsVSS Behavior scenario for application-aware processing. -// -// swagger:model EApplicationSettingsVSS -type EApplicationSettingsVSS string - -func NewEApplicationSettingsVSS(value EApplicationSettingsVSS) *EApplicationSettingsVSS { - v := value - return &v -} - -const ( - - // EApplicationSettingsVSSRequireSuccess captures enum value "requireSuccess" - EApplicationSettingsVSSRequireSuccess EApplicationSettingsVSS = "requireSuccess" - - // EApplicationSettingsVSSIgnoreFailures captures enum value "ignoreFailures" - EApplicationSettingsVSSIgnoreFailures EApplicationSettingsVSS = "ignoreFailures" - - // EApplicationSettingsVSSDisabled captures enum value "disabled" - EApplicationSettingsVSSDisabled EApplicationSettingsVSS = "disabled" -) - -// for schema -var eApplicationSettingsVSSEnum []interface{} - -func init() { - var res []EApplicationSettingsVSS - if err := json.Unmarshal([]byte(`["requireSuccess","ignoreFailures","disabled"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eApplicationSettingsVSSEnum = append(eApplicationSettingsVSSEnum, v) - } -} - -func (m EApplicationSettingsVSS) validateEApplicationSettingsVSSEnum(path, location string, value EApplicationSettingsVSS) error { - if err := validate.EnumCase(path, location, value, eApplicationSettingsVSSEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e application settings v s s -func (m EApplicationSettingsVSS) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEApplicationSettingsVSSEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e application settings v s s based on context it is used -func (m EApplicationSettingsVSS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_backup_exclusion_policy.go b/models/e_backup_exclusion_policy.go deleted file mode 100644 index 7758f66..0000000 --- a/models/e_backup_exclusion_policy.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EBackupExclusionPolicy Exclusion policy. -// -// swagger:model EBackupExclusionPolicy -type EBackupExclusionPolicy string - -func NewEBackupExclusionPolicy(value EBackupExclusionPolicy) *EBackupExclusionPolicy { - v := value - return &v -} - -const ( - - // EBackupExclusionPolicyDisabled captures enum value "disabled" - EBackupExclusionPolicyDisabled EBackupExclusionPolicy = "disabled" - - // EBackupExclusionPolicyExcludeOnly captures enum value "excludeOnly" - EBackupExclusionPolicyExcludeOnly EBackupExclusionPolicy = "excludeOnly" - - // EBackupExclusionPolicyIncludeOnly captures enum value "includeOnly" - EBackupExclusionPolicyIncludeOnly EBackupExclusionPolicy = "includeOnly" -) - -// for schema -var eBackupExclusionPolicyEnum []interface{} - -func init() { - var res []EBackupExclusionPolicy - if err := json.Unmarshal([]byte(`["disabled","excludeOnly","includeOnly"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eBackupExclusionPolicyEnum = append(eBackupExclusionPolicyEnum, v) - } -} - -func (m EBackupExclusionPolicy) validateEBackupExclusionPolicyEnum(path, location string, value EBackupExclusionPolicy) error { - if err := validate.EnumCase(path, location, value, eBackupExclusionPolicyEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e backup exclusion policy -func (m EBackupExclusionPolicy) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEBackupExclusionPolicyEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e backup exclusion policy based on context it is used -func (m EBackupExclusionPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_backup_mode_type.go b/models/e_backup_mode_type.go deleted file mode 100644 index 500f678..0000000 --- a/models/e_backup_mode_type.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EBackupModeType Type of the backup method used to create a restore point. -// -// swagger:model EBackupModeType -type EBackupModeType string - -func NewEBackupModeType(value EBackupModeType) *EBackupModeType { - v := value - return &v -} - -const ( - - // EBackupModeTypeFull captures enum value "Full" - EBackupModeTypeFull EBackupModeType = "Full" - - // EBackupModeTypeIncremental captures enum value "Incremental" - EBackupModeTypeIncremental EBackupModeType = "Incremental" - - // EBackupModeTypeReverseIncremental captures enum value "ReverseIncremental" - EBackupModeTypeReverseIncremental EBackupModeType = "ReverseIncremental" - - // EBackupModeTypeTransofrm captures enum value "Transofrm" - EBackupModeTypeTransofrm EBackupModeType = "Transofrm" - - // EBackupModeTypeTransformForeverIncremental captures enum value "TransformForeverIncremental" - EBackupModeTypeTransformForeverIncremental EBackupModeType = "TransformForeverIncremental" -) - -// for schema -var eBackupModeTypeEnum []interface{} - -func init() { - var res []EBackupModeType - if err := json.Unmarshal([]byte(`["Full","Incremental","ReverseIncremental","Transofrm","TransformForeverIncremental"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eBackupModeTypeEnum = append(eBackupModeTypeEnum, v) - } -} - -func (m EBackupModeType) validateEBackupModeTypeEnum(path, location string, value EBackupModeType) error { - if err := validate.EnumCase(path, location, value, eBackupModeTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e backup mode type -func (m EBackupModeType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEBackupModeTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e backup mode type based on context it is used -func (m EBackupModeType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_backup_objects_filters_order_column.go b/models/e_backup_objects_filters_order_column.go deleted file mode 100644 index 31f86ba..0000000 --- a/models/e_backup_objects_filters_order_column.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EBackupObjectsFiltersOrderColumn e backup objects filters order column -// -// swagger:model EBackupObjectsFiltersOrderColumn -type EBackupObjectsFiltersOrderColumn string - -func NewEBackupObjectsFiltersOrderColumn(value EBackupObjectsFiltersOrderColumn) *EBackupObjectsFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EBackupObjectsFiltersOrderColumnName captures enum value "Name" - EBackupObjectsFiltersOrderColumnName EBackupObjectsFiltersOrderColumn = "Name" - - // EBackupObjectsFiltersOrderColumnObjectID captures enum value "ObjectId" - EBackupObjectsFiltersOrderColumnObjectID EBackupObjectsFiltersOrderColumn = "ObjectId" - - // EBackupObjectsFiltersOrderColumnPlatformID captures enum value "PlatformId" - EBackupObjectsFiltersOrderColumnPlatformID EBackupObjectsFiltersOrderColumn = "PlatformId" - - // EBackupObjectsFiltersOrderColumnType captures enum value "Type" - EBackupObjectsFiltersOrderColumnType EBackupObjectsFiltersOrderColumn = "Type" -) - -// for schema -var eBackupObjectsFiltersOrderColumnEnum []interface{} - -func init() { - var res []EBackupObjectsFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","ObjectId","PlatformId","Type"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eBackupObjectsFiltersOrderColumnEnum = append(eBackupObjectsFiltersOrderColumnEnum, v) - } -} - -func (m EBackupObjectsFiltersOrderColumn) validateEBackupObjectsFiltersOrderColumnEnum(path, location string, value EBackupObjectsFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eBackupObjectsFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e backup objects filters order column -func (m EBackupObjectsFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEBackupObjectsFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e backup objects filters order column based on context it is used -func (m EBackupObjectsFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_backup_oracle_logs_settings.go b/models/e_backup_oracle_logs_settings.go deleted file mode 100644 index f2d7139..0000000 --- a/models/e_backup_oracle_logs_settings.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EBackupOracleLogsSettings Type of archived logs processing. -// -// swagger:model EBackupOracleLogsSettings -type EBackupOracleLogsSettings string - -func NewEBackupOracleLogsSettings(value EBackupOracleLogsSettings) *EBackupOracleLogsSettings { - v := value - return &v -} - -const ( - - // EBackupOracleLogsSettingsPreserve captures enum value "preserve" - EBackupOracleLogsSettingsPreserve EBackupOracleLogsSettings = "preserve" - - // EBackupOracleLogsSettingsDeleteExpiredHours captures enum value "deleteExpiredHours" - EBackupOracleLogsSettingsDeleteExpiredHours EBackupOracleLogsSettings = "deleteExpiredHours" - - // EBackupOracleLogsSettingsDeleteExpiredGBs captures enum value "deleteExpiredGBs" - EBackupOracleLogsSettingsDeleteExpiredGBs EBackupOracleLogsSettings = "deleteExpiredGBs" -) - -// for schema -var eBackupOracleLogsSettingsEnum []interface{} - -func init() { - var res []EBackupOracleLogsSettings - if err := json.Unmarshal([]byte(`["preserve","deleteExpiredHours","deleteExpiredGBs"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eBackupOracleLogsSettingsEnum = append(eBackupOracleLogsSettingsEnum, v) - } -} - -func (m EBackupOracleLogsSettings) validateEBackupOracleLogsSettingsEnum(path, location string, value EBackupOracleLogsSettings) error { - if err := validate.EnumCase(path, location, value, eBackupOracleLogsSettingsEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e backup oracle logs settings -func (m EBackupOracleLogsSettings) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEBackupOracleLogsSettingsEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e backup oracle logs settings based on context it is used -func (m EBackupOracleLogsSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_backup_proxy_import_type.go b/models/e_backup_proxy_import_type.go deleted file mode 100644 index 4d67e07..0000000 --- a/models/e_backup_proxy_import_type.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EBackupProxyImportType e backup proxy import type -// -// swagger:model EBackupProxyImportType -type EBackupProxyImportType string - -func NewEBackupProxyImportType(value EBackupProxyImportType) *EBackupProxyImportType { - v := value - return &v -} - -const ( - - // EBackupProxyImportTypeVmware captures enum value "vmware" - EBackupProxyImportTypeVmware EBackupProxyImportType = "vmware" -) - -// for schema -var eBackupProxyImportTypeEnum []interface{} - -func init() { - var res []EBackupProxyImportType - if err := json.Unmarshal([]byte(`["vmware"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eBackupProxyImportTypeEnum = append(eBackupProxyImportTypeEnum, v) - } -} - -func (m EBackupProxyImportType) validateEBackupProxyImportTypeEnum(path, location string, value EBackupProxyImportType) error { - if err := validate.EnumCase(path, location, value, eBackupProxyImportTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e backup proxy import type -func (m EBackupProxyImportType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEBackupProxyImportTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e backup proxy import type based on context it is used -func (m EBackupProxyImportType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_backup_proxy_transport_mode.go b/models/e_backup_proxy_transport_mode.go deleted file mode 100644 index 887eee4..0000000 --- a/models/e_backup_proxy_transport_mode.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EBackupProxyTransportMode Transport mode of the backup proxy. -// -// swagger:model EBackupProxyTransportMode -type EBackupProxyTransportMode string - -func NewEBackupProxyTransportMode(value EBackupProxyTransportMode) *EBackupProxyTransportMode { - v := value - return &v -} - -const ( - - // EBackupProxyTransportModeAuto captures enum value "auto" - EBackupProxyTransportModeAuto EBackupProxyTransportMode = "auto" - - // EBackupProxyTransportModeDirectAccess captures enum value "directAccess" - EBackupProxyTransportModeDirectAccess EBackupProxyTransportMode = "directAccess" - - // EBackupProxyTransportModeVirtualAppliance captures enum value "virtualAppliance" - EBackupProxyTransportModeVirtualAppliance EBackupProxyTransportMode = "virtualAppliance" - - // EBackupProxyTransportModeNetwork captures enum value "network" - EBackupProxyTransportModeNetwork EBackupProxyTransportMode = "network" -) - -// for schema -var eBackupProxyTransportModeEnum []interface{} - -func init() { - var res []EBackupProxyTransportMode - if err := json.Unmarshal([]byte(`["auto","directAccess","virtualAppliance","network"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eBackupProxyTransportModeEnum = append(eBackupProxyTransportModeEnum, v) - } -} - -func (m EBackupProxyTransportMode) validateEBackupProxyTransportModeEnum(path, location string, value EBackupProxyTransportMode) error { - if err := validate.EnumCase(path, location, value, eBackupProxyTransportModeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e backup proxy transport mode -func (m EBackupProxyTransportMode) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEBackupProxyTransportModeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e backup proxy transport mode based on context it is used -func (m EBackupProxyTransportMode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_backup_script_processing_mode.go b/models/e_backup_script_processing_mode.go deleted file mode 100644 index 9858d90..0000000 --- a/models/e_backup_script_processing_mode.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EBackupScriptProcessingMode Scenario for scripts execution. -// -// swagger:model EBackupScriptProcessingMode -type EBackupScriptProcessingMode string - -func NewEBackupScriptProcessingMode(value EBackupScriptProcessingMode) *EBackupScriptProcessingMode { - v := value - return &v -} - -const ( - - // EBackupScriptProcessingModeDisableExec captures enum value "disableExec" - EBackupScriptProcessingModeDisableExec EBackupScriptProcessingMode = "disableExec" - - // EBackupScriptProcessingModeIgnoreExecFailures captures enum value "ignoreExecFailures" - EBackupScriptProcessingModeIgnoreExecFailures EBackupScriptProcessingMode = "ignoreExecFailures" - - // EBackupScriptProcessingModeRequireSuccess captures enum value "requireSuccess" - EBackupScriptProcessingModeRequireSuccess EBackupScriptProcessingMode = "requireSuccess" -) - -// for schema -var eBackupScriptProcessingModeEnum []interface{} - -func init() { - var res []EBackupScriptProcessingMode - if err := json.Unmarshal([]byte(`["disableExec","ignoreExecFailures","requireSuccess"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eBackupScriptProcessingModeEnum = append(eBackupScriptProcessingModeEnum, v) - } -} - -func (m EBackupScriptProcessingMode) validateEBackupScriptProcessingModeEnum(path, location string, value EBackupScriptProcessingMode) error { - if err := validate.EnumCase(path, location, value, eBackupScriptProcessingModeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e backup script processing mode -func (m EBackupScriptProcessingMode) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEBackupScriptProcessingModeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e backup script processing mode based on context it is used -func (m EBackupScriptProcessingMode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_backups_filters_order_column.go b/models/e_backups_filters_order_column.go deleted file mode 100644 index e1fae33..0000000 --- a/models/e_backups_filters_order_column.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EBackupsFiltersOrderColumn e backups filters order column -// -// swagger:model EBackupsFiltersOrderColumn -type EBackupsFiltersOrderColumn string - -func NewEBackupsFiltersOrderColumn(value EBackupsFiltersOrderColumn) *EBackupsFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EBackupsFiltersOrderColumnName captures enum value "Name" - EBackupsFiltersOrderColumnName EBackupsFiltersOrderColumn = "Name" - - // EBackupsFiltersOrderColumnCreationTime captures enum value "CreationTime" - EBackupsFiltersOrderColumnCreationTime EBackupsFiltersOrderColumn = "CreationTime" - - // EBackupsFiltersOrderColumnPlatformID captures enum value "PlatformId" - EBackupsFiltersOrderColumnPlatformID EBackupsFiltersOrderColumn = "PlatformId" - - // EBackupsFiltersOrderColumnJobID captures enum value "JobId" - EBackupsFiltersOrderColumnJobID EBackupsFiltersOrderColumn = "JobId" - - // EBackupsFiltersOrderColumnPolicyTag captures enum value "PolicyTag" - EBackupsFiltersOrderColumnPolicyTag EBackupsFiltersOrderColumn = "PolicyTag" -) - -// for schema -var eBackupsFiltersOrderColumnEnum []interface{} - -func init() { - var res []EBackupsFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","CreationTime","PlatformId","JobId","PolicyTag"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eBackupsFiltersOrderColumnEnum = append(eBackupsFiltersOrderColumnEnum, v) - } -} - -func (m EBackupsFiltersOrderColumn) validateEBackupsFiltersOrderColumnEnum(path, location string, value EBackupsFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eBackupsFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e backups filters order column -func (m EBackupsFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEBackupsFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e backups filters order column based on context it is used -func (m EBackupsFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_compression_level.go b/models/e_compression_level.go deleted file mode 100644 index 63a9a6a..0000000 --- a/models/e_compression_level.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ECompressionLevel Compression level. -// -// swagger:model ECompressionLevel -type ECompressionLevel string - -func NewECompressionLevel(value ECompressionLevel) *ECompressionLevel { - v := value - return &v -} - -const ( - - // ECompressionLevelAuto captures enum value "Auto" - ECompressionLevelAuto ECompressionLevel = "Auto" - - // ECompressionLevelNone captures enum value "None" - ECompressionLevelNone ECompressionLevel = "None" - - // ECompressionLevelDedupFriendly captures enum value "DedupFriendly" - ECompressionLevelDedupFriendly ECompressionLevel = "DedupFriendly" - - // ECompressionLevelOptimal captures enum value "Optimal" - ECompressionLevelOptimal ECompressionLevel = "Optimal" - - // ECompressionLevelHigh captures enum value "High" - ECompressionLevelHigh ECompressionLevel = "High" - - // ECompressionLevelExtreme captures enum value "Extreme" - ECompressionLevelExtreme ECompressionLevel = "Extreme" -) - -// for schema -var eCompressionLevelEnum []interface{} - -func init() { - var res []ECompressionLevel - if err := json.Unmarshal([]byte(`["Auto","None","DedupFriendly","Optimal","High","Extreme"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eCompressionLevelEnum = append(eCompressionLevelEnum, v) - } -} - -func (m ECompressionLevel) validateECompressionLevelEnum(path, location string, value ECompressionLevel) error { - if err := validate.EnumCase(path, location, value, eCompressionLevelEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e compression level -func (m ECompressionLevel) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateECompressionLevelEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e compression level based on context it is used -func (m ECompressionLevel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_config_backup_smtp_settings_type.go b/models/e_config_backup_smtp_settings_type.go deleted file mode 100644 index 4f36d4f..0000000 --- a/models/e_config_backup_smtp_settings_type.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EConfigBackupSMTPSettingsType Type of notification settings. -// -// swagger:model EConfigBackupSMTPSettingsType -type EConfigBackupSMTPSettingsType string - -func NewEConfigBackupSMTPSettingsType(value EConfigBackupSMTPSettingsType) *EConfigBackupSMTPSettingsType { - v := value - return &v -} - -const ( - - // EConfigBackupSMTPSettingsTypeGlobal captures enum value "Global" - EConfigBackupSMTPSettingsTypeGlobal EConfigBackupSMTPSettingsType = "Global" - - // EConfigBackupSMTPSettingsTypeCustom captures enum value "Custom" - EConfigBackupSMTPSettingsTypeCustom EConfigBackupSMTPSettingsType = "Custom" -) - -// for schema -var eConfigBackupSmtpSettingsTypeEnum []interface{} - -func init() { - var res []EConfigBackupSMTPSettingsType - if err := json.Unmarshal([]byte(`["Global","Custom"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eConfigBackupSmtpSettingsTypeEnum = append(eConfigBackupSmtpSettingsTypeEnum, v) - } -} - -func (m EConfigBackupSMTPSettingsType) validateEConfigBackupSMTPSettingsTypeEnum(path, location string, value EConfigBackupSMTPSettingsType) error { - if err := validate.EnumCase(path, location, value, eConfigBackupSmtpSettingsTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e config backup SMTP settings type -func (m EConfigBackupSMTPSettingsType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEConfigBackupSMTPSettingsTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e config backup SMTP settings type based on context it is used -func (m EConfigBackupSMTPSettingsType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_credentials_filters_order_column.go b/models/e_credentials_filters_order_column.go deleted file mode 100644 index 2d6b8c0..0000000 --- a/models/e_credentials_filters_order_column.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ECredentialsFiltersOrderColumn e credentials filters order column -// -// swagger:model ECredentialsFiltersOrderColumn -type ECredentialsFiltersOrderColumn string - -func NewECredentialsFiltersOrderColumn(value ECredentialsFiltersOrderColumn) *ECredentialsFiltersOrderColumn { - v := value - return &v -} - -const ( - - // ECredentialsFiltersOrderColumnUsername captures enum value "Username" - ECredentialsFiltersOrderColumnUsername ECredentialsFiltersOrderColumn = "Username" - - // ECredentialsFiltersOrderColumnDescription captures enum value "Description" - ECredentialsFiltersOrderColumnDescription ECredentialsFiltersOrderColumn = "Description" -) - -// for schema -var eCredentialsFiltersOrderColumnEnum []interface{} - -func init() { - var res []ECredentialsFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Username","Description"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eCredentialsFiltersOrderColumnEnum = append(eCredentialsFiltersOrderColumnEnum, v) - } -} - -func (m ECredentialsFiltersOrderColumn) validateECredentialsFiltersOrderColumnEnum(path, location string, value ECredentialsFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eCredentialsFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e credentials filters order column -func (m ECredentialsFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateECredentialsFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e credentials filters order column based on context it is used -func (m ECredentialsFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_credentials_type.go b/models/e_credentials_type.go deleted file mode 100644 index aa8aa46..0000000 --- a/models/e_credentials_type.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ECredentialsType Credentials type. -// -// swagger:model ECredentialsType -type ECredentialsType string - -func NewECredentialsType(value ECredentialsType) *ECredentialsType { - v := value - return &v -} - -const ( - - // ECredentialsTypeStandard captures enum value "Standard" - ECredentialsTypeStandard ECredentialsType = "Standard" - - // ECredentialsTypeLinux captures enum value "Linux" - ECredentialsTypeLinux ECredentialsType = "Linux" -) - -// for schema -var eCredentialsTypeEnum []interface{} - -func init() { - var res []ECredentialsType - if err := json.Unmarshal([]byte(`["Standard","Linux"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eCredentialsTypeEnum = append(eCredentialsTypeEnum, v) - } -} - -func (m ECredentialsType) validateECredentialsTypeEnum(path, location string, value ECredentialsType) error { - if err := validate.EnumCase(path, location, value, eCredentialsTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e credentials type -func (m ECredentialsType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateECredentialsTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e credentials type based on context it is used -func (m ECredentialsType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_daily_kinds.go b/models/e_daily_kinds.go deleted file mode 100644 index 570ceca..0000000 --- a/models/e_daily_kinds.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EDailyKinds Kind of daily scheduling scheme. -// -// swagger:model EDailyKinds -type EDailyKinds string - -func NewEDailyKinds(value EDailyKinds) *EDailyKinds { - v := value - return &v -} - -const ( - - // EDailyKindsEveryday captures enum value "Everyday" - EDailyKindsEveryday EDailyKinds = "Everyday" - - // EDailyKindsWeekDays captures enum value "WeekDays" - EDailyKindsWeekDays EDailyKinds = "WeekDays" - - // EDailyKindsSelectedDays captures enum value "SelectedDays" - EDailyKindsSelectedDays EDailyKinds = "SelectedDays" -) - -// for schema -var eDailyKindsEnum []interface{} - -func init() { - var res []EDailyKinds - if err := json.Unmarshal([]byte(`["Everyday","WeekDays","SelectedDays"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eDailyKindsEnum = append(eDailyKindsEnum, v) - } -} - -func (m EDailyKinds) validateEDailyKindsEnum(path, location string, value EDailyKinds) error { - if err := validate.EnumCase(path, location, value, eDailyKindsEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e daily kinds -func (m EDailyKinds) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEDailyKindsEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e daily kinds based on context it is used -func (m EDailyKinds) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_day_number_in_month.go b/models/e_day_number_in_month.go deleted file mode 100644 index b1f779c..0000000 --- a/models/e_day_number_in_month.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EDayNumberInMonth e day number in month -// -// swagger:model EDayNumberInMonth -type EDayNumberInMonth string - -func NewEDayNumberInMonth(value EDayNumberInMonth) *EDayNumberInMonth { - v := value - return &v -} - -const ( - - // EDayNumberInMonthFirst captures enum value "First" - EDayNumberInMonthFirst EDayNumberInMonth = "First" - - // EDayNumberInMonthSecond captures enum value "Second" - EDayNumberInMonthSecond EDayNumberInMonth = "Second" - - // EDayNumberInMonthThird captures enum value "Third" - EDayNumberInMonthThird EDayNumberInMonth = "Third" - - // EDayNumberInMonthFourth captures enum value "Fourth" - EDayNumberInMonthFourth EDayNumberInMonth = "Fourth" - - // EDayNumberInMonthLast captures enum value "Last" - EDayNumberInMonthLast EDayNumberInMonth = "Last" - - // EDayNumberInMonthOnDay captures enum value "OnDay" - EDayNumberInMonthOnDay EDayNumberInMonth = "OnDay" -) - -// for schema -var eDayNumberInMonthEnum []interface{} - -func init() { - var res []EDayNumberInMonth - if err := json.Unmarshal([]byte(`["First","Second","Third","Fourth","Last","OnDay"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eDayNumberInMonthEnum = append(eDayNumberInMonthEnum, v) - } -} - -func (m EDayNumberInMonth) validateEDayNumberInMonthEnum(path, location string, value EDayNumberInMonth) error { - if err := validate.EnumCase(path, location, value, eDayNumberInMonthEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e day number in month -func (m EDayNumberInMonth) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEDayNumberInMonthEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e day number in month based on context it is used -func (m EDayNumberInMonth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_day_of_week.go b/models/e_day_of_week.go deleted file mode 100644 index c46a425..0000000 --- a/models/e_day_of_week.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EDayOfWeek e day of week -// -// swagger:model EDayOfWeek -type EDayOfWeek string - -func NewEDayOfWeek(value EDayOfWeek) *EDayOfWeek { - v := value - return &v -} - -const ( - - // EDayOfWeekMonday captures enum value "monday" - EDayOfWeekMonday EDayOfWeek = "monday" - - // EDayOfWeekTuesday captures enum value "tuesday" - EDayOfWeekTuesday EDayOfWeek = "tuesday" - - // EDayOfWeekWednesday captures enum value "wednesday" - EDayOfWeekWednesday EDayOfWeek = "wednesday" - - // EDayOfWeekThursday captures enum value "thursday" - EDayOfWeekThursday EDayOfWeek = "thursday" - - // EDayOfWeekFriday captures enum value "friday" - EDayOfWeekFriday EDayOfWeek = "friday" - - // EDayOfWeekSaturday captures enum value "saturday" - EDayOfWeekSaturday EDayOfWeek = "saturday" - - // EDayOfWeekSunday captures enum value "sunday" - EDayOfWeekSunday EDayOfWeek = "sunday" -) - -// for schema -var eDayOfWeekEnum []interface{} - -func init() { - var res []EDayOfWeek - if err := json.Unmarshal([]byte(`["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eDayOfWeekEnum = append(eDayOfWeekEnum, v) - } -} - -func (m EDayOfWeek) validateEDayOfWeekEnum(path, location string, value EDayOfWeek) error { - if err := validate.EnumCase(path, location, value, eDayOfWeekEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e day of week -func (m EDayOfWeek) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEDayOfWeekEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e day of week based on context it is used -func (m EDayOfWeek) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_disk_info_process_state.go b/models/e_disk_info_process_state.go deleted file mode 100644 index a38b464..0000000 --- a/models/e_disk_info_process_state.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EDiskInfoProcessState Process state of the disk. -// -// swagger:model EDiskInfoProcessState -type EDiskInfoProcessState string - -func NewEDiskInfoProcessState(value EDiskInfoProcessState) *EDiskInfoProcessState { - v := value - return &v -} - -const ( - - // EDiskInfoProcessStateNotProcessed captures enum value "NotProcessed" - EDiskInfoProcessStateNotProcessed EDiskInfoProcessState = "NotProcessed" - - // EDiskInfoProcessStateInProcessing captures enum value "InProcessing" - EDiskInfoProcessStateInProcessing EDiskInfoProcessState = "InProcessing" - - // EDiskInfoProcessStatePartiallyProcessed captures enum value "PartiallyProcessed" - EDiskInfoProcessStatePartiallyProcessed EDiskInfoProcessState = "PartiallyProcessed" - - // EDiskInfoProcessStateProcessed captures enum value "Processed" - EDiskInfoProcessStateProcessed EDiskInfoProcessState = "Processed" -) - -// for schema -var eDiskInfoProcessStateEnum []interface{} - -func init() { - var res []EDiskInfoProcessState - if err := json.Unmarshal([]byte(`["NotProcessed","InProcessing","PartiallyProcessed","Processed"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eDiskInfoProcessStateEnum = append(eDiskInfoProcessStateEnum, v) - } -} - -func (m EDiskInfoProcessState) validateEDiskInfoProcessStateEnum(path, location string, value EDiskInfoProcessState) error { - if err := validate.EnumCase(path, location, value, eDiskInfoProcessStateEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e disk info process state -func (m EDiskInfoProcessState) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEDiskInfoProcessStateEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e disk info process state based on context it is used -func (m EDiskInfoProcessState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_disk_info_type.go b/models/e_disk_info_type.go deleted file mode 100644 index 32386c5..0000000 --- a/models/e_disk_info_type.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EDiskInfoType Type of the disk. -// -// swagger:model EDiskInfoType -type EDiskInfoType string - -func NewEDiskInfoType(value EDiskInfoType) *EDiskInfoType { - v := value - return &v -} - -const ( - - // EDiskInfoTypeUnknown captures enum value "Unknown" - EDiskInfoTypeUnknown EDiskInfoType = "Unknown" - - // EDiskInfoTypeSimple captures enum value "Simple" - EDiskInfoTypeSimple EDiskInfoType = "Simple" - - // EDiskInfoTypeVi captures enum value "Vi" - EDiskInfoTypeVi EDiskInfoType = "Vi" - - // EDiskInfoTypeHv captures enum value "Hv" - EDiskInfoTypeHv EDiskInfoType = "Hv" - - // EDiskInfoTypeHvRawDiskFile captures enum value "HvRawDiskFile" - EDiskInfoTypeHvRawDiskFile EDiskInfoType = "HvRawDiskFile" - - // EDiskInfoTypeEndPoint captures enum value "EndPoint" - EDiskInfoTypeEndPoint EDiskInfoType = "EndPoint" -) - -// for schema -var eDiskInfoTypeEnum []interface{} - -func init() { - var res []EDiskInfoType - if err := json.Unmarshal([]byte(`["Unknown","Simple","Vi","Hv","HvRawDiskFile","EndPoint"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eDiskInfoTypeEnum = append(eDiskInfoTypeEnum, v) - } -} - -func (m EDiskInfoType) validateEDiskInfoTypeEnum(path, location string, value EDiskInfoType) error { - if err := validate.EnumCase(path, location, value, eDiskInfoTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e disk info type -func (m EDiskInfoType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEDiskInfoTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e disk info type based on context it is used -func (m EDiskInfoType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_email_notification_type.go b/models/e_email_notification_type.go deleted file mode 100644 index 9132288..0000000 --- a/models/e_email_notification_type.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EEmailNotificationType Type of email notification settings: global notification settings specified for the backup server, or custom notification settings specified for this job. -// -// -// swagger:model EEmailNotificationType -type EEmailNotificationType string - -func NewEEmailNotificationType(value EEmailNotificationType) *EEmailNotificationType { - v := value - return &v -} - -const ( - - // EEmailNotificationTypeUseGlobalNotificationSettings captures enum value "UseGlobalNotificationSettings" - EEmailNotificationTypeUseGlobalNotificationSettings EEmailNotificationType = "UseGlobalNotificationSettings" - - // EEmailNotificationTypeUseCustomNotificationSettings captures enum value "UseCustomNotificationSettings" - EEmailNotificationTypeUseCustomNotificationSettings EEmailNotificationType = "UseCustomNotificationSettings" -) - -// for schema -var eEmailNotificationTypeEnum []interface{} - -func init() { - var res []EEmailNotificationType - if err := json.Unmarshal([]byte(`["UseGlobalNotificationSettings","UseCustomNotificationSettings"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eEmailNotificationTypeEnum = append(eEmailNotificationTypeEnum, v) - } -} - -func (m EEmailNotificationType) validateEEmailNotificationTypeEnum(path, location string, value EEmailNotificationType) error { - if err := validate.EnumCase(path, location, value, eEmailNotificationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e email notification type -func (m EEmailNotificationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEEmailNotificationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e email notification type based on context it is used -func (m EEmailNotificationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_encryption_passwords_filters_order_column.go b/models/e_encryption_passwords_filters_order_column.go deleted file mode 100644 index f486d74..0000000 --- a/models/e_encryption_passwords_filters_order_column.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EEncryptionPasswordsFiltersOrderColumn e encryption passwords filters order column -// -// swagger:model EEncryptionPasswordsFiltersOrderColumn -type EEncryptionPasswordsFiltersOrderColumn string - -func NewEEncryptionPasswordsFiltersOrderColumn(value EEncryptionPasswordsFiltersOrderColumn) *EEncryptionPasswordsFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EEncryptionPasswordsFiltersOrderColumnHint captures enum value "Hint" - EEncryptionPasswordsFiltersOrderColumnHint EEncryptionPasswordsFiltersOrderColumn = "Hint" - - // EEncryptionPasswordsFiltersOrderColumnModificationTime captures enum value "ModificationTime" - EEncryptionPasswordsFiltersOrderColumnModificationTime EEncryptionPasswordsFiltersOrderColumn = "ModificationTime" -) - -// for schema -var eEncryptionPasswordsFiltersOrderColumnEnum []interface{} - -func init() { - var res []EEncryptionPasswordsFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Hint","ModificationTime"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eEncryptionPasswordsFiltersOrderColumnEnum = append(eEncryptionPasswordsFiltersOrderColumnEnum, v) - } -} - -func (m EEncryptionPasswordsFiltersOrderColumn) validateEEncryptionPasswordsFiltersOrderColumnEnum(path, location string, value EEncryptionPasswordsFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eEncryptionPasswordsFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e encryption passwords filters order column -func (m EEncryptionPasswordsFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEEncryptionPasswordsFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e encryption passwords filters order column based on context it is used -func (m EEncryptionPasswordsFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_guest_f_s_indexing_mode.go b/models/e_guest_f_s_indexing_mode.go deleted file mode 100644 index 59914b3..0000000 --- a/models/e_guest_f_s_indexing_mode.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EGuestFSIndexingMode Indexing mode. -// -// swagger:model EGuestFSIndexingMode -type EGuestFSIndexingMode string - -func NewEGuestFSIndexingMode(value EGuestFSIndexingMode) *EGuestFSIndexingMode { - v := value - return &v -} - -const ( - - // EGuestFSIndexingModeDisable captures enum value "disable" - EGuestFSIndexingModeDisable EGuestFSIndexingMode = "disable" - - // EGuestFSIndexingModeIndexAll captures enum value "indexAll" - EGuestFSIndexingModeIndexAll EGuestFSIndexingMode = "indexAll" - - // EGuestFSIndexingModeIndexAllExcept captures enum value "indexAllExcept" - EGuestFSIndexingModeIndexAllExcept EGuestFSIndexingMode = "indexAllExcept" - - // EGuestFSIndexingModeIndexOnly captures enum value "indexOnly" - EGuestFSIndexingModeIndexOnly EGuestFSIndexingMode = "indexOnly" -) - -// for schema -var eGuestFSIndexingModeEnum []interface{} - -func init() { - var res []EGuestFSIndexingMode - if err := json.Unmarshal([]byte(`["disable","indexAll","indexAllExcept","indexOnly"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eGuestFSIndexingModeEnum = append(eGuestFSIndexingModeEnum, v) - } -} - -func (m EGuestFSIndexingMode) validateEGuestFSIndexingModeEnum(path, location string, value EGuestFSIndexingMode) error { - if err := validate.EnumCase(path, location, value, eGuestFSIndexingModeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e guest f s indexing mode -func (m EGuestFSIndexingMode) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEGuestFSIndexingModeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e guest f s indexing mode based on context it is used -func (m EGuestFSIndexingMode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_guest_o_s_type.go b/models/e_guest_o_s_type.go deleted file mode 100644 index 770b5e6..0000000 --- a/models/e_guest_o_s_type.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EGuestOSType Type of the guest OS. -// -// swagger:model EGuestOSType -type EGuestOSType string - -func NewEGuestOSType(value EGuestOSType) *EGuestOSType { - v := value - return &v -} - -const ( - - // EGuestOSTypeWindows captures enum value "Windows" - EGuestOSTypeWindows EGuestOSType = "Windows" - - // EGuestOSTypeLinux captures enum value "Linux" - EGuestOSTypeLinux EGuestOSType = "Linux" -) - -// for schema -var eGuestOSTypeEnum []interface{} - -func init() { - var res []EGuestOSType - if err := json.Unmarshal([]byte(`["Windows","Linux"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eGuestOSTypeEnum = append(eGuestOSTypeEnum, v) - } -} - -func (m EGuestOSType) validateEGuestOSTypeEnum(path, location string, value EGuestOSType) error { - if err := validate.EnumCase(path, location, value, eGuestOSTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e guest o s type -func (m EGuestOSType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEGuestOSTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e guest o s type based on context it is used -func (m EGuestOSType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_hierarchy_type.go b/models/e_hierarchy_type.go deleted file mode 100644 index 3635907..0000000 --- a/models/e_hierarchy_type.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EHierarchyType Hierarchy type. -// -// swagger:model EHierarchyType -type EHierarchyType string - -func NewEHierarchyType(value EHierarchyType) *EHierarchyType { - v := value - return &v -} - -const ( - - // EHierarchyTypeHostsAndClusters captures enum value "HostsAndClusters" - EHierarchyTypeHostsAndClusters EHierarchyType = "HostsAndClusters" - - // EHierarchyTypeDatastoresAndVms captures enum value "DatastoresAndVms" - EHierarchyTypeDatastoresAndVms EHierarchyType = "DatastoresAndVms" - - // EHierarchyTypeHostsAndDatastores captures enum value "HostsAndDatastores" - EHierarchyTypeHostsAndDatastores EHierarchyType = "HostsAndDatastores" - - // EHierarchyTypeVmsAndTemplates captures enum value "VmsAndTemplates" - EHierarchyTypeVmsAndTemplates EHierarchyType = "VmsAndTemplates" - - // EHierarchyTypeVmsAndTags captures enum value "VmsAndTags" - EHierarchyTypeVmsAndTags EHierarchyType = "VmsAndTags" -) - -// for schema -var eHierarchyTypeEnum []interface{} - -func init() { - var res []EHierarchyType - if err := json.Unmarshal([]byte(`["HostsAndClusters","DatastoresAndVms","HostsAndDatastores","VmsAndTemplates","VmsAndTags"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eHierarchyTypeEnum = append(eHierarchyTypeEnum, v) - } -} - -func (m EHierarchyType) validateEHierarchyTypeEnum(path, location string, value EHierarchyType) error { - if err := validate.EnumCase(path, location, value, eHierarchyTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e hierarchy type -func (m EHierarchyType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEHierarchyTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e hierarchy type based on context it is used -func (m EHierarchyType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_instant_recovery_mount_state.go b/models/e_instant_recovery_mount_state.go deleted file mode 100644 index c92713d..0000000 --- a/models/e_instant_recovery_mount_state.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EInstantRecoveryMountState Mount state. -// -// swagger:model EInstantRecoveryMountState -type EInstantRecoveryMountState string - -func NewEInstantRecoveryMountState(value EInstantRecoveryMountState) *EInstantRecoveryMountState { - v := value - return &v -} - -const ( - - // EInstantRecoveryMountStateFailed captures enum value "Failed" - EInstantRecoveryMountStateFailed EInstantRecoveryMountState = "Failed" - - // EInstantRecoveryMountStateMounting captures enum value "Mounting" - EInstantRecoveryMountStateMounting EInstantRecoveryMountState = "Mounting" - - // EInstantRecoveryMountStateMounted captures enum value "Mounted" - EInstantRecoveryMountStateMounted EInstantRecoveryMountState = "Mounted" - - // EInstantRecoveryMountStateDismounting captures enum value "Dismounting" - EInstantRecoveryMountStateDismounting EInstantRecoveryMountState = "Dismounting" -) - -// for schema -var eInstantRecoveryMountStateEnum []interface{} - -func init() { - var res []EInstantRecoveryMountState - if err := json.Unmarshal([]byte(`["Failed","Mounting","Mounted","Dismounting"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eInstantRecoveryMountStateEnum = append(eInstantRecoveryMountStateEnum, v) - } -} - -func (m EInstantRecoveryMountState) validateEInstantRecoveryMountStateEnum(path, location string, value EInstantRecoveryMountState) error { - if err := validate.EnumCase(path, location, value, eInstantRecoveryMountStateEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e instant recovery mount state -func (m EInstantRecoveryMountState) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEInstantRecoveryMountStateEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e instant recovery mount state based on context it is used -func (m EInstantRecoveryMountState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_job_filters_order_column.go b/models/e_job_filters_order_column.go deleted file mode 100644 index a720c1e..0000000 --- a/models/e_job_filters_order_column.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EJobFiltersOrderColumn Orders jobs by the specified column. -// -// swagger:model EJobFiltersOrderColumn -type EJobFiltersOrderColumn string - -func NewEJobFiltersOrderColumn(value EJobFiltersOrderColumn) *EJobFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EJobFiltersOrderColumnName captures enum value "Name" - EJobFiltersOrderColumnName EJobFiltersOrderColumn = "Name" - - // EJobFiltersOrderColumnType captures enum value "Type" - EJobFiltersOrderColumnType EJobFiltersOrderColumn = "Type" - - // EJobFiltersOrderColumnDescription captures enum value "Description" - EJobFiltersOrderColumnDescription EJobFiltersOrderColumn = "Description" -) - -// for schema -var eJobFiltersOrderColumnEnum []interface{} - -func init() { - var res []EJobFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Type","Description"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eJobFiltersOrderColumnEnum = append(eJobFiltersOrderColumnEnum, v) - } -} - -func (m EJobFiltersOrderColumn) validateEJobFiltersOrderColumnEnum(path, location string, value EJobFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eJobFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e job filters order column -func (m EJobFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEJobFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e job filters order column based on context it is used -func (m EJobFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_job_states_filters_order_column.go b/models/e_job_states_filters_order_column.go deleted file mode 100644 index e0dbd74..0000000 --- a/models/e_job_states_filters_order_column.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EJobStatesFiltersOrderColumn Orders job states by the specified column. -// -// swagger:model EJobStatesFiltersOrderColumn -type EJobStatesFiltersOrderColumn string - -func NewEJobStatesFiltersOrderColumn(value EJobStatesFiltersOrderColumn) *EJobStatesFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EJobStatesFiltersOrderColumnName captures enum value "Name" - EJobStatesFiltersOrderColumnName EJobStatesFiltersOrderColumn = "Name" - - // EJobStatesFiltersOrderColumnType captures enum value "Type" - EJobStatesFiltersOrderColumnType EJobStatesFiltersOrderColumn = "Type" - - // EJobStatesFiltersOrderColumnStatus captures enum value "Status" - EJobStatesFiltersOrderColumnStatus EJobStatesFiltersOrderColumn = "Status" - - // EJobStatesFiltersOrderColumnLastRun captures enum value "LastRun" - EJobStatesFiltersOrderColumnLastRun EJobStatesFiltersOrderColumn = "LastRun" - - // EJobStatesFiltersOrderColumnLastResult captures enum value "LastResult" - EJobStatesFiltersOrderColumnLastResult EJobStatesFiltersOrderColumn = "LastResult" - - // EJobStatesFiltersOrderColumnNextRun captures enum value "NextRun" - EJobStatesFiltersOrderColumnNextRun EJobStatesFiltersOrderColumn = "NextRun" - - // EJobStatesFiltersOrderColumnDescription captures enum value "Description" - EJobStatesFiltersOrderColumnDescription EJobStatesFiltersOrderColumn = "Description" - - // EJobStatesFiltersOrderColumnRepositoryID captures enum value "RepositoryId" - EJobStatesFiltersOrderColumnRepositoryID EJobStatesFiltersOrderColumn = "RepositoryId" - - // EJobStatesFiltersOrderColumnObjectsCount captures enum value "ObjectsCount" - EJobStatesFiltersOrderColumnObjectsCount EJobStatesFiltersOrderColumn = "ObjectsCount" -) - -// for schema -var eJobStatesFiltersOrderColumnEnum []interface{} - -func init() { - var res []EJobStatesFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Type","Status","LastRun","LastResult","NextRun","Description","RepositoryId","ObjectsCount"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eJobStatesFiltersOrderColumnEnum = append(eJobStatesFiltersOrderColumnEnum, v) - } -} - -func (m EJobStatesFiltersOrderColumn) validateEJobStatesFiltersOrderColumnEnum(path, location string, value EJobStatesFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eJobStatesFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e job states filters order column -func (m EJobStatesFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEJobStatesFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e job states filters order column based on context it is used -func (m EJobStatesFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_job_status.go b/models/e_job_status.go deleted file mode 100644 index 3fab7e9..0000000 --- a/models/e_job_status.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EJobStatus Current status of the job. -// -// swagger:model EJobStatus -type EJobStatus string - -func NewEJobStatus(value EJobStatus) *EJobStatus { - v := value - return &v -} - -const ( - - // EJobStatusRunning captures enum value "running" - EJobStatusRunning EJobStatus = "running" - - // EJobStatusInactive captures enum value "inactive" - EJobStatusInactive EJobStatus = "inactive" - - // EJobStatusDisabled captures enum value "disabled" - EJobStatusDisabled EJobStatus = "disabled" -) - -// for schema -var eJobStatusEnum []interface{} - -func init() { - var res []EJobStatus - if err := json.Unmarshal([]byte(`["running","inactive","disabled"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eJobStatusEnum = append(eJobStatusEnum, v) - } -} - -func (m EJobStatus) validateEJobStatusEnum(path, location string, value EJobStatus) error { - if err := validate.EnumCase(path, location, value, eJobStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e job status -func (m EJobStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEJobStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e job status based on context it is used -func (m EJobStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_job_type.go b/models/e_job_type.go deleted file mode 100644 index 7040750..0000000 --- a/models/e_job_type.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EJobType Type of the job. -// -// swagger:model EJobType -type EJobType string - -func NewEJobType(value EJobType) *EJobType { - v := value - return &v -} - -const ( - - // EJobTypeBackup captures enum value "Backup" - EJobTypeBackup EJobType = "Backup" -) - -// for schema -var eJobTypeEnum []interface{} - -func init() { - var res []EJobType - if err := json.Unmarshal([]byte(`["Backup"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eJobTypeEnum = append(eJobTypeEnum, v) - } -} - -func (m EJobType) validateEJobTypeEnum(path, location string, value EJobType) error { - if err := validate.EnumCase(path, location, value, eJobTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e job type -func (m EJobType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEJobTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e job type based on context it is used -func (m EJobType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_job_workload.go b/models/e_job_workload.go deleted file mode 100644 index de0209a..0000000 --- a/models/e_job_workload.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EJobWorkload Workload which the job must process. -// -// swagger:model EJobWorkload -type EJobWorkload string - -func NewEJobWorkload(value EJobWorkload) *EJobWorkload { - v := value - return &v -} - -const ( - - // EJobWorkloadApplication captures enum value "application" - EJobWorkloadApplication EJobWorkload = "application" - - // EJobWorkloadCloudVM captures enum value "cloudVm" - EJobWorkloadCloudVM EJobWorkload = "cloudVm" - - // EJobWorkloadFile captures enum value "file" - EJobWorkloadFile EJobWorkload = "file" - - // EJobWorkloadServer captures enum value "server" - EJobWorkloadServer EJobWorkload = "server" - - // EJobWorkloadWorkstation captures enum value "workstation" - EJobWorkloadWorkstation EJobWorkload = "workstation" - - // EJobWorkloadVM captures enum value "vm" - EJobWorkloadVM EJobWorkload = "vm" -) - -// for schema -var eJobWorkloadEnum []interface{} - -func init() { - var res []EJobWorkload - if err := json.Unmarshal([]byte(`["application","cloudVm","file","server","workstation","vm"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eJobWorkloadEnum = append(eJobWorkloadEnum, v) - } -} - -func (m EJobWorkload) validateEJobWorkloadEnum(path, location string, value EJobWorkload) error { - if err := validate.EnumCase(path, location, value, eJobWorkloadEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e job workload -func (m EJobWorkload) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEJobWorkloadEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e job workload based on context it is used -func (m EJobWorkload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_login_grant_type.go b/models/e_login_grant_type.go deleted file mode 100644 index 5655c44..0000000 --- a/models/e_login_grant_type.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ELoginGrantType Authorization grant type. -// -// Available values: -// - `password` — used to obtain an access token by providing a user name and password. -// - `refresh_token` — used to refresh an expired or lost access token by providing a refresh token. -// - `authorization_code` — used to obtain an access token by providing an authorization code. -// -// -// swagger:model ELoginGrantType -type ELoginGrantType string - -func NewELoginGrantType(value ELoginGrantType) *ELoginGrantType { - v := value - return &v -} - -const ( - - // ELoginGrantTypePassword captures enum value "password" - ELoginGrantTypePassword ELoginGrantType = "password" - - // ELoginGrantTypeRefreshToken captures enum value "refresh_token" - ELoginGrantTypeRefreshToken ELoginGrantType = "refresh_token" - - // ELoginGrantTypeAuthorizationCode captures enum value "authorization_code" - ELoginGrantTypeAuthorizationCode ELoginGrantType = "authorization_code" -) - -// for schema -var eLoginGrantTypeEnum []interface{} - -func init() { - var res []ELoginGrantType - if err := json.Unmarshal([]byte(`["password","refresh_token","authorization_code"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eLoginGrantTypeEnum = append(eLoginGrantTypeEnum, v) - } -} - -func (m ELoginGrantType) validateELoginGrantTypeEnum(path, location string, value ELoginGrantType) error { - if err := validate.EnumCase(path, location, value, eLoginGrantTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e login grant type -func (m ELoginGrantType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateELoginGrantTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e login grant type based on context it is used -func (m ELoginGrantType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_managed_server_type.go b/models/e_managed_server_type.go deleted file mode 100644 index ddce9e3..0000000 --- a/models/e_managed_server_type.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EManagedServerType Type of the server. -// -// swagger:model EManagedServerType -type EManagedServerType string - -func NewEManagedServerType(value EManagedServerType) *EManagedServerType { - v := value - return &v -} - -const ( - - // EManagedServerTypeWindowsHost captures enum value "WindowsHost" - EManagedServerTypeWindowsHost EManagedServerType = "WindowsHost" - - // EManagedServerTypeLinuxHost captures enum value "LinuxHost" - EManagedServerTypeLinuxHost EManagedServerType = "LinuxHost" - - // EManagedServerTypeViHost captures enum value "ViHost" - EManagedServerTypeViHost EManagedServerType = "ViHost" -) - -// for schema -var eManagedServerTypeEnum []interface{} - -func init() { - var res []EManagedServerType - if err := json.Unmarshal([]byte(`["WindowsHost","LinuxHost","ViHost"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eManagedServerTypeEnum = append(eManagedServerTypeEnum, v) - } -} - -func (m EManagedServerType) validateEManagedServerTypeEnum(path, location string, value EManagedServerType) error { - if err := validate.EnumCase(path, location, value, eManagedServerTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e managed server type -func (m EManagedServerType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEManagedServerTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e managed server type based on context it is used -func (m EManagedServerType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_managed_servers_filters_order_column.go b/models/e_managed_servers_filters_order_column.go deleted file mode 100644 index 2e28847..0000000 --- a/models/e_managed_servers_filters_order_column.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EManagedServersFiltersOrderColumn e managed servers filters order column -// -// swagger:model EManagedServersFiltersOrderColumn -type EManagedServersFiltersOrderColumn string - -func NewEManagedServersFiltersOrderColumn(value EManagedServersFiltersOrderColumn) *EManagedServersFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EManagedServersFiltersOrderColumnName captures enum value "Name" - EManagedServersFiltersOrderColumnName EManagedServersFiltersOrderColumn = "Name" - - // EManagedServersFiltersOrderColumnType captures enum value "Type" - EManagedServersFiltersOrderColumnType EManagedServersFiltersOrderColumn = "Type" - - // EManagedServersFiltersOrderColumnDescription captures enum value "Description" - EManagedServersFiltersOrderColumnDescription EManagedServersFiltersOrderColumn = "Description" -) - -// for schema -var eManagedServersFiltersOrderColumnEnum []interface{} - -func init() { - var res []EManagedServersFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Type","Description"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eManagedServersFiltersOrderColumnEnum = append(eManagedServersFiltersOrderColumnEnum, v) - } -} - -func (m EManagedServersFiltersOrderColumn) validateEManagedServersFiltersOrderColumnEnum(path, location string, value EManagedServersFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eManagedServersFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e managed servers filters order column -func (m EManagedServersFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEManagedServersFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e managed servers filters order column based on context it is used -func (m EManagedServersFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_month.go b/models/e_month.go deleted file mode 100644 index b466f31..0000000 --- a/models/e_month.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EMonth e month -// -// swagger:model EMonth -type EMonth string - -func NewEMonth(value EMonth) *EMonth { - v := value - return &v -} - -const ( - - // EMonthJanuary captures enum value "January" - EMonthJanuary EMonth = "January" - - // EMonthFebruary captures enum value "February" - EMonthFebruary EMonth = "February" - - // EMonthMarch captures enum value "March" - EMonthMarch EMonth = "March" - - // EMonthApril captures enum value "April" - EMonthApril EMonth = "April" - - // EMonthMay captures enum value "May" - EMonthMay EMonth = "May" - - // EMonthJune captures enum value "June" - EMonthJune EMonth = "June" - - // EMonthJuly captures enum value "July" - EMonthJuly EMonth = "July" - - // EMonthAugust captures enum value "August" - EMonthAugust EMonth = "August" - - // EMonthSeptember captures enum value "September" - EMonthSeptember EMonth = "September" - - // EMonthOctober captures enum value "October" - EMonthOctober EMonth = "October" - - // EMonthNovember captures enum value "November" - EMonthNovember EMonth = "November" - - // EMonthDecember captures enum value "December" - EMonthDecember EMonth = "December" -) - -// for schema -var eMonthEnum []interface{} - -func init() { - var res []EMonth - if err := json.Unmarshal([]byte(`["January","February","March","April","May","June","July","August","September","October","November","December"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eMonthEnum = append(eMonthEnum, v) - } -} - -func (m EMonth) validateEMonthEnum(path, location string, value EMonth) error { - if err := validate.EnumCase(path, location, value, eMonthEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e month -func (m EMonth) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEMonthEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e month based on context it is used -func (m EMonth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_object_restore_point_operation.go b/models/e_object_restore_point_operation.go deleted file mode 100644 index a763f7c..0000000 --- a/models/e_object_restore_point_operation.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EObjectRestorePointOperation e object restore point operation -// -// swagger:model EObjectRestorePointOperation -type EObjectRestorePointOperation string - -func NewEObjectRestorePointOperation(value EObjectRestorePointOperation) *EObjectRestorePointOperation { - v := value - return &v -} - -const ( - - // EObjectRestorePointOperationVmwareInstantRecoveryFcd captures enum value "VmwareInstantRecoveryFcd" - EObjectRestorePointOperationVmwareInstantRecoveryFcd EObjectRestorePointOperation = "VmwareInstantRecoveryFcd" -) - -// for schema -var eObjectRestorePointOperationEnum []interface{} - -func init() { - var res []EObjectRestorePointOperation - if err := json.Unmarshal([]byte(`["VmwareInstantRecoveryFcd"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eObjectRestorePointOperationEnum = append(eObjectRestorePointOperationEnum, v) - } -} - -func (m EObjectRestorePointOperation) validateEObjectRestorePointOperationEnum(path, location string, value EObjectRestorePointOperation) error { - if err := validate.EnumCase(path, location, value, eObjectRestorePointOperationEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e object restore point operation -func (m EObjectRestorePointOperation) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEObjectRestorePointOperationEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e object restore point operation based on context it is used -func (m EObjectRestorePointOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_object_restore_points_filters_order_column.go b/models/e_object_restore_points_filters_order_column.go deleted file mode 100644 index 7646352..0000000 --- a/models/e_object_restore_points_filters_order_column.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EObjectRestorePointsFiltersOrderColumn e object restore points filters order column -// -// swagger:model EObjectRestorePointsFiltersOrderColumn -type EObjectRestorePointsFiltersOrderColumn string - -func NewEObjectRestorePointsFiltersOrderColumn(value EObjectRestorePointsFiltersOrderColumn) *EObjectRestorePointsFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EObjectRestorePointsFiltersOrderColumnCreationTime captures enum value "CreationTime" - EObjectRestorePointsFiltersOrderColumnCreationTime EObjectRestorePointsFiltersOrderColumn = "CreationTime" - - // EObjectRestorePointsFiltersOrderColumnPlatformID captures enum value "PlatformId" - EObjectRestorePointsFiltersOrderColumnPlatformID EObjectRestorePointsFiltersOrderColumn = "PlatformId" - - // EObjectRestorePointsFiltersOrderColumnBackupID captures enum value "BackupId" - EObjectRestorePointsFiltersOrderColumnBackupID EObjectRestorePointsFiltersOrderColumn = "BackupId" -) - -// for schema -var eObjectRestorePointsFiltersOrderColumnEnum []interface{} - -func init() { - var res []EObjectRestorePointsFiltersOrderColumn - if err := json.Unmarshal([]byte(`["CreationTime","PlatformId","BackupId"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eObjectRestorePointsFiltersOrderColumnEnum = append(eObjectRestorePointsFiltersOrderColumnEnum, v) - } -} - -func (m EObjectRestorePointsFiltersOrderColumn) validateEObjectRestorePointsFiltersOrderColumnEnum(path, location string, value EObjectRestorePointsFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eObjectRestorePointsFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e object restore points filters order column -func (m EObjectRestorePointsFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEObjectRestorePointsFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e object restore points filters order column based on context it is used -func (m EObjectRestorePointsFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_periodically_kinds.go b/models/e_periodically_kinds.go deleted file mode 100644 index 4f3f82f..0000000 --- a/models/e_periodically_kinds.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EPeriodicallyKinds Time unit for periodic job scheduling. -// -// swagger:model EPeriodicallyKinds -type EPeriodicallyKinds string - -func NewEPeriodicallyKinds(value EPeriodicallyKinds) *EPeriodicallyKinds { - v := value - return &v -} - -const ( - - // EPeriodicallyKindsHours captures enum value "Hours" - EPeriodicallyKindsHours EPeriodicallyKinds = "Hours" - - // EPeriodicallyKindsMinutes captures enum value "Minutes" - EPeriodicallyKindsMinutes EPeriodicallyKinds = "Minutes" - - // EPeriodicallyKindsSeconds captures enum value "Seconds" - EPeriodicallyKindsSeconds EPeriodicallyKinds = "Seconds" - - // EPeriodicallyKindsDays captures enum value "Days" - EPeriodicallyKindsDays EPeriodicallyKinds = "Days" -) - -// for schema -var ePeriodicallyKindsEnum []interface{} - -func init() { - var res []EPeriodicallyKinds - if err := json.Unmarshal([]byte(`["Hours","Minutes","Seconds","Days"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ePeriodicallyKindsEnum = append(ePeriodicallyKindsEnum, v) - } -} - -func (m EPeriodicallyKinds) validateEPeriodicallyKindsEnum(path, location string, value EPeriodicallyKinds) error { - if err := validate.EnumCase(path, location, value, ePeriodicallyKindsEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e periodically kinds -func (m EPeriodicallyKinds) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEPeriodicallyKindsEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e periodically kinds based on context it is used -func (m EPeriodicallyKinds) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_placement_policy_type.go b/models/e_placement_policy_type.go deleted file mode 100644 index 25d3442..0000000 --- a/models/e_placement_policy_type.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EPlacementPolicyType Type of placement policy. -// -// swagger:model EPlacementPolicyType -type EPlacementPolicyType string - -func NewEPlacementPolicyType(value EPlacementPolicyType) *EPlacementPolicyType { - v := value - return &v -} - -const ( - - // EPlacementPolicyTypeDataLocality captures enum value "DataLocality" - EPlacementPolicyTypeDataLocality EPlacementPolicyType = "DataLocality" - - // EPlacementPolicyTypePerformance captures enum value "Performance" - EPlacementPolicyTypePerformance EPlacementPolicyType = "Performance" -) - -// for schema -var ePlacementPolicyTypeEnum []interface{} - -func init() { - var res []EPlacementPolicyType - if err := json.Unmarshal([]byte(`["DataLocality","Performance"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ePlacementPolicyTypeEnum = append(ePlacementPolicyTypeEnum, v) - } -} - -func (m EPlacementPolicyType) validateEPlacementPolicyTypeEnum(path, location string, value EPlacementPolicyType) error { - if err := validate.EnumCase(path, location, value, ePlacementPolicyTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e placement policy type -func (m EPlacementPolicyType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEPlacementPolicyTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e placement policy type based on context it is used -func (m EPlacementPolicyType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_platform.go b/models/e_platform.go deleted file mode 100644 index 0c79231..0000000 --- a/models/e_platform.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EPlatform e platform -// -// swagger:model EPlatform -type EPlatform string - -func NewEPlatform(value EPlatform) *EPlatform { - v := value - return &v -} - -const ( - - // EPlatformVmware captures enum value "Vmware" - EPlatformVmware EPlatform = "Vmware" - - // EPlatformHyperV captures enum value "HyperV" - EPlatformHyperV EPlatform = "HyperV" - - // EPlatformTest captures enum value "Test" - EPlatformTest EPlatform = "Test" - - // EPlatformVcd captures enum value "Vcd" - EPlatformVcd EPlatform = "Vcd" - - // EPlatformTape captures enum value "Tape" - EPlatformTape EPlatform = "Tape" - - // EPlatformEndPoint captures enum value "EndPoint" - EPlatformEndPoint EPlatform = "EndPoint" - - // EPlatformLinuxPhysical captures enum value "LinuxPhysical" - EPlatformLinuxPhysical EPlatform = "LinuxPhysical" - - // EPlatformCustomPlatform captures enum value "CustomPlatform" - EPlatformCustomPlatform EPlatform = "CustomPlatform" - - // EPlatformConf captures enum value "Conf" - EPlatformConf EPlatform = "Conf" - - // EPlatformNasBackup captures enum value "NasBackup" - EPlatformNasBackup EPlatform = "NasBackup" - - // EPlatformEmulatedVMWare captures enum value "EmulatedVmWare" - EPlatformEmulatedVMWare EPlatform = "EmulatedVmWare" - - // EPlatformExtension0 captures enum value "Extension0" - EPlatformExtension0 EPlatform = "Extension0" - - // EPlatformExtension1 captures enum value "Extension1" - EPlatformExtension1 EPlatform = "Extension1" - - // EPlatformExtension captures enum value "Extension" - EPlatformExtension EPlatform = "Extension" -) - -// for schema -var ePlatformEnum []interface{} - -func init() { - var res []EPlatform - if err := json.Unmarshal([]byte(`["Vmware","HyperV","Test","Vcd","Tape","EndPoint","LinuxPhysical","CustomPlatform","Conf","NasBackup","EmulatedVmWare","Extension0","Extension1","Extension"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ePlatformEnum = append(ePlatformEnum, v) - } -} - -func (m EPlatform) validateEPlatformEnum(path, location string, value EPlatform) error { - if err := validate.EnumCase(path, location, value, ePlatformEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e platform -func (m EPlatform) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEPlatformEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e platform based on context it is used -func (m EPlatform) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_platform_type.go b/models/e_platform_type.go deleted file mode 100644 index 3f3c7a9..0000000 --- a/models/e_platform_type.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EPlatformType e platform type -// -// swagger:model EPlatformType -type EPlatformType string - -func NewEPlatformType(value EPlatformType) *EPlatformType { - v := value - return &v -} - -const ( - - // EPlatformTypeVMWare captures enum value "VmWare" - EPlatformTypeVMWare EPlatformType = "VmWare" - - // EPlatformTypeHyperV captures enum value "HyperV" - EPlatformTypeHyperV EPlatformType = "HyperV" - - // EPlatformTypeVcd captures enum value "Vcd" - EPlatformTypeVcd EPlatformType = "Vcd" - - // EPlatformTypeWindowsPhysical captures enum value "WindowsPhysical" - EPlatformTypeWindowsPhysical EPlatformType = "WindowsPhysical" - - // EPlatformTypeLinuxPhysical captures enum value "LinuxPhysical" - EPlatformTypeLinuxPhysical EPlatformType = "LinuxPhysical" - - // EPlatformTypeTape captures enum value "Tape" - EPlatformTypeTape EPlatformType = "Tape" - - // EPlatformTypeNasBackup captures enum value "NasBackup" - EPlatformTypeNasBackup EPlatformType = "NasBackup" - - // EPlatformTypeCustomPlatform captures enum value "CustomPlatform" - EPlatformTypeCustomPlatform EPlatformType = "CustomPlatform" -) - -// for schema -var ePlatformTypeEnum []interface{} - -func init() { - var res []EPlatformType - if err := json.Unmarshal([]byte(`["VmWare","HyperV","Vcd","WindowsPhysical","LinuxPhysical","Tape","NasBackup","CustomPlatform"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ePlatformTypeEnum = append(ePlatformTypeEnum, v) - } -} - -func (m EPlatformType) validateEPlatformTypeEnum(path, location string, value EPlatformType) error { - if err := validate.EnumCase(path, location, value, ePlatformTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e platform type -func (m EPlatformType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEPlatformTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e platform type based on context it is used -func (m EPlatformType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_proxies_filters_order_column.go b/models/e_proxies_filters_order_column.go deleted file mode 100644 index d905226..0000000 --- a/models/e_proxies_filters_order_column.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EProxiesFiltersOrderColumn e proxies filters order column -// -// swagger:model EProxiesFiltersOrderColumn -type EProxiesFiltersOrderColumn string - -func NewEProxiesFiltersOrderColumn(value EProxiesFiltersOrderColumn) *EProxiesFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EProxiesFiltersOrderColumnName captures enum value "Name" - EProxiesFiltersOrderColumnName EProxiesFiltersOrderColumn = "Name" - - // EProxiesFiltersOrderColumnType captures enum value "Type" - EProxiesFiltersOrderColumnType EProxiesFiltersOrderColumn = "Type" - - // EProxiesFiltersOrderColumnDescription captures enum value "Description" - EProxiesFiltersOrderColumnDescription EProxiesFiltersOrderColumn = "Description" -) - -// for schema -var eProxiesFiltersOrderColumnEnum []interface{} - -func init() { - var res []EProxiesFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Type","Description"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eProxiesFiltersOrderColumnEnum = append(eProxiesFiltersOrderColumnEnum, v) - } -} - -func (m EProxiesFiltersOrderColumn) validateEProxiesFiltersOrderColumnEnum(path, location string, value EProxiesFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eProxiesFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e proxies filters order column -func (m EProxiesFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEProxiesFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e proxies filters order column based on context it is used -func (m EProxiesFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_proxy_type.go b/models/e_proxy_type.go deleted file mode 100644 index 31afd19..0000000 --- a/models/e_proxy_type.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EProxyType Type of the backup proxy. -// -// swagger:model EProxyType -type EProxyType string - -func NewEProxyType(value EProxyType) *EProxyType { - v := value - return &v -} - -const ( - - // EProxyTypeViProxy captures enum value "ViProxy" - EProxyTypeViProxy EProxyType = "ViProxy" -) - -// for schema -var eProxyTypeEnum []interface{} - -func init() { - var res []EProxyType - if err := json.Unmarshal([]byte(`["ViProxy"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eProxyTypeEnum = append(eProxyTypeEnum, v) - } -} - -func (m EProxyType) validateEProxyTypeEnum(path, location string, value EProxyType) error { - if err := validate.EnumCase(path, location, value, eProxyTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e proxy type -func (m EProxyType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEProxyTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e proxy type based on context it is used -func (m EProxyType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_repository_extent_status_type.go b/models/e_repository_extent_status_type.go deleted file mode 100644 index 9480637..0000000 --- a/models/e_repository_extent_status_type.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ERepositoryExtentStatusType e repository extent status type -// -// swagger:model ERepositoryExtentStatusType -type ERepositoryExtentStatusType string - -func NewERepositoryExtentStatusType(value ERepositoryExtentStatusType) *ERepositoryExtentStatusType { - v := value - return &v -} - -const ( - - // ERepositoryExtentStatusTypeNormal captures enum value "Normal" - ERepositoryExtentStatusTypeNormal ERepositoryExtentStatusType = "Normal" - - // ERepositoryExtentStatusTypeEvacuate captures enum value "Evacuate" - ERepositoryExtentStatusTypeEvacuate ERepositoryExtentStatusType = "Evacuate" - - // ERepositoryExtentStatusTypePending captures enum value "Pending" - ERepositoryExtentStatusTypePending ERepositoryExtentStatusType = "Pending" - - // ERepositoryExtentStatusTypeSealed captures enum value "Sealed" - ERepositoryExtentStatusTypeSealed ERepositoryExtentStatusType = "Sealed" - - // ERepositoryExtentStatusTypeMaintenance captures enum value "Maintenance" - ERepositoryExtentStatusTypeMaintenance ERepositoryExtentStatusType = "Maintenance" -) - -// for schema -var eRepositoryExtentStatusTypeEnum []interface{} - -func init() { - var res []ERepositoryExtentStatusType - if err := json.Unmarshal([]byte(`["Normal","Evacuate","Pending","Sealed","Maintenance"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eRepositoryExtentStatusTypeEnum = append(eRepositoryExtentStatusTypeEnum, v) - } -} - -func (m ERepositoryExtentStatusType) validateERepositoryExtentStatusTypeEnum(path, location string, value ERepositoryExtentStatusType) error { - if err := validate.EnumCase(path, location, value, eRepositoryExtentStatusTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e repository extent status type -func (m ERepositoryExtentStatusType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateERepositoryExtentStatusTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e repository extent status type based on context it is used -func (m ERepositoryExtentStatusType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_repository_filters_order_column.go b/models/e_repository_filters_order_column.go deleted file mode 100644 index 4733dcb..0000000 --- a/models/e_repository_filters_order_column.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ERepositoryFiltersOrderColumn e repository filters order column -// -// swagger:model ERepositoryFiltersOrderColumn -type ERepositoryFiltersOrderColumn string - -func NewERepositoryFiltersOrderColumn(value ERepositoryFiltersOrderColumn) *ERepositoryFiltersOrderColumn { - v := value - return &v -} - -const ( - - // ERepositoryFiltersOrderColumnName captures enum value "Name" - ERepositoryFiltersOrderColumnName ERepositoryFiltersOrderColumn = "Name" - - // ERepositoryFiltersOrderColumnDescription captures enum value "Description" - ERepositoryFiltersOrderColumnDescription ERepositoryFiltersOrderColumn = "Description" - - // ERepositoryFiltersOrderColumnType captures enum value "Type" - ERepositoryFiltersOrderColumnType ERepositoryFiltersOrderColumn = "Type" - - // ERepositoryFiltersOrderColumnHost captures enum value "Host" - ERepositoryFiltersOrderColumnHost ERepositoryFiltersOrderColumn = "Host" - - // ERepositoryFiltersOrderColumnPath captures enum value "Path" - ERepositoryFiltersOrderColumnPath ERepositoryFiltersOrderColumn = "Path" -) - -// for schema -var eRepositoryFiltersOrderColumnEnum []interface{} - -func init() { - var res []ERepositoryFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Description","Type","Host","Path"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eRepositoryFiltersOrderColumnEnum = append(eRepositoryFiltersOrderColumnEnum, v) - } -} - -func (m ERepositoryFiltersOrderColumn) validateERepositoryFiltersOrderColumnEnum(path, location string, value ERepositoryFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eRepositoryFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e repository filters order column -func (m ERepositoryFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateERepositoryFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e repository filters order column based on context it is used -func (m ERepositoryFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_repository_states_filters_order_column.go b/models/e_repository_states_filters_order_column.go deleted file mode 100644 index 82fbee5..0000000 --- a/models/e_repository_states_filters_order_column.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ERepositoryStatesFiltersOrderColumn Orders repositories by the specified column. -// -// swagger:model ERepositoryStatesFiltersOrderColumn -type ERepositoryStatesFiltersOrderColumn string - -func NewERepositoryStatesFiltersOrderColumn(value ERepositoryStatesFiltersOrderColumn) *ERepositoryStatesFiltersOrderColumn { - v := value - return &v -} - -const ( - - // ERepositoryStatesFiltersOrderColumnName captures enum value "Name" - ERepositoryStatesFiltersOrderColumnName ERepositoryStatesFiltersOrderColumn = "Name" - - // ERepositoryStatesFiltersOrderColumnType captures enum value "Type" - ERepositoryStatesFiltersOrderColumnType ERepositoryStatesFiltersOrderColumn = "Type" - - // ERepositoryStatesFiltersOrderColumnHost captures enum value "Host" - ERepositoryStatesFiltersOrderColumnHost ERepositoryStatesFiltersOrderColumn = "Host" - - // ERepositoryStatesFiltersOrderColumnPath captures enum value "Path" - ERepositoryStatesFiltersOrderColumnPath ERepositoryStatesFiltersOrderColumn = "Path" - - // ERepositoryStatesFiltersOrderColumnCapacityGB captures enum value "CapacityGB" - ERepositoryStatesFiltersOrderColumnCapacityGB ERepositoryStatesFiltersOrderColumn = "CapacityGB" - - // ERepositoryStatesFiltersOrderColumnFreeGB captures enum value "FreeGB" - ERepositoryStatesFiltersOrderColumnFreeGB ERepositoryStatesFiltersOrderColumn = "FreeGB" - - // ERepositoryStatesFiltersOrderColumnUsedSpaceGB captures enum value "UsedSpaceGB" - ERepositoryStatesFiltersOrderColumnUsedSpaceGB ERepositoryStatesFiltersOrderColumn = "UsedSpaceGB" - - // ERepositoryStatesFiltersOrderColumnDescription captures enum value "Description" - ERepositoryStatesFiltersOrderColumnDescription ERepositoryStatesFiltersOrderColumn = "Description" -) - -// for schema -var eRepositoryStatesFiltersOrderColumnEnum []interface{} - -func init() { - var res []ERepositoryStatesFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Type","Host","Path","CapacityGB","FreeGB","UsedSpaceGB","Description"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eRepositoryStatesFiltersOrderColumnEnum = append(eRepositoryStatesFiltersOrderColumnEnum, v) - } -} - -func (m ERepositoryStatesFiltersOrderColumn) validateERepositoryStatesFiltersOrderColumnEnum(path, location string, value ERepositoryStatesFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eRepositoryStatesFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e repository states filters order column -func (m ERepositoryStatesFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateERepositoryStatesFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e repository states filters order column based on context it is used -func (m ERepositoryStatesFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_repository_type.go b/models/e_repository_type.go deleted file mode 100644 index f5dc0b3..0000000 --- a/models/e_repository_type.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ERepositoryType Repository type. -// -// swagger:model ERepositoryType -type ERepositoryType string - -func NewERepositoryType(value ERepositoryType) *ERepositoryType { - v := value - return &v -} - -const ( - - // ERepositoryTypeWinLocal captures enum value "WinLocal" - ERepositoryTypeWinLocal ERepositoryType = "WinLocal" - - // ERepositoryTypeLinuxLocal captures enum value "LinuxLocal" - ERepositoryTypeLinuxLocal ERepositoryType = "LinuxLocal" - - // ERepositoryTypeSmb captures enum value "Smb" - ERepositoryTypeSmb ERepositoryType = "Smb" - - // ERepositoryTypeNfs captures enum value "Nfs" - ERepositoryTypeNfs ERepositoryType = "Nfs" - - // ERepositoryTypeAzureBlob captures enum value "AzureBlob" - ERepositoryTypeAzureBlob ERepositoryType = "AzureBlob" - - // ERepositoryTypeAzureArchive captures enum value "AzureArchive" - ERepositoryTypeAzureArchive ERepositoryType = "AzureArchive" - - // ERepositoryTypeAmazonS3 captures enum value "AmazonS3" - ERepositoryTypeAmazonS3 ERepositoryType = "AmazonS3" - - // ERepositoryTypeAmazonS3Glacier captures enum value "AmazonS3Glacier" - ERepositoryTypeAmazonS3Glacier ERepositoryType = "AmazonS3Glacier" - - // ERepositoryTypeS3Compatible captures enum value "S3Compatible" - ERepositoryTypeS3Compatible ERepositoryType = "S3Compatible" - - // ERepositoryTypeGoogleCloud captures enum value "GoogleCloud" - ERepositoryTypeGoogleCloud ERepositoryType = "GoogleCloud" - - // ERepositoryTypeIBMCloud captures enum value "IBMCloud" - ERepositoryTypeIBMCloud ERepositoryType = "IBMCloud" -) - -// for schema -var eRepositoryTypeEnum []interface{} - -func init() { - var res []ERepositoryType - if err := json.Unmarshal([]byte(`["WinLocal","LinuxLocal","Smb","Nfs","AzureBlob","AzureArchive","AmazonS3","AmazonS3Glacier","S3Compatible","GoogleCloud","IBMCloud"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eRepositoryTypeEnum = append(eRepositoryTypeEnum, v) - } -} - -func (m ERepositoryType) validateERepositoryTypeEnum(path, location string, value ERepositoryType) error { - if err := validate.EnumCase(path, location, value, eRepositoryTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e repository type -func (m ERepositoryType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateERepositoryTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e repository type based on context it is used -func (m ERepositoryType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_retain_log_backups_type.go b/models/e_retain_log_backups_type.go deleted file mode 100644 index 9ed3f7d..0000000 --- a/models/e_retain_log_backups_type.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ERetainLogBackupsType Retention policy for the logs stored in the backup repository. -// -// swagger:model ERetainLogBackupsType -type ERetainLogBackupsType string - -func NewERetainLogBackupsType(value ERetainLogBackupsType) *ERetainLogBackupsType { - v := value - return &v -} - -const ( - - // ERetainLogBackupsTypeUntilBackupDeleted captures enum value "untilBackupDeleted" - ERetainLogBackupsTypeUntilBackupDeleted ERetainLogBackupsType = "untilBackupDeleted" - - // ERetainLogBackupsTypeKeepOnlyDays captures enum value "KeepOnlyDays" - ERetainLogBackupsTypeKeepOnlyDays ERetainLogBackupsType = "KeepOnlyDays" -) - -// for schema -var eRetainLogBackupsTypeEnum []interface{} - -func init() { - var res []ERetainLogBackupsType - if err := json.Unmarshal([]byte(`["untilBackupDeleted","KeepOnlyDays"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eRetainLogBackupsTypeEnum = append(eRetainLogBackupsTypeEnum, v) - } -} - -func (m ERetainLogBackupsType) validateERetainLogBackupsTypeEnum(path, location string, value ERetainLogBackupsType) error { - if err := validate.EnumCase(path, location, value, eRetainLogBackupsTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e retain log backups type -func (m ERetainLogBackupsType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateERetainLogBackupsTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e retain log backups type based on context it is used -func (m ERetainLogBackupsType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_retention_policy_type.go b/models/e_retention_policy_type.go deleted file mode 100644 index 058bddb..0000000 --- a/models/e_retention_policy_type.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ERetentionPolicyType Type of the retention policy. -// -// swagger:model ERetentionPolicyType -type ERetentionPolicyType string - -func NewERetentionPolicyType(value ERetentionPolicyType) *ERetentionPolicyType { - v := value - return &v -} - -const ( - - // ERetentionPolicyTypeRestorePoints captures enum value "RestorePoints" - ERetentionPolicyTypeRestorePoints ERetentionPolicyType = "RestorePoints" - - // ERetentionPolicyTypeDays captures enum value "Days" - ERetentionPolicyTypeDays ERetentionPolicyType = "Days" -) - -// for schema -var eRetentionPolicyTypeEnum []interface{} - -func init() { - var res []ERetentionPolicyType - if err := json.Unmarshal([]byte(`["RestorePoints","Days"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eRetentionPolicyTypeEnum = append(eRetentionPolicyTypeEnum, v) - } -} - -func (m ERetentionPolicyType) validateERetentionPolicyTypeEnum(path, location string, value ERetentionPolicyType) error { - if err := validate.EnumCase(path, location, value, eRetentionPolicyTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e retention policy type -func (m ERetentionPolicyType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateERetentionPolicyTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e retention policy type based on context it is used -func (m ERetentionPolicyType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_scale_out_repository_filters_order_column.go b/models/e_scale_out_repository_filters_order_column.go deleted file mode 100644 index 5ebe89c..0000000 --- a/models/e_scale_out_repository_filters_order_column.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EScaleOutRepositoryFiltersOrderColumn e scale out repository filters order column -// -// swagger:model EScaleOutRepositoryFiltersOrderColumn -type EScaleOutRepositoryFiltersOrderColumn string - -func NewEScaleOutRepositoryFiltersOrderColumn(value EScaleOutRepositoryFiltersOrderColumn) *EScaleOutRepositoryFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EScaleOutRepositoryFiltersOrderColumnName captures enum value "Name" - EScaleOutRepositoryFiltersOrderColumnName EScaleOutRepositoryFiltersOrderColumn = "Name" - - // EScaleOutRepositoryFiltersOrderColumnDescription captures enum value "Description" - EScaleOutRepositoryFiltersOrderColumnDescription EScaleOutRepositoryFiltersOrderColumn = "Description" - - // EScaleOutRepositoryFiltersOrderColumnType captures enum value "Type" - EScaleOutRepositoryFiltersOrderColumnType EScaleOutRepositoryFiltersOrderColumn = "Type" - - // EScaleOutRepositoryFiltersOrderColumnHost captures enum value "Host" - EScaleOutRepositoryFiltersOrderColumnHost EScaleOutRepositoryFiltersOrderColumn = "Host" - - // EScaleOutRepositoryFiltersOrderColumnPath captures enum value "Path" - EScaleOutRepositoryFiltersOrderColumnPath EScaleOutRepositoryFiltersOrderColumn = "Path" -) - -// for schema -var eScaleOutRepositoryFiltersOrderColumnEnum []interface{} - -func init() { - var res []EScaleOutRepositoryFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Description","Type","Host","Path"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eScaleOutRepositoryFiltersOrderColumnEnum = append(eScaleOutRepositoryFiltersOrderColumnEnum, v) - } -} - -func (m EScaleOutRepositoryFiltersOrderColumn) validateEScaleOutRepositoryFiltersOrderColumnEnum(path, location string, value EScaleOutRepositoryFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eScaleOutRepositoryFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e scale out repository filters order column -func (m EScaleOutRepositoryFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEScaleOutRepositoryFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e scale out repository filters order column based on context it is used -func (m EScaleOutRepositoryFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_script_periodicity_type.go b/models/e_script_periodicity_type.go deleted file mode 100644 index 6e46b47..0000000 --- a/models/e_script_periodicity_type.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EScriptPeriodicityType Type of script periodicity. -// -// swagger:model EScriptPeriodicityType -type EScriptPeriodicityType string - -func NewEScriptPeriodicityType(value EScriptPeriodicityType) *EScriptPeriodicityType { - v := value - return &v -} - -const ( - - // EScriptPeriodicityTypeDays captures enum value "Days" - EScriptPeriodicityTypeDays EScriptPeriodicityType = "Days" - - // EScriptPeriodicityTypeBackupSessions captures enum value "BackupSessions" - EScriptPeriodicityTypeBackupSessions EScriptPeriodicityType = "BackupSessions" -) - -// for schema -var eScriptPeriodicityTypeEnum []interface{} - -func init() { - var res []EScriptPeriodicityType - if err := json.Unmarshal([]byte(`["Days","BackupSessions"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eScriptPeriodicityTypeEnum = append(eScriptPeriodicityTypeEnum, v) - } -} - -func (m EScriptPeriodicityType) validateEScriptPeriodicityTypeEnum(path, location string, value EScriptPeriodicityType) error { - if err := validate.EnumCase(path, location, value, eScriptPeriodicityTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e script periodicity type -func (m EScriptPeriodicityType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEScriptPeriodicityTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e script periodicity type based on context it is used -func (m EScriptPeriodicityType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_sennight_of_month.go b/models/e_sennight_of_month.go deleted file mode 100644 index 0c87b15..0000000 --- a/models/e_sennight_of_month.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ESennightOfMonth Sennight of the month. -// -// swagger:model ESennightOfMonth -type ESennightOfMonth string - -func NewESennightOfMonth(value ESennightOfMonth) *ESennightOfMonth { - v := value - return &v -} - -const ( - - // ESennightOfMonthFirst captures enum value "First" - ESennightOfMonthFirst ESennightOfMonth = "First" - - // ESennightOfMonthSecond captures enum value "Second" - ESennightOfMonthSecond ESennightOfMonth = "Second" - - // ESennightOfMonthThird captures enum value "Third" - ESennightOfMonthThird ESennightOfMonth = "Third" - - // ESennightOfMonthFourth captures enum value "Fourth" - ESennightOfMonthFourth ESennightOfMonth = "Fourth" - - // ESennightOfMonthFifth captures enum value "Fifth" - ESennightOfMonthFifth ESennightOfMonth = "Fifth" - - // ESennightOfMonthLast captures enum value "Last" - ESennightOfMonthLast ESennightOfMonth = "Last" -) - -// for schema -var eSennightOfMonthEnum []interface{} - -func init() { - var res []ESennightOfMonth - if err := json.Unmarshal([]byte(`["First","Second","Third","Fourth","Fifth","Last"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eSennightOfMonthEnum = append(eSennightOfMonthEnum, v) - } -} - -func (m ESennightOfMonth) validateESennightOfMonthEnum(path, location string, value ESennightOfMonth) error { - if err := validate.EnumCase(path, location, value, eSennightOfMonthEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e sennight of month -func (m ESennightOfMonth) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateESennightOfMonthEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e sennight of month based on context it is used -func (m ESennightOfMonth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_services_filters_order_column.go b/models/e_services_filters_order_column.go deleted file mode 100644 index c4f67b2..0000000 --- a/models/e_services_filters_order_column.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EServicesFiltersOrderColumn e services filters order column -// -// swagger:model EServicesFiltersOrderColumn -type EServicesFiltersOrderColumn string - -func NewEServicesFiltersOrderColumn(value EServicesFiltersOrderColumn) *EServicesFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EServicesFiltersOrderColumnName captures enum value "Name" - EServicesFiltersOrderColumnName EServicesFiltersOrderColumn = "Name" - - // EServicesFiltersOrderColumnPort captures enum value "Port" - EServicesFiltersOrderColumnPort EServicesFiltersOrderColumn = "Port" -) - -// for schema -var eServicesFiltersOrderColumnEnum []interface{} - -func init() { - var res []EServicesFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Port"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eServicesFiltersOrderColumnEnum = append(eServicesFiltersOrderColumnEnum, v) - } -} - -func (m EServicesFiltersOrderColumn) validateEServicesFiltersOrderColumnEnum(path, location string, value EServicesFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eServicesFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e services filters order column -func (m EServicesFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEServicesFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e services filters order column based on context it is used -func (m EServicesFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_session_result.go b/models/e_session_result.go deleted file mode 100644 index 72eb60d..0000000 --- a/models/e_session_result.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ESessionResult Result of the session. -// -// swagger:model ESessionResult -type ESessionResult string - -func NewESessionResult(value ESessionResult) *ESessionResult { - v := value - return &v -} - -const ( - - // ESessionResultNone captures enum value "None" - ESessionResultNone ESessionResult = "None" - - // ESessionResultSuccess captures enum value "Success" - ESessionResultSuccess ESessionResult = "Success" - - // ESessionResultWarning captures enum value "Warning" - ESessionResultWarning ESessionResult = "Warning" - - // ESessionResultFailed captures enum value "Failed" - ESessionResultFailed ESessionResult = "Failed" -) - -// for schema -var eSessionResultEnum []interface{} - -func init() { - var res []ESessionResult - if err := json.Unmarshal([]byte(`["None","Success","Warning","Failed"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eSessionResultEnum = append(eSessionResultEnum, v) - } -} - -func (m ESessionResult) validateESessionResultEnum(path, location string, value ESessionResult) error { - if err := validate.EnumCase(path, location, value, eSessionResultEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e session result -func (m ESessionResult) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateESessionResultEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e session result based on context it is used -func (m ESessionResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_session_state.go b/models/e_session_state.go deleted file mode 100644 index 2cfcfdb..0000000 --- a/models/e_session_state.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ESessionState State of the session. -// -// swagger:model ESessionState -type ESessionState string - -func NewESessionState(value ESessionState) *ESessionState { - v := value - return &v -} - -const ( - - // ESessionStateStopped captures enum value "Stopped" - ESessionStateStopped ESessionState = "Stopped" - - // ESessionStateStarting captures enum value "Starting" - ESessionStateStarting ESessionState = "Starting" - - // ESessionStateStopping captures enum value "Stopping" - ESessionStateStopping ESessionState = "Stopping" - - // ESessionStateWorking captures enum value "Working" - ESessionStateWorking ESessionState = "Working" - - // ESessionStatePausing captures enum value "Pausing" - ESessionStatePausing ESessionState = "Pausing" - - // ESessionStateResuming captures enum value "Resuming" - ESessionStateResuming ESessionState = "Resuming" - - // ESessionStateWaitingTape captures enum value "WaitingTape" - ESessionStateWaitingTape ESessionState = "WaitingTape" - - // ESessionStateIdle captures enum value "Idle" - ESessionStateIdle ESessionState = "Idle" - - // ESessionStatePostprocessing captures enum value "Postprocessing" - ESessionStatePostprocessing ESessionState = "Postprocessing" - - // ESessionStateWaitingRepository captures enum value "WaitingRepository" - ESessionStateWaitingRepository ESessionState = "WaitingRepository" - - // ESessionStateWaitingSlot captures enum value "WaitingSlot" - ESessionStateWaitingSlot ESessionState = "WaitingSlot" -) - -// for schema -var eSessionStateEnum []interface{} - -func init() { - var res []ESessionState - if err := json.Unmarshal([]byte(`["Stopped","Starting","Stopping","Working","Pausing","Resuming","WaitingTape","Idle","Postprocessing","WaitingRepository","WaitingSlot"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eSessionStateEnum = append(eSessionStateEnum, v) - } -} - -func (m ESessionState) validateESessionStateEnum(path, location string, value ESessionState) error { - if err := validate.EnumCase(path, location, value, eSessionStateEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e session state -func (m ESessionState) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateESessionStateEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e session state based on context it is used -func (m ESessionState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_session_type.go b/models/e_session_type.go deleted file mode 100644 index 3224d64..0000000 --- a/models/e_session_type.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ESessionType Type of the session. -// -// swagger:model ESessionType -type ESessionType string - -func NewESessionType(value ESessionType) *ESessionType { - v := value - return &v -} - -const ( - - // ESessionTypeInfrastructure captures enum value "Infrastructure" - ESessionTypeInfrastructure ESessionType = "Infrastructure" - - // ESessionTypeJob captures enum value "Job" - ESessionTypeJob ESessionType = "Job" - - // ESessionTypeAutomation captures enum value "Automation" - ESessionTypeAutomation ESessionType = "Automation" - - // ESessionTypeConfigurationBackup captures enum value "ConfigurationBackup" - ESessionTypeConfigurationBackup ESessionType = "ConfigurationBackup" - - // ESessionTypeRepositoryMaintenance captures enum value "RepositoryMaintenance" - ESessionTypeRepositoryMaintenance ESessionType = "RepositoryMaintenance" - - // ESessionTypeRepositoryEvacuate captures enum value "RepositoryEvacuate" - ESessionTypeRepositoryEvacuate ESessionType = "RepositoryEvacuate" - - // ESessionTypeInfrastructureItemDeletion captures enum value "InfrastructureItemDeletion" - ESessionTypeInfrastructureItemDeletion ESessionType = "InfrastructureItemDeletion" -) - -// for schema -var eSessionTypeEnum []interface{} - -func init() { - var res []ESessionType - if err := json.Unmarshal([]byte(`["Infrastructure","Job","Automation","ConfigurationBackup","RepositoryMaintenance","RepositoryEvacuate","InfrastructureItemDeletion"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eSessionTypeEnum = append(eSessionTypeEnum, v) - } -} - -func (m ESessionType) validateESessionTypeEnum(path, location string, value ESessionType) error { - if err := validate.EnumCase(path, location, value, eSessionTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e session type -func (m ESessionType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateESessionTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e session type based on context it is used -func (m ESessionType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_sessions_filters_order_column.go b/models/e_sessions_filters_order_column.go deleted file mode 100644 index 53e4296..0000000 --- a/models/e_sessions_filters_order_column.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ESessionsFiltersOrderColumn e sessions filters order column -// -// swagger:model ESessionsFiltersOrderColumn -type ESessionsFiltersOrderColumn string - -func NewESessionsFiltersOrderColumn(value ESessionsFiltersOrderColumn) *ESessionsFiltersOrderColumn { - v := value - return &v -} - -const ( - - // ESessionsFiltersOrderColumnName captures enum value "Name" - ESessionsFiltersOrderColumnName ESessionsFiltersOrderColumn = "Name" - - // ESessionsFiltersOrderColumnSessionType captures enum value "SessionType" - ESessionsFiltersOrderColumnSessionType ESessionsFiltersOrderColumn = "SessionType" - - // ESessionsFiltersOrderColumnCreationTime captures enum value "CreationTime" - ESessionsFiltersOrderColumnCreationTime ESessionsFiltersOrderColumn = "CreationTime" - - // ESessionsFiltersOrderColumnEndTime captures enum value "EndTime" - ESessionsFiltersOrderColumnEndTime ESessionsFiltersOrderColumn = "EndTime" - - // ESessionsFiltersOrderColumnState captures enum value "State" - ESessionsFiltersOrderColumnState ESessionsFiltersOrderColumn = "State" - - // ESessionsFiltersOrderColumnResult captures enum value "Result" - ESessionsFiltersOrderColumnResult ESessionsFiltersOrderColumn = "Result" -) - -// for schema -var eSessionsFiltersOrderColumnEnum []interface{} - -func init() { - var res []ESessionsFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","SessionType","CreationTime","EndTime","State","Result"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eSessionsFiltersOrderColumnEnum = append(eSessionsFiltersOrderColumnEnum, v) - } -} - -func (m ESessionsFiltersOrderColumn) validateESessionsFiltersOrderColumnEnum(path, location string, value ESessionsFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eSessionsFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e sessions filters order column -func (m ESessionsFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateESessionsFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e sessions filters order column based on context it is used -func (m ESessionsFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_speed_unit.go b/models/e_speed_unit.go deleted file mode 100644 index 53e5df2..0000000 --- a/models/e_speed_unit.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ESpeedUnit Traffic speed unit. -// -// swagger:model ESpeedUnit -type ESpeedUnit string - -func NewESpeedUnit(value ESpeedUnit) *ESpeedUnit { - v := value - return &v -} - -const ( - - // ESpeedUnitKbytePerSec captures enum value "KbytePerSec" - ESpeedUnitKbytePerSec ESpeedUnit = "KbytePerSec" - - // ESpeedUnitMbitPerSpec captures enum value "MbitPerSpec" - ESpeedUnitMbitPerSpec ESpeedUnit = "MbitPerSpec" - - // ESpeedUnitMbytePerSec captures enum value "MbytePerSec" - ESpeedUnitMbytePerSec ESpeedUnit = "MbytePerSec" -) - -// for schema -var eSpeedUnitEnum []interface{} - -func init() { - var res []ESpeedUnit - if err := json.Unmarshal([]byte(`["KbytePerSec","MbitPerSpec","MbytePerSec"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eSpeedUnitEnum = append(eSpeedUnitEnum, v) - } -} - -func (m ESpeedUnit) validateESpeedUnitEnum(path, location string, value ESpeedUnit) error { - if err := validate.EnumCase(path, location, value, eSpeedUnitEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e speed unit -func (m ESpeedUnit) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateESpeedUnitEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e speed unit based on context it is used -func (m ESpeedUnit) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_sql_logs_processing.go b/models/e_sql_logs_processing.go deleted file mode 100644 index 6f09474..0000000 --- a/models/e_sql_logs_processing.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ESQLLogsProcessing Type of transaction logs processing. -// -// swagger:model ESQLLogsProcessing -type ESQLLogsProcessing string - -func NewESQLLogsProcessing(value ESQLLogsProcessing) *ESQLLogsProcessing { - v := value - return &v -} - -const ( - - // ESQLLogsProcessingTruncate captures enum value "truncate" - ESQLLogsProcessingTruncate ESQLLogsProcessing = "truncate" - - // ESQLLogsProcessingPreserve captures enum value "preserve" - ESQLLogsProcessingPreserve ESQLLogsProcessing = "preserve" - - // ESQLLogsProcessingBackup captures enum value "backup" - ESQLLogsProcessingBackup ESQLLogsProcessing = "backup" - - // ESQLLogsProcessingNeverTruncate captures enum value "neverTruncate" - ESQLLogsProcessingNeverTruncate ESQLLogsProcessing = "neverTruncate" -) - -// for schema -var eSqlLogsProcessingEnum []interface{} - -func init() { - var res []ESQLLogsProcessing - if err := json.Unmarshal([]byte(`["truncate","preserve","backup","neverTruncate"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eSqlLogsProcessingEnum = append(eSqlLogsProcessingEnum, v) - } -} - -func (m ESQLLogsProcessing) validateESQLLogsProcessingEnum(path, location string, value ESQLLogsProcessing) error { - if err := validate.EnumCase(path, location, value, eSqlLogsProcessingEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e SQL logs processing -func (m ESQLLogsProcessing) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateESQLLogsProcessingEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e SQL logs processing based on context it is used -func (m ESQLLogsProcessing) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_storage_optimization.go b/models/e_storage_optimization.go deleted file mode 100644 index 7b0b91d..0000000 --- a/models/e_storage_optimization.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EStorageOptimization Storage optimization that depends on the target type. -// -// swagger:model EStorageOptimization -type EStorageOptimization string - -func NewEStorageOptimization(value EStorageOptimization) *EStorageOptimization { - v := value - return &v -} - -const ( - - // EStorageOptimizationAuto captures enum value "Auto" - EStorageOptimizationAuto EStorageOptimization = "Auto" - - // EStorageOptimizationLocalTargetLarge captures enum value "LocalTargetLarge" - EStorageOptimizationLocalTargetLarge EStorageOptimization = "LocalTargetLarge" - - // EStorageOptimizationLocalTarget captures enum value "LocalTarget" - EStorageOptimizationLocalTarget EStorageOptimization = "LocalTarget" - - // EStorageOptimizationLANTarget captures enum value "LANTarget" - EStorageOptimizationLANTarget EStorageOptimization = "LANTarget" - - // EStorageOptimizationWANTarget captures enum value "WANTarget" - EStorageOptimizationWANTarget EStorageOptimization = "WANTarget" -) - -// for schema -var eStorageOptimizationEnum []interface{} - -func init() { - var res []EStorageOptimization - if err := json.Unmarshal([]byte(`["Auto","LocalTargetLarge","LocalTarget","LANTarget","WANTarget"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eStorageOptimizationEnum = append(eStorageOptimizationEnum, v) - } -} - -func (m EStorageOptimization) validateEStorageOptimizationEnum(path, location string, value EStorageOptimization) error { - if err := validate.EnumCase(path, location, value, eStorageOptimizationEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e storage optimization -func (m EStorageOptimization) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEStorageOptimizationEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e storage optimization based on context it is used -func (m EStorageOptimization) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_task_log_record_status.go b/models/e_task_log_record_status.go deleted file mode 100644 index 96ed9b4..0000000 --- a/models/e_task_log_record_status.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ETaskLogRecordStatus e task log record status -// -// swagger:model ETaskLogRecordStatus -type ETaskLogRecordStatus string - -func NewETaskLogRecordStatus(value ETaskLogRecordStatus) *ETaskLogRecordStatus { - v := value - return &v -} - -const ( - - // ETaskLogRecordStatusNone captures enum value "None" - ETaskLogRecordStatusNone ETaskLogRecordStatus = "None" - - // ETaskLogRecordStatusSucceeded captures enum value "Succeeded" - ETaskLogRecordStatusSucceeded ETaskLogRecordStatus = "Succeeded" - - // ETaskLogRecordStatusWarning captures enum value "Warning" - ETaskLogRecordStatusWarning ETaskLogRecordStatus = "Warning" - - // ETaskLogRecordStatusFailed captures enum value "Failed" - ETaskLogRecordStatusFailed ETaskLogRecordStatus = "Failed" -) - -// for schema -var eTaskLogRecordStatusEnum []interface{} - -func init() { - var res []ETaskLogRecordStatus - if err := json.Unmarshal([]byte(`["None","Succeeded","Warning","Failed"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eTaskLogRecordStatusEnum = append(eTaskLogRecordStatusEnum, v) - } -} - -func (m ETaskLogRecordStatus) validateETaskLogRecordStatusEnum(path, location string, value ETaskLogRecordStatus) error { - if err := validate.EnumCase(path, location, value, eTaskLogRecordStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e task log record status -func (m ETaskLogRecordStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateETaskLogRecordStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e task log record status based on context it is used -func (m ETaskLogRecordStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_transaction_logs_settings.go b/models/e_transaction_logs_settings.go deleted file mode 100644 index 39ebac5..0000000 --- a/models/e_transaction_logs_settings.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ETransactionLogsSettings Transaction logs settings that define whether copy-only backups must be created or transaction logs for Microsoft Exchange, Microsoft SQL and Oracle VMs must be processed.
-// If transaction log processing is selected, specify the following parameters:
-//
    -//
  • [For Microsoft SQL Server VMs] Microsoft SQL Server transaction log settings
  • -//
  • [For Oracle VMs] Oracle archived log settings
  • -//
-// -// -// swagger:model ETransactionLogsSettings -type ETransactionLogsSettings string - -func NewETransactionLogsSettings(value ETransactionLogsSettings) *ETransactionLogsSettings { - v := value - return &v -} - -const ( - - // ETransactionLogsSettingsProcess captures enum value "process" - ETransactionLogsSettingsProcess ETransactionLogsSettings = "process" - - // ETransactionLogsSettingsCopyOnly captures enum value "copyOnly" - ETransactionLogsSettingsCopyOnly ETransactionLogsSettings = "copyOnly" -) - -// for schema -var eTransactionLogsSettingsEnum []interface{} - -func init() { - var res []ETransactionLogsSettings - if err := json.Unmarshal([]byte(`["process","copyOnly"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eTransactionLogsSettingsEnum = append(eTransactionLogsSettingsEnum, v) - } -} - -func (m ETransactionLogsSettings) validateETransactionLogsSettingsEnum(path, location string, value ETransactionLogsSettings) error { - if err := validate.EnumCase(path, location, value, eTransactionLogsSettingsEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e transaction logs settings -func (m ETransactionLogsSettings) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateETransactionLogsSettingsEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e transaction logs settings based on context it is used -func (m ETransactionLogsSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_vi_host_type.go b/models/e_vi_host_type.go deleted file mode 100644 index c83085c..0000000 --- a/models/e_vi_host_type.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EViHostType Type of the VMware vSphere server. -// -// swagger:model EViHostType -type EViHostType string - -func NewEViHostType(value EViHostType) *EViHostType { - v := value - return &v -} - -const ( - - // EViHostTypeESX captures enum value "ESX" - EViHostTypeESX EViHostType = "ESX" - - // EViHostTypeESXi captures enum value "ESXi" - EViHostTypeESXi EViHostType = "ESXi" - - // EViHostTypeVC captures enum value "VC" - EViHostTypeVC EViHostType = "VC" -) - -// for schema -var eViHostTypeEnum []interface{} - -func init() { - var res []EViHostType - if err := json.Unmarshal([]byte(`["ESX","ESXi","VC"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eViHostTypeEnum = append(eViHostTypeEnum, v) - } -} - -func (m EViHostType) validateEViHostTypeEnum(path, location string, value EViHostType) error { - if err := validate.EnumCase(path, location, value, eViHostTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e vi host type -func (m EViHostType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEViHostTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e vi host type based on context it is used -func (m EViHostType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_vi_root_filters_order_column.go b/models/e_vi_root_filters_order_column.go deleted file mode 100644 index ed0ed33..0000000 --- a/models/e_vi_root_filters_order_column.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EViRootFiltersOrderColumn Sorts VMware vSphere servers by one of the VMware vSphere server parameters. -// -// swagger:model EViRootFiltersOrderColumn -type EViRootFiltersOrderColumn string - -func NewEViRootFiltersOrderColumn(value EViRootFiltersOrderColumn) *EViRootFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EViRootFiltersOrderColumnName captures enum value "Name" - EViRootFiltersOrderColumnName EViRootFiltersOrderColumn = "Name" - - // EViRootFiltersOrderColumnType captures enum value "Type" - EViRootFiltersOrderColumnType EViRootFiltersOrderColumn = "Type" -) - -// for schema -var eViRootFiltersOrderColumnEnum []interface{} - -func init() { - var res []EViRootFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","Type"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eViRootFiltersOrderColumnEnum = append(eViRootFiltersOrderColumnEnum, v) - } -} - -func (m EViRootFiltersOrderColumn) validateEViRootFiltersOrderColumnEnum(path, location string, value EViRootFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, eViRootFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e vi root filters order column -func (m EViRootFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEViRootFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e vi root filters order column based on context it is used -func (m EViRootFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_vmware_disks_type_to_process.go b/models/e_vmware_disks_type_to_process.go deleted file mode 100644 index f0e845f..0000000 --- a/models/e_vmware_disks_type_to_process.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EVmwareDisksTypeToProcess Type of disk selection. -// -// swagger:model EVmwareDisksTypeToProcess -type EVmwareDisksTypeToProcess string - -func NewEVmwareDisksTypeToProcess(value EVmwareDisksTypeToProcess) *EVmwareDisksTypeToProcess { - v := value - return &v -} - -const ( - - // EVmwareDisksTypeToProcessAllDisks captures enum value "AllDisks" - EVmwareDisksTypeToProcessAllDisks EVmwareDisksTypeToProcess = "AllDisks" - - // EVmwareDisksTypeToProcessSystemOnly captures enum value "SystemOnly" - EVmwareDisksTypeToProcessSystemOnly EVmwareDisksTypeToProcess = "SystemOnly" - - // EVmwareDisksTypeToProcessSelectedDisks captures enum value "SelectedDisks" - EVmwareDisksTypeToProcessSelectedDisks EVmwareDisksTypeToProcess = "SelectedDisks" -) - -// for schema -var eVmwareDisksTypeToProcessEnum []interface{} - -func init() { - var res []EVmwareDisksTypeToProcess - if err := json.Unmarshal([]byte(`["AllDisks","SystemOnly","SelectedDisks"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eVmwareDisksTypeToProcessEnum = append(eVmwareDisksTypeToProcessEnum, v) - } -} - -func (m EVmwareDisksTypeToProcess) validateEVmwareDisksTypeToProcessEnum(path, location string, value EVmwareDisksTypeToProcess) error { - if err := validate.EnumCase(path, location, value, eVmwareDisksTypeToProcessEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e vmware disks type to process -func (m EVmwareDisksTypeToProcess) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEVmwareDisksTypeToProcessEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e vmware disks type to process based on context it is used -func (m EVmwareDisksTypeToProcess) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_vmware_inventory_type.go b/models/e_vmware_inventory_type.go deleted file mode 100644 index a65a680..0000000 --- a/models/e_vmware_inventory_type.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EVmwareInventoryType Type of the VMware vSphere object. -// -// swagger:model EVmwareInventoryType -type EVmwareInventoryType string - -func NewEVmwareInventoryType(value EVmwareInventoryType) *EVmwareInventoryType { - v := value - return &v -} - -const ( - - // EVmwareInventoryTypeUnknown captures enum value "Unknown" - EVmwareInventoryTypeUnknown EVmwareInventoryType = "Unknown" - - // EVmwareInventoryTypeVirtualMachine captures enum value "VirtualMachine" - EVmwareInventoryTypeVirtualMachine EVmwareInventoryType = "VirtualMachine" - - // EVmwareInventoryTypeVCenterServer captures enum value "vCenterServer" - EVmwareInventoryTypeVCenterServer EVmwareInventoryType = "vCenterServer" - - // EVmwareInventoryTypeDatacenter captures enum value "Datacenter" - EVmwareInventoryTypeDatacenter EVmwareInventoryType = "Datacenter" - - // EVmwareInventoryTypeCluster captures enum value "Cluster" - EVmwareInventoryTypeCluster EVmwareInventoryType = "Cluster" - - // EVmwareInventoryTypeHost captures enum value "Host" - EVmwareInventoryTypeHost EVmwareInventoryType = "Host" - - // EVmwareInventoryTypeResourcePool captures enum value "ResourcePool" - EVmwareInventoryTypeResourcePool EVmwareInventoryType = "ResourcePool" - - // EVmwareInventoryTypeFolder captures enum value "Folder" - EVmwareInventoryTypeFolder EVmwareInventoryType = "Folder" - - // EVmwareInventoryTypeDatastore captures enum value "Datastore" - EVmwareInventoryTypeDatastore EVmwareInventoryType = "Datastore" - - // EVmwareInventoryTypeDatastoreCluster captures enum value "DatastoreCluster" - EVmwareInventoryTypeDatastoreCluster EVmwareInventoryType = "DatastoreCluster" - - // EVmwareInventoryTypeStoragePolicy captures enum value "StoragePolicy" - EVmwareInventoryTypeStoragePolicy EVmwareInventoryType = "StoragePolicy" - - // EVmwareInventoryTypeTemplate captures enum value "Template" - EVmwareInventoryTypeTemplate EVmwareInventoryType = "Template" - - // EVmwareInventoryTypeComputeResource captures enum value "ComputeResource" - EVmwareInventoryTypeComputeResource EVmwareInventoryType = "ComputeResource" - - // EVmwareInventoryTypeVirtualApp captures enum value "VirtualApp" - EVmwareInventoryTypeVirtualApp EVmwareInventoryType = "VirtualApp" - - // EVmwareInventoryTypeTag captures enum value "Tag" - EVmwareInventoryTypeTag EVmwareInventoryType = "Tag" - - // EVmwareInventoryTypeCategory captures enum value "Category" - EVmwareInventoryTypeCategory EVmwareInventoryType = "Category" - - // EVmwareInventoryTypeMultitag captures enum value "Multitag" - EVmwareInventoryTypeMultitag EVmwareInventoryType = "Multitag" -) - -// for schema -var eVmwareInventoryTypeEnum []interface{} - -func init() { - var res []EVmwareInventoryType - if err := json.Unmarshal([]byte(`["Unknown","VirtualMachine","vCenterServer","Datacenter","Cluster","Host","ResourcePool","Folder","Datastore","DatastoreCluster","StoragePolicy","Template","ComputeResource","VirtualApp","Tag","Category","Multitag"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eVmwareInventoryTypeEnum = append(eVmwareInventoryTypeEnum, v) - } -} - -func (m EVmwareInventoryType) validateEVmwareInventoryTypeEnum(path, location string, value EVmwareInventoryType) error { - if err := validate.EnumCase(path, location, value, eVmwareInventoryTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e vmware inventory type -func (m EVmwareInventoryType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEVmwareInventoryTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e vmware inventory type based on context it is used -func (m EVmwareInventoryType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/e_windows_host_component_type.go b/models/e_windows_host_component_type.go deleted file mode 100644 index eb5dbce..0000000 --- a/models/e_windows_host_component_type.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EWindowsHostComponentType Veeam Backup & Replication component. -// -// swagger:model EWindowsHostComponentType -type EWindowsHostComponentType string - -func NewEWindowsHostComponentType(value EWindowsHostComponentType) *EWindowsHostComponentType { - v := value - return &v -} - -const ( - - // EWindowsHostComponentTypeTransport captures enum value "Transport" - EWindowsHostComponentTypeTransport EWindowsHostComponentType = "Transport" - - // EWindowsHostComponentTypeNfs captures enum value "Nfs" - EWindowsHostComponentTypeNfs EWindowsHostComponentType = "Nfs" - - // EWindowsHostComponentTypeHvIntegration captures enum value "HvIntegration" - EWindowsHostComponentTypeHvIntegration EWindowsHostComponentType = "HvIntegration" - - // EWindowsHostComponentTypeDeployerSvc captures enum value "DeployerSvc" - EWindowsHostComponentTypeDeployerSvc EWindowsHostComponentType = "DeployerSvc" - - // EWindowsHostComponentTypeWanAccelerator captures enum value "WanAccelerator" - EWindowsHostComponentTypeWanAccelerator EWindowsHostComponentType = "WanAccelerator" - - // EWindowsHostComponentTypeTape captures enum value "Tape" - EWindowsHostComponentTypeTape EWindowsHostComponentType = "Tape" - - // EWindowsHostComponentTypeCloudGate captures enum value "CloudGate" - EWindowsHostComponentTypeCloudGate EWindowsHostComponentType = "CloudGate" - - // EWindowsHostComponentTypeCloudServiceInvoker captures enum value "CloudServiceInvoker" - EWindowsHostComponentTypeCloudServiceInvoker EWindowsHostComponentType = "CloudServiceInvoker" - - // EWindowsHostComponentTypeCloudServiceRemoting captures enum value "CloudServiceRemoting" - EWindowsHostComponentTypeCloudServiceRemoting EWindowsHostComponentType = "CloudServiceRemoting" - - // EWindowsHostComponentTypeRestoreProxy captures enum value "RestoreProxy" - EWindowsHostComponentTypeRestoreProxy EWindowsHostComponentType = "RestoreProxy" - - // EWindowsHostComponentTypeEpAgent captures enum value "EpAgent" - EWindowsHostComponentTypeEpAgent EWindowsHostComponentType = "EpAgent" - - // EWindowsHostComponentTypeEpAgentSQLLocalDB captures enum value "EpAgentSqlLocalDB" - EWindowsHostComponentTypeEpAgentSQLLocalDB EWindowsHostComponentType = "EpAgentSqlLocalDB" - - // EWindowsHostComponentTypeEpAgentSharedManagementObjects captures enum value "EpAgentSharedManagementObjects" - EWindowsHostComponentTypeEpAgentSharedManagementObjects EWindowsHostComponentType = "EpAgentSharedManagementObjects" - - // EWindowsHostComponentTypeEpAgentSQLSysClrTypes captures enum value "EpAgentSqlSysClrTypes" - EWindowsHostComponentTypeEpAgentSQLSysClrTypes EWindowsHostComponentType = "EpAgentSqlSysClrTypes" - - // EWindowsHostComponentTypeAgentConfigureService captures enum value "AgentConfigureService" - EWindowsHostComponentTypeAgentConfigureService EWindowsHostComponentType = "AgentConfigureService" - - // EWindowsHostComponentTypeVawRedist captures enum value "VawRedist" - EWindowsHostComponentTypeVawRedist EWindowsHostComponentType = "VawRedist" - - // EWindowsHostComponentTypeValRedist captures enum value "ValRedist" - EWindowsHostComponentTypeValRedist EWindowsHostComponentType = "ValRedist" - - // EWindowsHostComponentTypeGuestControl captures enum value "GuestControl" - EWindowsHostComponentTypeGuestControl EWindowsHostComponentType = "GuestControl" - - // EWindowsHostComponentTypeFileSystemVssIntegration captures enum value "FileSystemVssIntegration" - EWindowsHostComponentTypeFileSystemVssIntegration EWindowsHostComponentType = "FileSystemVssIntegration" - - // EWindowsHostComponentTypeVssHwSnapshotProvider captures enum value "VssHwSnapshotProvider" - EWindowsHostComponentTypeVssHwSnapshotProvider EWindowsHostComponentType = "VssHwSnapshotProvider" - - // EWindowsHostComponentTypeCdp captures enum value "Cdp" - EWindowsHostComponentTypeCdp EWindowsHostComponentType = "Cdp" - - // EWindowsHostComponentTypeVamRedist captures enum value "VamRedist" - EWindowsHostComponentTypeVamRedist EWindowsHostComponentType = "VamRedist" -) - -// for schema -var eWindowsHostComponentTypeEnum []interface{} - -func init() { - var res []EWindowsHostComponentType - if err := json.Unmarshal([]byte(`["Transport","Nfs","HvIntegration","DeployerSvc","WanAccelerator","Tape","CloudGate","CloudServiceInvoker","CloudServiceRemoting","RestoreProxy","EpAgent","EpAgentSqlLocalDB","EpAgentSharedManagementObjects","EpAgentSqlSysClrTypes","AgentConfigureService","VawRedist","ValRedist","GuestControl","FileSystemVssIntegration","VssHwSnapshotProvider","Cdp","VamRedist"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - eWindowsHostComponentTypeEnum = append(eWindowsHostComponentTypeEnum, v) - } -} - -func (m EWindowsHostComponentType) validateEWindowsHostComponentTypeEnum(path, location string, value EWindowsHostComponentType) error { - if err := validate.EnumCase(path, location, value, eWindowsHostComponentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this e windows host component type -func (m EWindowsHostComponentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEWindowsHostComponentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this e windows host component type based on context it is used -func (m EWindowsHostComponentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/email_custom_notification_type.go b/models/email_custom_notification_type.go deleted file mode 100644 index 6ee08eb..0000000 --- a/models/email_custom_notification_type.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EmailCustomNotificationType email custom notification type -// -// swagger:model EmailCustomNotificationType -type EmailCustomNotificationType struct { - - // If *true*, email notifications are sent about the final job status only (not per every job retry). - SuppressNotificationUntilLastRetry bool `json:"SuppressNotificationUntilLastRetry,omitempty"` - - // If *true*, email notifications are sent when the job fails. - NotifyOnError bool `json:"notifyOnError,omitempty"` - - // If *true*, email notifications are sent when the job completes successfully. - NotifyOnSuccess bool `json:"notifyOnSuccess,omitempty"` - - // If *true*, email notifications are sent when the job completes with a warning. - NotifyOnWarning bool `json:"notifyOnWarning,omitempty"` - - // Notification subject. Use the following variables in the subject: *%Time%* (completion time), *%JobName%*, *%JobResult%*, *%ObjectCount%* (number of VMs in the job) and *%Issues%* (number of VMs in the job that have finished with the Warning or Failed status). - // - Subject string `json:"subject,omitempty"` -} - -// Validate validates this email custom notification type -func (m *EmailCustomNotificationType) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this email custom notification type based on context it is used -func (m *EmailCustomNotificationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EmailCustomNotificationType) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EmailCustomNotificationType) UnmarshalBinary(b []byte) error { - var res EmailCustomNotificationType - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/email_notification_settings_model.go b/models/email_notification_settings_model.go deleted file mode 100644 index 501bace..0000000 --- a/models/email_notification_settings_model.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EmailNotificationSettingsModel Email notification settings for the backup job. -// -// swagger:model EmailNotificationSettingsModel -type EmailNotificationSettingsModel struct { - - // custom notification settings - CustomNotificationSettings *EmailCustomNotificationType `json:"customNotificationSettings,omitempty"` - - // If *true*, email notifications are enabled for this job. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // notification type - NotificationType EEmailNotificationType `json:"notificationType,omitempty"` - - // Array of recipient’s email addresses. - // Unique: true - Recipients []string `json:"recipients"` -} - -// Validate validates this email notification settings model -func (m *EmailNotificationSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCustomNotificationSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotificationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecipients(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EmailNotificationSettingsModel) validateCustomNotificationSettings(formats strfmt.Registry) error { - if swag.IsZero(m.CustomNotificationSettings) { // not required - return nil - } - - if m.CustomNotificationSettings != nil { - if err := m.CustomNotificationSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customNotificationSettings") - } - return err - } - } - - return nil -} - -func (m *EmailNotificationSettingsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *EmailNotificationSettingsModel) validateNotificationType(formats strfmt.Registry) error { - if swag.IsZero(m.NotificationType) { // not required - return nil - } - - if err := m.NotificationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("notificationType") - } - return err - } - - return nil -} - -func (m *EmailNotificationSettingsModel) validateRecipients(formats strfmt.Registry) error { - if swag.IsZero(m.Recipients) { // not required - return nil - } - - if err := validate.UniqueItems("recipients", "body", m.Recipients); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this email notification settings model based on the context it is used -func (m *EmailNotificationSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCustomNotificationSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNotificationType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EmailNotificationSettingsModel) contextValidateCustomNotificationSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.CustomNotificationSettings != nil { - if err := m.CustomNotificationSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customNotificationSettings") - } - return err - } - } - - return nil -} - -func (m *EmailNotificationSettingsModel) contextValidateNotificationType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.NotificationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("notificationType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EmailNotificationSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EmailNotificationSettingsModel) UnmarshalBinary(b []byte) error { - var res EmailNotificationSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/empty_success_response.go b/models/empty_success_response.go deleted file mode 100644 index 5e9745a..0000000 --- a/models/empty_success_response.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// EmptySuccessResponse Empty success response (200, 201, 204). -// -// swagger:model EmptySuccessResponse -type EmptySuccessResponse interface{} diff --git a/models/encryption_password_export_spec.go b/models/encryption_password_export_spec.go deleted file mode 100644 index a171501..0000000 --- a/models/encryption_password_export_spec.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EncryptionPasswordExportSpec encryption password export spec -// -// swagger:model EncryptionPasswordExportSpec -type EncryptionPasswordExportSpec struct { - - // Array of password hints. - // Unique: true - Hints []string `json:"hints"` - - // Array of password IDs. - // Unique: true - Ids []strfmt.UUID `json:"ids"` - - // Date and time the password was last modified. - // Format: date-time - ModificationTimeFrom strfmt.DateTime `json:"modificationTimeFrom,omitempty"` - - // Array of password tags. - // Unique: true - Tags []string `json:"tags"` -} - -// Validate validates this encryption password export spec -func (m *EncryptionPasswordExportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHints(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateModificationTimeFrom(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordExportSpec) validateHints(formats strfmt.Registry) error { - if swag.IsZero(m.Hints) { // not required - return nil - } - - if err := validate.UniqueItems("hints", "body", m.Hints); err != nil { - return err - } - - return nil -} - -func (m *EncryptionPasswordExportSpec) validateIds(formats strfmt.Registry) error { - if swag.IsZero(m.Ids) { // not required - return nil - } - - if err := validate.UniqueItems("ids", "body", m.Ids); err != nil { - return err - } - - for i := 0; i < len(m.Ids); i++ { - - if err := validate.FormatOf("ids"+"."+strconv.Itoa(i), "body", "uuid", m.Ids[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -func (m *EncryptionPasswordExportSpec) validateModificationTimeFrom(formats strfmt.Registry) error { - if swag.IsZero(m.ModificationTimeFrom) { // not required - return nil - } - - if err := validate.FormatOf("modificationTimeFrom", "body", "date-time", m.ModificationTimeFrom.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EncryptionPasswordExportSpec) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if err := validate.UniqueItems("tags", "body", m.Tags); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this encryption password export spec based on context it is used -func (m *EncryptionPasswordExportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EncryptionPasswordExportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EncryptionPasswordExportSpec) UnmarshalBinary(b []byte) error { - var res EncryptionPasswordExportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/encryption_password_import_spec.go b/models/encryption_password_import_spec.go deleted file mode 100644 index 9cb3b9e..0000000 --- a/models/encryption_password_import_spec.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EncryptionPasswordImportSpec encryption password import spec -// -// swagger:model EncryptionPasswordImportSpec -type EncryptionPasswordImportSpec struct { - - // Hint for the encryption password. - // Required: true - Hint *string `json:"hint"` - - // Password. - // Required: true - Password *string `json:"password"` - - // Tag for the encryption password. - Tag string `json:"tag,omitempty"` -} - -// Validate validates this encryption password import spec -func (m *EncryptionPasswordImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHint(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassword(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordImportSpec) validateHint(formats strfmt.Registry) error { - - if err := validate.Required("hint", "body", m.Hint); err != nil { - return err - } - - return nil -} - -func (m *EncryptionPasswordImportSpec) validatePassword(formats strfmt.Registry) error { - - if err := validate.Required("password", "body", m.Password); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this encryption password import spec based on context it is used -func (m *EncryptionPasswordImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EncryptionPasswordImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EncryptionPasswordImportSpec) UnmarshalBinary(b []byte) error { - var res EncryptionPasswordImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/encryption_password_import_spec_collection.go b/models/encryption_password_import_spec_collection.go deleted file mode 100644 index 898dc65..0000000 --- a/models/encryption_password_import_spec_collection.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EncryptionPasswordImportSpecCollection encryption password import spec collection -// -// swagger:model EncryptionPasswordImportSpecCollection -type EncryptionPasswordImportSpecCollection struct { - - // Array of encryption passwords. - // Unique: true - EncryptionPasswords []*EncryptionPasswordImportSpec `json:"encryptionPasswords"` -} - -// Validate validates this encryption password import spec collection -func (m *EncryptionPasswordImportSpecCollection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEncryptionPasswords(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordImportSpecCollection) validateEncryptionPasswords(formats strfmt.Registry) error { - if swag.IsZero(m.EncryptionPasswords) { // not required - return nil - } - - if err := validate.UniqueItems("encryptionPasswords", "body", m.EncryptionPasswords); err != nil { - return err - } - - for i := 0; i < len(m.EncryptionPasswords); i++ { - if swag.IsZero(m.EncryptionPasswords[i]) { // not required - continue - } - - if m.EncryptionPasswords[i] != nil { - if err := m.EncryptionPasswords[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryptionPasswords" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this encryption password import spec collection based on the context it is used -func (m *EncryptionPasswordImportSpecCollection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEncryptionPasswords(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordImportSpecCollection) contextValidateEncryptionPasswords(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.EncryptionPasswords); i++ { - - if m.EncryptionPasswords[i] != nil { - if err := m.EncryptionPasswords[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryptionPasswords" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EncryptionPasswordImportSpecCollection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EncryptionPasswordImportSpecCollection) UnmarshalBinary(b []byte) error { - var res EncryptionPasswordImportSpecCollection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/encryption_password_model.go b/models/encryption_password_model.go deleted file mode 100644 index 0ac0d07..0000000 --- a/models/encryption_password_model.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EncryptionPasswordModel encryption password model -// -// swagger:model EncryptionPasswordModel -type EncryptionPasswordModel struct { - - // Hint for the encryption password. - // Required: true - Hint *string `json:"hint"` - - // ID of the encryption password. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Date and time the password was last modified. - // Format: date-time - ModificationTime strfmt.DateTime `json:"modificationTime,omitempty"` - - // Tag for the encryption password. - Tag string `json:"tag,omitempty"` -} - -// Validate validates this encryption password model -func (m *EncryptionPasswordModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateModificationTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordModel) validateHint(formats strfmt.Registry) error { - - if err := validate.Required("hint", "body", m.Hint); err != nil { - return err - } - - return nil -} - -func (m *EncryptionPasswordModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EncryptionPasswordModel) validateModificationTime(formats strfmt.Registry) error { - if swag.IsZero(m.ModificationTime) { // not required - return nil - } - - if err := validate.FormatOf("modificationTime", "body", "date-time", m.ModificationTime.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this encryption password model based on context it is used -func (m *EncryptionPasswordModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EncryptionPasswordModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EncryptionPasswordModel) UnmarshalBinary(b []byte) error { - var res EncryptionPasswordModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/encryption_password_spec.go b/models/encryption_password_spec.go deleted file mode 100644 index 9808a7a..0000000 --- a/models/encryption_password_spec.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EncryptionPasswordSpec encryption password spec -// -// swagger:model EncryptionPasswordSpec -type EncryptionPasswordSpec struct { - - // Hint for the encryption password. Provide a meaningful hint that will help you recall the password. - // Required: true - Hint *string `json:"hint"` - - // Password for data encryption. If you lose the password, you will not be able to restore it. - // Required: true - Password *string `json:"password"` - - // Tag for the encryption password. - Tag string `json:"tag,omitempty"` -} - -// Validate validates this encryption password spec -func (m *EncryptionPasswordSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHint(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassword(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordSpec) validateHint(formats strfmt.Registry) error { - - if err := validate.Required("hint", "body", m.Hint); err != nil { - return err - } - - return nil -} - -func (m *EncryptionPasswordSpec) validatePassword(formats strfmt.Registry) error { - - if err := validate.Required("password", "body", m.Password); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this encryption password spec based on context it is used -func (m *EncryptionPasswordSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EncryptionPasswordSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EncryptionPasswordSpec) UnmarshalBinary(b []byte) error { - var res EncryptionPasswordSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/encryption_passwords_filters.go b/models/encryption_passwords_filters.go deleted file mode 100644 index 74355f3..0000000 --- a/models/encryption_passwords_filters.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EncryptionPasswordsFilters encryption passwords filters -// -// swagger:model EncryptionPasswordsFilters -type EncryptionPasswordsFilters struct { - - // limit - Limit int32 `json:"limit,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EEncryptionPasswordsFiltersOrderColumn `json:"orderColumn,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` -} - -// Validate validates this encryption passwords filters -func (m *EncryptionPasswordsFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordsFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// ContextValidate validate this encryption passwords filters based on the context it is used -func (m *EncryptionPasswordsFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordsFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EncryptionPasswordsFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EncryptionPasswordsFilters) UnmarshalBinary(b []byte) error { - var res EncryptionPasswordsFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/encryption_passwords_result.go b/models/encryption_passwords_result.go deleted file mode 100644 index bd7a9c4..0000000 --- a/models/encryption_passwords_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EncryptionPasswordsResult encryption passwords result -// -// swagger:model EncryptionPasswordsResult -type EncryptionPasswordsResult struct { - - // Array of encryption passwords. - // Required: true - Data []*EncryptionPasswordModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this encryption passwords result -func (m *EncryptionPasswordsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordsResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *EncryptionPasswordsResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this encryption passwords result based on the context it is used -func (m *EncryptionPasswordsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EncryptionPasswordsResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *EncryptionPasswordsResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EncryptionPasswordsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EncryptionPasswordsResult) UnmarshalBinary(b []byte) error { - var res EncryptionPasswordsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/error.go b/models/error.go deleted file mode 100644 index eee87fc..0000000 --- a/models/error.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Error error -// -// swagger:model Error -type Error struct { - - // The error code is a string that uniquely identifies an error condition and should be understood by programs that detect and handle errors by type - // Required: true - // Enum: [AccessDenied ExpiredToken InvalidToken InvalidURI MethodNotAllowed NotFound NotImplemented ServiceUnavailable UnexpectedContent UnknownError] - ErrorCode *string `json:"errorCode"` - - // The error message contains a generic description of the error condition in English. It is intended for a human audience - // Required: true - Message *string `json:"message"` - - // ID of the object that is involved in the error (or empty) - ResourceID string `json:"resourceId,omitempty"` -} - -// Validate validates this error -func (m *Error) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateErrorCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMessage(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var errorTypeErrorCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AccessDenied","ExpiredToken","InvalidToken","InvalidURI","MethodNotAllowed","NotFound","NotImplemented","ServiceUnavailable","UnexpectedContent","UnknownError"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - errorTypeErrorCodePropEnum = append(errorTypeErrorCodePropEnum, v) - } -} - -const ( - - // ErrorErrorCodeAccessDenied captures enum value "AccessDenied" - ErrorErrorCodeAccessDenied string = "AccessDenied" - - // ErrorErrorCodeExpiredToken captures enum value "ExpiredToken" - ErrorErrorCodeExpiredToken string = "ExpiredToken" - - // ErrorErrorCodeInvalidToken captures enum value "InvalidToken" - ErrorErrorCodeInvalidToken string = "InvalidToken" - - // ErrorErrorCodeInvalidURI captures enum value "InvalidURI" - ErrorErrorCodeInvalidURI string = "InvalidURI" - - // ErrorErrorCodeMethodNotAllowed captures enum value "MethodNotAllowed" - ErrorErrorCodeMethodNotAllowed string = "MethodNotAllowed" - - // ErrorErrorCodeNotFound captures enum value "NotFound" - ErrorErrorCodeNotFound string = "NotFound" - - // ErrorErrorCodeNotImplemented captures enum value "NotImplemented" - ErrorErrorCodeNotImplemented string = "NotImplemented" - - // ErrorErrorCodeServiceUnavailable captures enum value "ServiceUnavailable" - ErrorErrorCodeServiceUnavailable string = "ServiceUnavailable" - - // ErrorErrorCodeUnexpectedContent captures enum value "UnexpectedContent" - ErrorErrorCodeUnexpectedContent string = "UnexpectedContent" - - // ErrorErrorCodeUnknownError captures enum value "UnknownError" - ErrorErrorCodeUnknownError string = "UnknownError" -) - -// prop value enum -func (m *Error) validateErrorCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, errorTypeErrorCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Error) validateErrorCode(formats strfmt.Registry) error { - - if err := validate.Required("errorCode", "body", m.ErrorCode); err != nil { - return err - } - - // value enum - if err := m.validateErrorCodeEnum("errorCode", "body", *m.ErrorCode); err != nil { - return err - } - - return nil -} - -func (m *Error) validateMessage(formats strfmt.Registry) error { - - if err := validate.Required("message", "body", m.Message); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this error based on context it is used -func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Error) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Error) UnmarshalBinary(b []byte) error { - var res Error - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/ev_centers_inventory_filters_order_column.go b/models/ev_centers_inventory_filters_order_column.go deleted file mode 100644 index f04d251..0000000 --- a/models/ev_centers_inventory_filters_order_column.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EvCentersInventoryFiltersOrderColumn Sorts vCenter Servers by one of the job parameters. -// -// swagger:model EvCentersInventoryFiltersOrderColumn -type EvCentersInventoryFiltersOrderColumn string - -func NewEvCentersInventoryFiltersOrderColumn(value EvCentersInventoryFiltersOrderColumn) *EvCentersInventoryFiltersOrderColumn { - v := value - return &v -} - -const ( - - // EvCentersInventoryFiltersOrderColumnName captures enum value "Name" - EvCentersInventoryFiltersOrderColumnName EvCentersInventoryFiltersOrderColumn = "Name" - - // EvCentersInventoryFiltersOrderColumnObjectID captures enum value "ObjectId" - EvCentersInventoryFiltersOrderColumnObjectID EvCentersInventoryFiltersOrderColumn = "ObjectId" - - // EvCentersInventoryFiltersOrderColumnType captures enum value "Type" - EvCentersInventoryFiltersOrderColumnType EvCentersInventoryFiltersOrderColumn = "Type" -) - -// for schema -var evCentersInventoryFiltersOrderColumnEnum []interface{} - -func init() { - var res []EvCentersInventoryFiltersOrderColumn - if err := json.Unmarshal([]byte(`["Name","ObjectId","Type"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - evCentersInventoryFiltersOrderColumnEnum = append(evCentersInventoryFiltersOrderColumnEnum, v) - } -} - -func (m EvCentersInventoryFiltersOrderColumn) validateEvCentersInventoryFiltersOrderColumnEnum(path, location string, value EvCentersInventoryFiltersOrderColumn) error { - if err := validate.EnumCase(path, location, value, evCentersInventoryFiltersOrderColumnEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this ev centers inventory filters order column -func (m EvCentersInventoryFiltersOrderColumn) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEvCentersInventoryFiltersOrderColumnEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this ev centers inventory filters order column based on context it is used -func (m EvCentersInventoryFiltersOrderColumn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/models/full_backup_maintenance_defragment_and_compact_model.go b/models/full_backup_maintenance_defragment_and_compact_model.go deleted file mode 100644 index 72f5b54..0000000 --- a/models/full_backup_maintenance_defragment_and_compact_model.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FullBackupMaintenanceDefragmentAndCompactModel Compact operation settings. -// -// swagger:model FullBackupMaintenanceDefragmentAndCompactModel -type FullBackupMaintenanceDefragmentAndCompactModel struct { - - // If *true*, Veeam Backup & Replication compacts full backup files. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // monthly - Monthly *AdvancedStorageScheduleMonthlyModel `json:"monthly,omitempty"` - - // weekly - Weekly *AdvancedStorageScheduleWeeklyModel `json:"weekly,omitempty"` -} - -// Validate validates this full backup maintenance defragment and compact model -func (m *FullBackupMaintenanceDefragmentAndCompactModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMonthly(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeekly(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FullBackupMaintenanceDefragmentAndCompactModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *FullBackupMaintenanceDefragmentAndCompactModel) validateMonthly(formats strfmt.Registry) error { - if swag.IsZero(m.Monthly) { // not required - return nil - } - - if m.Monthly != nil { - if err := m.Monthly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *FullBackupMaintenanceDefragmentAndCompactModel) validateWeekly(formats strfmt.Registry) error { - if swag.IsZero(m.Weekly) { // not required - return nil - } - - if m.Weekly != nil { - if err := m.Weekly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weekly") - } - return err - } - } - - return nil -} - -// ContextValidate validate this full backup maintenance defragment and compact model based on the context it is used -func (m *FullBackupMaintenanceDefragmentAndCompactModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMonthly(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeekly(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FullBackupMaintenanceDefragmentAndCompactModel) contextValidateMonthly(ctx context.Context, formats strfmt.Registry) error { - - if m.Monthly != nil { - if err := m.Monthly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *FullBackupMaintenanceDefragmentAndCompactModel) contextValidateWeekly(ctx context.Context, formats strfmt.Registry) error { - - if m.Weekly != nil { - if err := m.Weekly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weekly") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *FullBackupMaintenanceDefragmentAndCompactModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FullBackupMaintenanceDefragmentAndCompactModel) UnmarshalBinary(b []byte) error { - var res FullBackupMaintenanceDefragmentAndCompactModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/full_backup_maintenance_model.go b/models/full_backup_maintenance_model.go deleted file mode 100644 index c7f103d..0000000 --- a/models/full_backup_maintenance_model.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// FullBackupMaintenanceModel Maintenance settings for full backup files. -// -// swagger:model FullBackupMaintenanceModel -type FullBackupMaintenanceModel struct { - - // remove data - RemoveData *FullBackupMaintenanceRemoveDataModel `json:"RemoveData,omitempty"` - - // defragment and compact - DefragmentAndCompact *FullBackupMaintenanceDefragmentAndCompactModel `json:"defragmentAndCompact,omitempty"` -} - -// Validate validates this full backup maintenance model -func (m *FullBackupMaintenanceModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRemoveData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefragmentAndCompact(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FullBackupMaintenanceModel) validateRemoveData(formats strfmt.Registry) error { - if swag.IsZero(m.RemoveData) { // not required - return nil - } - - if m.RemoveData != nil { - if err := m.RemoveData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("RemoveData") - } - return err - } - } - - return nil -} - -func (m *FullBackupMaintenanceModel) validateDefragmentAndCompact(formats strfmt.Registry) error { - if swag.IsZero(m.DefragmentAndCompact) { // not required - return nil - } - - if m.DefragmentAndCompact != nil { - if err := m.DefragmentAndCompact.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defragmentAndCompact") - } - return err - } - } - - return nil -} - -// ContextValidate validate this full backup maintenance model based on the context it is used -func (m *FullBackupMaintenanceModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRemoveData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefragmentAndCompact(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FullBackupMaintenanceModel) contextValidateRemoveData(ctx context.Context, formats strfmt.Registry) error { - - if m.RemoveData != nil { - if err := m.RemoveData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("RemoveData") - } - return err - } - } - - return nil -} - -func (m *FullBackupMaintenanceModel) contextValidateDefragmentAndCompact(ctx context.Context, formats strfmt.Registry) error { - - if m.DefragmentAndCompact != nil { - if err := m.DefragmentAndCompact.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defragmentAndCompact") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *FullBackupMaintenanceModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FullBackupMaintenanceModel) UnmarshalBinary(b []byte) error { - var res FullBackupMaintenanceModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/full_backup_maintenance_remove_data_model.go b/models/full_backup_maintenance_remove_data_model.go deleted file mode 100644 index ff1b651..0000000 --- a/models/full_backup_maintenance_remove_data_model.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FullBackupMaintenanceRemoveDataModel Backup data setting for deleted VMs. -// -// swagger:model FullBackupMaintenanceRemoveDataModel -type FullBackupMaintenanceRemoveDataModel struct { - - // Number of days. - AfterDays int64 `json:"afterDays,omitempty"` - - // If *true*, Veeam Backup & Replication keeps the backup data of deleted VMs for the `afterDays` number of days. - // Required: true - IsEnabled *bool `json:"isEnabled"` -} - -// Validate validates this full backup maintenance remove data model -func (m *FullBackupMaintenanceRemoveDataModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FullBackupMaintenanceRemoveDataModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this full backup maintenance remove data model based on context it is used -func (m *FullBackupMaintenanceRemoveDataModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *FullBackupMaintenanceRemoveDataModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FullBackupMaintenanceRemoveDataModel) UnmarshalBinary(b []byte) error { - var res FullBackupMaintenanceRemoveDataModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/g_f_s_policy_settings_model.go b/models/g_f_s_policy_settings_model.go deleted file mode 100644 index 48f41a5..0000000 --- a/models/g_f_s_policy_settings_model.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GFSPolicySettingsModel GFS retention policy settings. -// -// swagger:model GFSPolicySettingsModel -type GFSPolicySettingsModel struct { - - // If *true*, the long-term (GFS) retention policy is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // monthly - Monthly *GFSPolicySettingsMonthlyModel `json:"monthly,omitempty"` - - // weekly - Weekly *GFSPolicySettingsWeeklyModel `json:"weekly,omitempty"` - - // yearly - Yearly *GFSPolicySettingsYearlyModel `json:"yearly,omitempty"` -} - -// Validate validates this g f s policy settings model -func (m *GFSPolicySettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMonthly(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeekly(formats); err != nil { - res = append(res, err) - } - - if err := m.validateYearly(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GFSPolicySettingsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *GFSPolicySettingsModel) validateMonthly(formats strfmt.Registry) error { - if swag.IsZero(m.Monthly) { // not required - return nil - } - - if m.Monthly != nil { - if err := m.Monthly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *GFSPolicySettingsModel) validateWeekly(formats strfmt.Registry) error { - if swag.IsZero(m.Weekly) { // not required - return nil - } - - if m.Weekly != nil { - if err := m.Weekly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weekly") - } - return err - } - } - - return nil -} - -func (m *GFSPolicySettingsModel) validateYearly(formats strfmt.Registry) error { - if swag.IsZero(m.Yearly) { // not required - return nil - } - - if m.Yearly != nil { - if err := m.Yearly.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("yearly") - } - return err - } - } - - return nil -} - -// ContextValidate validate this g f s policy settings model based on the context it is used -func (m *GFSPolicySettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMonthly(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeekly(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateYearly(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GFSPolicySettingsModel) contextValidateMonthly(ctx context.Context, formats strfmt.Registry) error { - - if m.Monthly != nil { - if err := m.Monthly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("monthly") - } - return err - } - } - - return nil -} - -func (m *GFSPolicySettingsModel) contextValidateWeekly(ctx context.Context, formats strfmt.Registry) error { - - if m.Weekly != nil { - if err := m.Weekly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weekly") - } - return err - } - } - - return nil -} - -func (m *GFSPolicySettingsModel) contextValidateYearly(ctx context.Context, formats strfmt.Registry) error { - - if m.Yearly != nil { - if err := m.Yearly.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("yearly") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GFSPolicySettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GFSPolicySettingsModel) UnmarshalBinary(b []byte) error { - var res GFSPolicySettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/g_f_s_policy_settings_monthly_model.go b/models/g_f_s_policy_settings_monthly_model.go deleted file mode 100644 index ccc4a63..0000000 --- a/models/g_f_s_policy_settings_monthly_model.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GFSPolicySettingsMonthlyModel Monthly GFS retention policy. -// -// swagger:model GFSPolicySettingsMonthlyModel -type GFSPolicySettingsMonthlyModel struct { - - // Week of the month when the full backup that will be kept for archival purposes is created (the first week is the first 7 days of the month). - DesiredTime ESennightOfMonth `json:"desiredTime,omitempty"` - - // If *true*, the monthly GFS retention policy is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // Number of months to keep full backups for archival purposes. - KeepForNumberOfMonths int64 `json:"keepForNumberOfMonths,omitempty"` -} - -// Validate validates this g f s policy settings monthly model -func (m *GFSPolicySettingsMonthlyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDesiredTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GFSPolicySettingsMonthlyModel) validateDesiredTime(formats strfmt.Registry) error { - if swag.IsZero(m.DesiredTime) { // not required - return nil - } - - if err := m.DesiredTime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("desiredTime") - } - return err - } - - return nil -} - -func (m *GFSPolicySettingsMonthlyModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this g f s policy settings monthly model based on the context it is used -func (m *GFSPolicySettingsMonthlyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDesiredTime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GFSPolicySettingsMonthlyModel) contextValidateDesiredTime(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DesiredTime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("desiredTime") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GFSPolicySettingsMonthlyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GFSPolicySettingsMonthlyModel) UnmarshalBinary(b []byte) error { - var res GFSPolicySettingsMonthlyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/g_f_s_policy_settings_weekly_model.go b/models/g_f_s_policy_settings_weekly_model.go deleted file mode 100644 index 9fa2682..0000000 --- a/models/g_f_s_policy_settings_weekly_model.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GFSPolicySettingsWeeklyModel Weekly GFS retention policy. -// -// swagger:model GFSPolicySettingsWeeklyModel -type GFSPolicySettingsWeeklyModel struct { - - // Day of the week when the full backup that will be kept for archival purposes is created. - DesiredTime EDayOfWeek `json:"desiredTime,omitempty"` - - // If *true*, the weekly GFS retention policy is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // Number of weeks to keep full backups for archival purposes. - KeepForNumberOfWeeks int64 `json:"keepForNumberOfWeeks,omitempty"` -} - -// Validate validates this g f s policy settings weekly model -func (m *GFSPolicySettingsWeeklyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDesiredTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GFSPolicySettingsWeeklyModel) validateDesiredTime(formats strfmt.Registry) error { - if swag.IsZero(m.DesiredTime) { // not required - return nil - } - - if err := m.DesiredTime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("desiredTime") - } - return err - } - - return nil -} - -func (m *GFSPolicySettingsWeeklyModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this g f s policy settings weekly model based on the context it is used -func (m *GFSPolicySettingsWeeklyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDesiredTime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GFSPolicySettingsWeeklyModel) contextValidateDesiredTime(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DesiredTime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("desiredTime") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GFSPolicySettingsWeeklyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GFSPolicySettingsWeeklyModel) UnmarshalBinary(b []byte) error { - var res GFSPolicySettingsWeeklyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/g_f_s_policy_settings_yearly_model.go b/models/g_f_s_policy_settings_yearly_model.go deleted file mode 100644 index f347918..0000000 --- a/models/g_f_s_policy_settings_yearly_model.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GFSPolicySettingsYearlyModel Yearly GFS retention policy. -// -// swagger:model GFSPolicySettingsYearlyModel -type GFSPolicySettingsYearlyModel struct { - - // Month when the full backup that will be kept for archival purposes is created. - DesiredTime EMonth `json:"desiredTime,omitempty"` - - // If *true*, the yearly GFS retention policy is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // Number of years to keep full backups for archival purposes. - KeepForNumberOfYears int64 `json:"keepForNumberOfYears,omitempty"` -} - -// Validate validates this g f s policy settings yearly model -func (m *GFSPolicySettingsYearlyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDesiredTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GFSPolicySettingsYearlyModel) validateDesiredTime(formats strfmt.Registry) error { - if swag.IsZero(m.DesiredTime) { // not required - return nil - } - - if err := m.DesiredTime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("desiredTime") - } - return err - } - - return nil -} - -func (m *GFSPolicySettingsYearlyModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this g f s policy settings yearly model based on the context it is used -func (m *GFSPolicySettingsYearlyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDesiredTime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GFSPolicySettingsYearlyModel) contextValidateDesiredTime(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DesiredTime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("desiredTime") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GFSPolicySettingsYearlyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GFSPolicySettingsYearlyModel) UnmarshalBinary(b []byte) error { - var res GFSPolicySettingsYearlyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/general_options_email_notifications_model.go b/models/general_options_email_notifications_model.go deleted file mode 100644 index 4d66315..0000000 --- a/models/general_options_email_notifications_model.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GeneralOptionsEmailNotificationsModel Global email notification settings. -// -// swagger:model GeneralOptionsEmailNotificationsModel -type GeneralOptionsEmailNotificationsModel struct { - - // advanced Smtp options - // Required: true - AdvancedSMTPOptions *AdvancedSMTPOptionsModel `json:"advancedSmtpOptions"` - - // Email address from which email notifications must be sent. - // Required: true - From *string `json:"from"` - - // If *true*, global email notification settings are enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // If *true*, email notifications are sent when the job fails. - // Required: true - NotifyOnFailure *bool `json:"notifyOnFailure"` - - // If *true*, email notifications are sent about the final job status only (not per every job retry). - // Required: true - NotifyOnLastRetry *bool `json:"notifyOnLastRetry"` - - // If *true*, email notifications are sent when the job completes successfully. - // Required: true - NotifyOnSuccess *bool `json:"notifyOnSuccess"` - - // If *true*, email notifications are sent when the job completes with a warning. - // Required: true - NotifyOnWarning *bool `json:"notifyOnWarning"` - - // Time when Veeam Backup & Replication sends daily email reports. - // Required: true - // Format: date-time - SendDailyReportsAt *strfmt.DateTime `json:"sendDailyReportsAt"` - - // Full DNS name or IP address of the SMTP server. - // Required: true - SMTPServerName *string `json:"smtpServerName"` - - // Notification subject. Use the following variables in the subject:
    - //
  1. %Time% — completion time
  2. - //
  3. %JobName%
  4. - //
  5. %JobResult%
  6. - //
  7. %ObjectCount% — number of VMs in the job
  8. - //
  9. %Issues% — number of VMs in the job that have been processed with the Warning or Failed status
  10. - //
- // - // Required: true - Subject *string `json:"subject"` - - // Recipient email addresses. Use a semicolon to separate multiple addresses. - // Required: true - To *string `json:"to"` -} - -// Validate validates this general options email notifications model -func (m *GeneralOptionsEmailNotificationsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdvancedSMTPOptions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFrom(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnFailure(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnLastRetry(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnSuccess(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnWarning(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSendDailyReportsAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSMTPServerName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTo(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateAdvancedSMTPOptions(formats strfmt.Registry) error { - - if err := validate.Required("advancedSmtpOptions", "body", m.AdvancedSMTPOptions); err != nil { - return err - } - - if m.AdvancedSMTPOptions != nil { - if err := m.AdvancedSMTPOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSmtpOptions") - } - return err - } - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateFrom(formats strfmt.Registry) error { - - if err := validate.Required("from", "body", m.From); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateNotifyOnFailure(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnFailure", "body", m.NotifyOnFailure); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateNotifyOnLastRetry(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnLastRetry", "body", m.NotifyOnLastRetry); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateNotifyOnSuccess(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnSuccess", "body", m.NotifyOnSuccess); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateNotifyOnWarning(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnWarning", "body", m.NotifyOnWarning); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateSendDailyReportsAt(formats strfmt.Registry) error { - - if err := validate.Required("sendDailyReportsAt", "body", m.SendDailyReportsAt); err != nil { - return err - } - - if err := validate.FormatOf("sendDailyReportsAt", "body", "date-time", m.SendDailyReportsAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateSMTPServerName(formats strfmt.Registry) error { - - if err := validate.Required("smtpServerName", "body", m.SMTPServerName); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateSubject(formats strfmt.Registry) error { - - if err := validate.Required("subject", "body", m.Subject); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) validateTo(formats strfmt.Registry) error { - - if err := validate.Required("to", "body", m.To); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this general options email notifications model based on the context it is used -func (m *GeneralOptionsEmailNotificationsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvancedSMTPOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GeneralOptionsEmailNotificationsModel) contextValidateAdvancedSMTPOptions(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvancedSMTPOptions != nil { - if err := m.AdvancedSMTPOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSmtpOptions") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GeneralOptionsEmailNotificationsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GeneralOptionsEmailNotificationsModel) UnmarshalBinary(b []byte) error { - var res GeneralOptionsEmailNotificationsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/general_options_model.go b/models/general_options_model.go deleted file mode 100644 index 862de81..0000000 --- a/models/general_options_model.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GeneralOptionsModel general options model -// -// swagger:model GeneralOptionsModel -type GeneralOptionsModel struct { - - // email settings - EmailSettings *GeneralOptionsEmailNotificationsModel `json:"emailSettings,omitempty"` - - // notifications - Notifications *GeneralOptionsNotificationsModel `json:"notifications,omitempty"` -} - -// Validate validates this general options model -func (m *GeneralOptionsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEmailSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifications(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GeneralOptionsModel) validateEmailSettings(formats strfmt.Registry) error { - if swag.IsZero(m.EmailSettings) { // not required - return nil - } - - if m.EmailSettings != nil { - if err := m.EmailSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("emailSettings") - } - return err - } - } - - return nil -} - -func (m *GeneralOptionsModel) validateNotifications(formats strfmt.Registry) error { - if swag.IsZero(m.Notifications) { // not required - return nil - } - - if m.Notifications != nil { - if err := m.Notifications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("notifications") - } - return err - } - } - - return nil -} - -// ContextValidate validate this general options model based on the context it is used -func (m *GeneralOptionsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEmailSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNotifications(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GeneralOptionsModel) contextValidateEmailSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.EmailSettings != nil { - if err := m.EmailSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("emailSettings") - } - return err - } - } - - return nil -} - -func (m *GeneralOptionsModel) contextValidateNotifications(ctx context.Context, formats strfmt.Registry) error { - - if m.Notifications != nil { - if err := m.Notifications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("notifications") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GeneralOptionsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GeneralOptionsModel) UnmarshalBinary(b []byte) error { - var res GeneralOptionsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/general_options_notifications_model.go b/models/general_options_notifications_model.go deleted file mode 100644 index 2825461..0000000 --- a/models/general_options_notifications_model.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GeneralOptionsNotificationsModel general options notifications model -// -// swagger:model GeneralOptionsNotificationsModel -type GeneralOptionsNotificationsModel struct { - - // Space threshold of production datastore, in percent. - // Required: true - DatastoreSpaceThreshold *int32 `json:"datastoreSpaceThreshold"` - - // If *true*, notifications about critical amount of free space in production datastore are enabled. - // Required: true - DatastoreSpaceThresholdEnabled *bool `json:"datastoreSpaceThresholdEnabled"` - - // If *true*, notifications about support contract expiration are enabled. - // Required: true - NotifyOnSupportExpiration *bool `json:"notifyOnSupportExpiration"` - - // If *true*, notifications about updates are enabled. - // Required: true - NotifyOnUpdates *bool `json:"notifyOnUpdates"` - - // Space threshold of production datastore, in percent. - // Required: true - SkipVMSpaceThreshold *int32 `json:"skipVMSpaceThreshold"` - - // If *true* and the `skipVMSpaceThreshold` threshold is reached, Veeam Backup & Replication terminates backup and replication jobs working with production datastores before VM snapshots are taken. - // Required: true - SkipVMSpaceThresholdEnabled *bool `json:"skipVMSpaceThresholdEnabled"` - - // Space threshold of backup storage, in percent. - // Required: true - StorageSpaceThreshold *int32 `json:"storageSpaceThreshold"` - - // If *true*, notifications about critical amount of free space in backup storage are enabled. - // Required: true - StorageSpaceThresholdEnabled *bool `json:"storageSpaceThresholdEnabled"` -} - -// Validate validates this general options notifications model -func (m *GeneralOptionsNotificationsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDatastoreSpaceThreshold(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDatastoreSpaceThresholdEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnSupportExpiration(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotifyOnUpdates(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSkipVMSpaceThreshold(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSkipVMSpaceThresholdEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageSpaceThreshold(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageSpaceThresholdEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GeneralOptionsNotificationsModel) validateDatastoreSpaceThreshold(formats strfmt.Registry) error { - - if err := validate.Required("datastoreSpaceThreshold", "body", m.DatastoreSpaceThreshold); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsNotificationsModel) validateDatastoreSpaceThresholdEnabled(formats strfmt.Registry) error { - - if err := validate.Required("datastoreSpaceThresholdEnabled", "body", m.DatastoreSpaceThresholdEnabled); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsNotificationsModel) validateNotifyOnSupportExpiration(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnSupportExpiration", "body", m.NotifyOnSupportExpiration); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsNotificationsModel) validateNotifyOnUpdates(formats strfmt.Registry) error { - - if err := validate.Required("notifyOnUpdates", "body", m.NotifyOnUpdates); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsNotificationsModel) validateSkipVMSpaceThreshold(formats strfmt.Registry) error { - - if err := validate.Required("skipVMSpaceThreshold", "body", m.SkipVMSpaceThreshold); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsNotificationsModel) validateSkipVMSpaceThresholdEnabled(formats strfmt.Registry) error { - - if err := validate.Required("skipVMSpaceThresholdEnabled", "body", m.SkipVMSpaceThresholdEnabled); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsNotificationsModel) validateStorageSpaceThreshold(formats strfmt.Registry) error { - - if err := validate.Required("storageSpaceThreshold", "body", m.StorageSpaceThreshold); err != nil { - return err - } - - return nil -} - -func (m *GeneralOptionsNotificationsModel) validateStorageSpaceThresholdEnabled(formats strfmt.Registry) error { - - if err := validate.Required("storageSpaceThresholdEnabled", "body", m.StorageSpaceThresholdEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this general options notifications model based on context it is used -func (m *GeneralOptionsNotificationsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *GeneralOptionsNotificationsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GeneralOptionsNotificationsModel) UnmarshalBinary(b []byte) error { - var res GeneralOptionsNotificationsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/global_network_traffic_rules_model.go b/models/global_network_traffic_rules_model.go deleted file mode 100644 index 5d63a42..0000000 --- a/models/global_network_traffic_rules_model.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GlobalNetworkTrafficRulesModel global network traffic rules model -// -// swagger:model GlobalNetworkTrafficRulesModel -type GlobalNetworkTrafficRulesModel struct { - - // preferred networks - PreferredNetworks *PreferredNetworksModel `json:"preferredNetworks,omitempty"` - - // Array of traffic rules. - TrafficRules []*TrafficRuleModel `json:"trafficRules"` - - // Number of TCP/IP connections per job. - UploadStreamsCount int64 `json:"uploadStreamsCount,omitempty"` - - // If *true*, Veeam Backup & Replication uses multiple TCP/IP transfer connection for every job session. - // Required: true - UseMultipleStreamsPerJob *bool `json:"useMultipleStreamsPerJob"` -} - -// Validate validates this global network traffic rules model -func (m *GlobalNetworkTrafficRulesModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePreferredNetworks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTrafficRules(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUseMultipleStreamsPerJob(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GlobalNetworkTrafficRulesModel) validatePreferredNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.PreferredNetworks) { // not required - return nil - } - - if m.PreferredNetworks != nil { - if err := m.PreferredNetworks.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("preferredNetworks") - } - return err - } - } - - return nil -} - -func (m *GlobalNetworkTrafficRulesModel) validateTrafficRules(formats strfmt.Registry) error { - if swag.IsZero(m.TrafficRules) { // not required - return nil - } - - for i := 0; i < len(m.TrafficRules); i++ { - if swag.IsZero(m.TrafficRules[i]) { // not required - continue - } - - if m.TrafficRules[i] != nil { - if err := m.TrafficRules[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("trafficRules" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *GlobalNetworkTrafficRulesModel) validateUseMultipleStreamsPerJob(formats strfmt.Registry) error { - - if err := validate.Required("useMultipleStreamsPerJob", "body", m.UseMultipleStreamsPerJob); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this global network traffic rules model based on the context it is used -func (m *GlobalNetworkTrafficRulesModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePreferredNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTrafficRules(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GlobalNetworkTrafficRulesModel) contextValidatePreferredNetworks(ctx context.Context, formats strfmt.Registry) error { - - if m.PreferredNetworks != nil { - if err := m.PreferredNetworks.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("preferredNetworks") - } - return err - } - } - - return nil -} - -func (m *GlobalNetworkTrafficRulesModel) contextValidateTrafficRules(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TrafficRules); i++ { - - if m.TrafficRules[i] != nil { - if err := m.TrafficRules[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("trafficRules" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GlobalNetworkTrafficRulesModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GlobalNetworkTrafficRulesModel) UnmarshalBinary(b []byte) error { - var res GlobalNetworkTrafficRulesModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/guest_file_system_indexing_model.go b/models/guest_file_system_indexing_model.go deleted file mode 100644 index 3b2f4ab..0000000 --- a/models/guest_file_system_indexing_model.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GuestFileSystemIndexingModel VM guest OS file indexing. -// -// swagger:model GuestFileSystemIndexingModel -type GuestFileSystemIndexingModel struct { - - // Array of VMs with guest OS file indexing options. - IndexingSettings []*BackupIndexingSettingsModel `json:"indexingSettings"` - - // is enabled - // Required: true - IsEnabled *bool `json:"isEnabled"` -} - -// Validate validates this guest file system indexing model -func (m *GuestFileSystemIndexingModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIndexingSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestFileSystemIndexingModel) validateIndexingSettings(formats strfmt.Registry) error { - if swag.IsZero(m.IndexingSettings) { // not required - return nil - } - - for i := 0; i < len(m.IndexingSettings); i++ { - if swag.IsZero(m.IndexingSettings[i]) { // not required - continue - } - - if m.IndexingSettings[i] != nil { - if err := m.IndexingSettings[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("indexingSettings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *GuestFileSystemIndexingModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this guest file system indexing model based on the context it is used -func (m *GuestFileSystemIndexingModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIndexingSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestFileSystemIndexingModel) contextValidateIndexingSettings(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.IndexingSettings); i++ { - - if m.IndexingSettings[i] != nil { - if err := m.IndexingSettings[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("indexingSettings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GuestFileSystemIndexingModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GuestFileSystemIndexingModel) UnmarshalBinary(b []byte) error { - var res GuestFileSystemIndexingModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/guest_interaction_proxies_settings_import_model.go b/models/guest_interaction_proxies_settings_import_model.go deleted file mode 100644 index aab68f1..0000000 --- a/models/guest_interaction_proxies_settings_import_model.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GuestInteractionProxiesSettingsImportModel Guest interaction proxy used to deploy the runtime process on the VM guest OS. -// -// swagger:model GuestInteractionProxiesSettingsImportModel -type GuestInteractionProxiesSettingsImportModel struct { - - // If *true*, Veeam Backup & Replication automatically selects the guest interaction proxy. - // Required: true - AutomaticSelection bool `json:"automaticSelection"` - - // Array of proxies specified explicitly. The array must contain Microsoft Windows servers added to the backup infrastructure only. - // Unique: true - Proxies []string `json:"proxies"` -} - -// Validate validates this guest interaction proxies settings import model -func (m *GuestInteractionProxiesSettingsImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAutomaticSelection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProxies(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestInteractionProxiesSettingsImportModel) validateAutomaticSelection(formats strfmt.Registry) error { - - if err := validate.Required("automaticSelection", "body", bool(m.AutomaticSelection)); err != nil { - return err - } - - return nil -} - -func (m *GuestInteractionProxiesSettingsImportModel) validateProxies(formats strfmt.Registry) error { - if swag.IsZero(m.Proxies) { // not required - return nil - } - - if err := validate.UniqueItems("proxies", "body", m.Proxies); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this guest interaction proxies settings import model based on context it is used -func (m *GuestInteractionProxiesSettingsImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *GuestInteractionProxiesSettingsImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GuestInteractionProxiesSettingsImportModel) UnmarshalBinary(b []byte) error { - var res GuestInteractionProxiesSettingsImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/guest_interaction_proxies_settings_model.go b/models/guest_interaction_proxies_settings_model.go deleted file mode 100644 index 8760855..0000000 --- a/models/guest_interaction_proxies_settings_model.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GuestInteractionProxiesSettingsModel Guest interaction proxy used to deploy the runtime process on the VM guest OS. -// -// swagger:model GuestInteractionProxiesSettingsModel -type GuestInteractionProxiesSettingsModel struct { - - // If *true*, Veeam Backup & Replication automatically selects the guest interaction proxy. - // Required: true - AutoSelection bool `json:"autoSelection"` - - // Array of proxies specified explicitly. The array must contain Microsoft Windows servers added to the backup infrastructure only. - // Unique: true - ProxyIds []strfmt.UUID `json:"proxyIds"` -} - -// Validate validates this guest interaction proxies settings model -func (m *GuestInteractionProxiesSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAutoSelection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProxyIds(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestInteractionProxiesSettingsModel) validateAutoSelection(formats strfmt.Registry) error { - - if err := validate.Required("autoSelection", "body", bool(m.AutoSelection)); err != nil { - return err - } - - return nil -} - -func (m *GuestInteractionProxiesSettingsModel) validateProxyIds(formats strfmt.Registry) error { - if swag.IsZero(m.ProxyIds) { // not required - return nil - } - - if err := validate.UniqueItems("proxyIds", "body", m.ProxyIds); err != nil { - return err - } - - for i := 0; i < len(m.ProxyIds); i++ { - - if err := validate.FormatOf("proxyIds"+"."+strconv.Itoa(i), "body", "uuid", m.ProxyIds[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -// ContextValidate validates this guest interaction proxies settings model based on context it is used -func (m *GuestInteractionProxiesSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *GuestInteractionProxiesSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GuestInteractionProxiesSettingsModel) UnmarshalBinary(b []byte) error { - var res GuestInteractionProxiesSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/guest_os_credentials_import_model.go b/models/guest_os_credentials_import_model.go deleted file mode 100644 index e852215..0000000 --- a/models/guest_os_credentials_import_model.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GuestOsCredentialsImportModel VM custom credentials. -// -// swagger:model GuestOsCredentialsImportModel -type GuestOsCredentialsImportModel struct { - - // Individual credentials for VMs. - // Unique: true - CredentialsPerMachine []*GuestOsCredentialsPerMachineImportModel `json:"credentialsPerMachine"` - - // creds - Creds *CredentialsImportModel `json:"creds,omitempty"` -} - -// Validate validates this guest os credentials import model -func (m *GuestOsCredentialsImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentialsPerMachine(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreds(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestOsCredentialsImportModel) validateCredentialsPerMachine(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialsPerMachine) { // not required - return nil - } - - if err := validate.UniqueItems("credentialsPerMachine", "body", m.CredentialsPerMachine); err != nil { - return err - } - - for i := 0; i < len(m.CredentialsPerMachine); i++ { - if swag.IsZero(m.CredentialsPerMachine[i]) { // not required - continue - } - - if m.CredentialsPerMachine[i] != nil { - if err := m.CredentialsPerMachine[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentialsPerMachine" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *GuestOsCredentialsImportModel) validateCreds(formats strfmt.Registry) error { - if swag.IsZero(m.Creds) { // not required - return nil - } - - if m.Creds != nil { - if err := m.Creds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("creds") - } - return err - } - } - - return nil -} - -// ContextValidate validate this guest os credentials import model based on the context it is used -func (m *GuestOsCredentialsImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCredentialsPerMachine(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreds(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestOsCredentialsImportModel) contextValidateCredentialsPerMachine(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.CredentialsPerMachine); i++ { - - if m.CredentialsPerMachine[i] != nil { - if err := m.CredentialsPerMachine[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentialsPerMachine" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *GuestOsCredentialsImportModel) contextValidateCreds(ctx context.Context, formats strfmt.Registry) error { - - if m.Creds != nil { - if err := m.Creds.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("creds") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GuestOsCredentialsImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GuestOsCredentialsImportModel) UnmarshalBinary(b []byte) error { - var res GuestOsCredentialsImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/guest_os_credentials_model.go b/models/guest_os_credentials_model.go deleted file mode 100644 index bbbb66a..0000000 --- a/models/guest_os_credentials_model.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GuestOsCredentialsModel VM custom credentials. -// -// swagger:model GuestOsCredentialsModel -type GuestOsCredentialsModel struct { - - // Individual credentials for VMs. - // Unique: true - CredentialsPerMachine []*GuestOsCredentialsPerMachineModel `json:"credentialsPerMachine"` - - // Credentials ID for Microsoft Windows VMs. - // Required: true - // Format: uuid - CredsID *strfmt.UUID `json:"credsId"` - - // creds type - // Required: true - CredsType *ECredentialsType `json:"credsType"` -} - -// Validate validates this guest os credentials model -func (m *GuestOsCredentialsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentialsPerMachine(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredsType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestOsCredentialsModel) validateCredentialsPerMachine(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialsPerMachine) { // not required - return nil - } - - if err := validate.UniqueItems("credentialsPerMachine", "body", m.CredentialsPerMachine); err != nil { - return err - } - - for i := 0; i < len(m.CredentialsPerMachine); i++ { - if swag.IsZero(m.CredentialsPerMachine[i]) { // not required - continue - } - - if m.CredentialsPerMachine[i] != nil { - if err := m.CredentialsPerMachine[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentialsPerMachine" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *GuestOsCredentialsModel) validateCredsID(formats strfmt.Registry) error { - - if err := validate.Required("credsId", "body", m.CredsID); err != nil { - return err - } - - if err := validate.FormatOf("credsId", "body", "uuid", m.CredsID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *GuestOsCredentialsModel) validateCredsType(formats strfmt.Registry) error { - - if err := validate.Required("credsType", "body", m.CredsType); err != nil { - return err - } - - if err := validate.Required("credsType", "body", m.CredsType); err != nil { - return err - } - - if m.CredsType != nil { - if err := m.CredsType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credsType") - } - return err - } - } - - return nil -} - -// ContextValidate validate this guest os credentials model based on the context it is used -func (m *GuestOsCredentialsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCredentialsPerMachine(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCredsType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestOsCredentialsModel) contextValidateCredentialsPerMachine(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.CredentialsPerMachine); i++ { - - if m.CredentialsPerMachine[i] != nil { - if err := m.CredentialsPerMachine[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentialsPerMachine" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *GuestOsCredentialsModel) contextValidateCredsType(ctx context.Context, formats strfmt.Registry) error { - - if m.CredsType != nil { - if err := m.CredsType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credsType") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GuestOsCredentialsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GuestOsCredentialsModel) UnmarshalBinary(b []byte) error { - var res GuestOsCredentialsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/guest_os_credentials_per_machine_import_model.go b/models/guest_os_credentials_per_machine_import_model.go deleted file mode 100644 index dd2dc71..0000000 --- a/models/guest_os_credentials_per_machine_import_model.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GuestOsCredentialsPerMachineImportModel guest os credentials per machine import model -// -// swagger:model GuestOsCredentialsPerMachineImportModel -type GuestOsCredentialsPerMachineImportModel struct { - - // linux creds - LinuxCreds *CredentialsImportModel `json:"linuxCreds,omitempty"` - - // vm object - // Required: true - VMObject *VmwareObjectModel `json:"vmObject"` - - // windows creds - WindowsCreds *CredentialsImportModel `json:"windowsCreds,omitempty"` -} - -// Validate validates this guest os credentials per machine import model -func (m *GuestOsCredentialsPerMachineImportModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinuxCreds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVMObject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWindowsCreds(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestOsCredentialsPerMachineImportModel) validateLinuxCreds(formats strfmt.Registry) error { - if swag.IsZero(m.LinuxCreds) { // not required - return nil - } - - if m.LinuxCreds != nil { - if err := m.LinuxCreds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("linuxCreds") - } - return err - } - } - - return nil -} - -func (m *GuestOsCredentialsPerMachineImportModel) validateVMObject(formats strfmt.Registry) error { - - if err := validate.Required("vmObject", "body", m.VMObject); err != nil { - return err - } - - if m.VMObject != nil { - if err := m.VMObject.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -func (m *GuestOsCredentialsPerMachineImportModel) validateWindowsCreds(formats strfmt.Registry) error { - if swag.IsZero(m.WindowsCreds) { // not required - return nil - } - - if m.WindowsCreds != nil { - if err := m.WindowsCreds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("windowsCreds") - } - return err - } - } - - return nil -} - -// ContextValidate validate this guest os credentials per machine import model based on the context it is used -func (m *GuestOsCredentialsPerMachineImportModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinuxCreds(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVMObject(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWindowsCreds(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestOsCredentialsPerMachineImportModel) contextValidateLinuxCreds(ctx context.Context, formats strfmt.Registry) error { - - if m.LinuxCreds != nil { - if err := m.LinuxCreds.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("linuxCreds") - } - return err - } - } - - return nil -} - -func (m *GuestOsCredentialsPerMachineImportModel) contextValidateVMObject(ctx context.Context, formats strfmt.Registry) error { - - if m.VMObject != nil { - if err := m.VMObject.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -func (m *GuestOsCredentialsPerMachineImportModel) contextValidateWindowsCreds(ctx context.Context, formats strfmt.Registry) error { - - if m.WindowsCreds != nil { - if err := m.WindowsCreds.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("windowsCreds") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GuestOsCredentialsPerMachineImportModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GuestOsCredentialsPerMachineImportModel) UnmarshalBinary(b []byte) error { - var res GuestOsCredentialsPerMachineImportModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/guest_os_credentials_per_machine_model.go b/models/guest_os_credentials_per_machine_model.go deleted file mode 100644 index 7a4da8a..0000000 --- a/models/guest_os_credentials_per_machine_model.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GuestOsCredentialsPerMachineModel guest os credentials per machine model -// -// swagger:model GuestOsCredentialsPerMachineModel -type GuestOsCredentialsPerMachineModel struct { - - // Credentials ID for a Linux VM. - // Format: uuid - LinuxCredsID strfmt.UUID `json:"linuxCredsId,omitempty"` - - // vm object - // Required: true - VMObject *VmwareObjectModel `json:"vmObject"` - - // Credentials ID for a Microsoft Windows VM. - // Format: uuid - WindowsCredsID strfmt.UUID `json:"windowsCredsId,omitempty"` -} - -// Validate validates this guest os credentials per machine model -func (m *GuestOsCredentialsPerMachineModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinuxCredsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVMObject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWindowsCredsID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestOsCredentialsPerMachineModel) validateLinuxCredsID(formats strfmt.Registry) error { - if swag.IsZero(m.LinuxCredsID) { // not required - return nil - } - - if err := validate.FormatOf("linuxCredsId", "body", "uuid", m.LinuxCredsID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *GuestOsCredentialsPerMachineModel) validateVMObject(formats strfmt.Registry) error { - - if err := validate.Required("vmObject", "body", m.VMObject); err != nil { - return err - } - - if m.VMObject != nil { - if err := m.VMObject.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -func (m *GuestOsCredentialsPerMachineModel) validateWindowsCredsID(formats strfmt.Registry) error { - if swag.IsZero(m.WindowsCredsID) { // not required - return nil - } - - if err := validate.FormatOf("windowsCredsId", "body", "uuid", m.WindowsCredsID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this guest os credentials per machine model based on the context it is used -func (m *GuestOsCredentialsPerMachineModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVMObject(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GuestOsCredentialsPerMachineModel) contextValidateVMObject(ctx context.Context, formats strfmt.Registry) error { - - if m.VMObject != nil { - if err := m.VMObject.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GuestOsCredentialsPerMachineModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GuestOsCredentialsPerMachineModel) UnmarshalBinary(b []byte) error { - var res GuestOsCredentialsPerMachineModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/host_connection_spec.go b/models/host_connection_spec.go deleted file mode 100644 index d71f4b4..0000000 --- a/models/host_connection_spec.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HostConnectionSpec host connection spec -// -// swagger:model HostConnectionSpec -type HostConnectionSpec struct { - - // ID of a credentials record used to connect to the server. - // Required: true - // Format: uuid - CredentialsID *strfmt.UUID `json:"credentialsId"` - - // Port used to communicate with the server. - Port int64 `json:"port,omitempty"` - - // Full DNS name or IP address of the server. - // Required: true - ServerName *string `json:"serverName"` - - // type - // Required: true - Type *EManagedServerType `json:"type"` -} - -// Validate validates this host connection spec -func (m *HostConnectionSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentialsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServerName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostConnectionSpec) validateCredentialsID(formats strfmt.Registry) error { - - if err := validate.Required("credentialsId", "body", m.CredentialsID); err != nil { - return err - } - - if err := validate.FormatOf("credentialsId", "body", "uuid", m.CredentialsID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *HostConnectionSpec) validateServerName(formats strfmt.Registry) error { - - if err := validate.Required("serverName", "body", m.ServerName); err != nil { - return err - } - - return nil -} - -func (m *HostConnectionSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this host connection spec based on the context it is used -func (m *HostConnectionSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HostConnectionSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HostConnectionSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostConnectionSpec) UnmarshalBinary(b []byte) error { - var res HostConnectionSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_export_spec.go b/models/job_export_spec.go deleted file mode 100644 index b8fe7fc..0000000 --- a/models/job_export_spec.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobExportSpec job export spec -// -// swagger:model JobExportSpec -type JobExportSpec struct { - - // Array of job IDs. - // Unique: true - Ids []strfmt.UUID `json:"ids"` - - // Array of job names. Wildcard characters are supported. - // Unique: true - Names []string `json:"names"` - - // Array of job types. - // Unique: true - Types []string `json:"types"` -} - -// Validate validates this job export spec -func (m *JobExportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNames(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobExportSpec) validateIds(formats strfmt.Registry) error { - if swag.IsZero(m.Ids) { // not required - return nil - } - - if err := validate.UniqueItems("ids", "body", m.Ids); err != nil { - return err - } - - for i := 0; i < len(m.Ids); i++ { - - if err := validate.FormatOf("ids"+"."+strconv.Itoa(i), "body", "uuid", m.Ids[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -func (m *JobExportSpec) validateNames(formats strfmt.Registry) error { - if swag.IsZero(m.Names) { // not required - return nil - } - - if err := validate.UniqueItems("names", "body", m.Names); err != nil { - return err - } - - return nil -} - -func (m *JobExportSpec) validateTypes(formats strfmt.Registry) error { - if swag.IsZero(m.Types) { // not required - return nil - } - - if err := validate.UniqueItems("types", "body", m.Types); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this job export spec based on context it is used -func (m *JobExportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *JobExportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobExportSpec) UnmarshalBinary(b []byte) error { - var res JobExportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_import_spec.go b/models/job_import_spec.go deleted file mode 100644 index fcbba49..0000000 --- a/models/job_import_spec.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobImportSpec job import spec -// -// swagger:model JobImportSpec -type JobImportSpec struct { - - // Description of the job. - // Required: true - Description *string `json:"description"` - - // guest processing - // Required: true - GuestProcessing *BackupJobGuestProcessingImportModel `json:"guestProcessing"` - - // If *true*, the job has a high priority in getting backup infrastructure resources. - // Required: true - IsHighPriority *bool `json:"isHighPriority"` - - // Name of the job. - // Required: true - Name *string `json:"name"` - - // schedule - // Required: true - Schedule *BackupScheduleModel `json:"schedule"` - - // storage - // Required: true - Storage *BackupJobStorageImportModel `json:"storage"` - - // type - // Required: true - Type *EJobType `json:"type"` - - // virtual machines - // Required: true - VirtualMachines *BackupJobVirtualMachinesSpec `json:"virtualMachines"` -} - -// Validate validates this job import spec -func (m *JobImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGuestProcessing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsHighPriority(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSchedule(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVirtualMachines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *JobImportSpec) validateGuestProcessing(formats strfmt.Registry) error { - - if err := validate.Required("guestProcessing", "body", m.GuestProcessing); err != nil { - return err - } - - if m.GuestProcessing != nil { - if err := m.GuestProcessing.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestProcessing") - } - return err - } - } - - return nil -} - -func (m *JobImportSpec) validateIsHighPriority(formats strfmt.Registry) error { - - if err := validate.Required("isHighPriority", "body", m.IsHighPriority); err != nil { - return err - } - - return nil -} - -func (m *JobImportSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *JobImportSpec) validateSchedule(formats strfmt.Registry) error { - - if err := validate.Required("schedule", "body", m.Schedule); err != nil { - return err - } - - if m.Schedule != nil { - if err := m.Schedule.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schedule") - } - return err - } - } - - return nil -} - -func (m *JobImportSpec) validateStorage(formats strfmt.Registry) error { - - if err := validate.Required("storage", "body", m.Storage); err != nil { - return err - } - - if m.Storage != nil { - if err := m.Storage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storage") - } - return err - } - } - - return nil -} - -func (m *JobImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *JobImportSpec) validateVirtualMachines(formats strfmt.Registry) error { - - if err := validate.Required("virtualMachines", "body", m.VirtualMachines); err != nil { - return err - } - - if m.VirtualMachines != nil { - if err := m.VirtualMachines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualMachines") - } - return err - } - } - - return nil -} - -// ContextValidate validate this job import spec based on the context it is used -func (m *JobImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGuestProcessing(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSchedule(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorage(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVirtualMachines(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobImportSpec) contextValidateGuestProcessing(ctx context.Context, formats strfmt.Registry) error { - - if m.GuestProcessing != nil { - if err := m.GuestProcessing.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("guestProcessing") - } - return err - } - } - - return nil -} - -func (m *JobImportSpec) contextValidateSchedule(ctx context.Context, formats strfmt.Registry) error { - - if m.Schedule != nil { - if err := m.Schedule.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("schedule") - } - return err - } - } - - return nil -} - -func (m *JobImportSpec) contextValidateStorage(ctx context.Context, formats strfmt.Registry) error { - - if m.Storage != nil { - if err := m.Storage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storage") - } - return err - } - } - - return nil -} - -func (m *JobImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *JobImportSpec) contextValidateVirtualMachines(ctx context.Context, formats strfmt.Registry) error { - - if m.VirtualMachines != nil { - if err := m.VirtualMachines.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("virtualMachines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobImportSpec) UnmarshalBinary(b []byte) error { - var res JobImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_import_spec_collection.go b/models/job_import_spec_collection.go deleted file mode 100644 index 94849c1..0000000 --- a/models/job_import_spec_collection.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobImportSpecCollection job import spec collection -// -// swagger:model JobImportSpecCollection -type JobImportSpecCollection struct { - - // Array of jobs. - // Required: true - // Unique: true - Jobs []*JobImportSpec `json:"jobs"` -} - -// Validate validates this job import spec collection -func (m *JobImportSpecCollection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateJobs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobImportSpecCollection) validateJobs(formats strfmt.Registry) error { - - if err := validate.Required("jobs", "body", m.Jobs); err != nil { - return err - } - - if err := validate.UniqueItems("jobs", "body", m.Jobs); err != nil { - return err - } - - for i := 0; i < len(m.Jobs); i++ { - if swag.IsZero(m.Jobs[i]) { // not required - continue - } - - if m.Jobs[i] != nil { - if err := m.Jobs[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this job import spec collection based on the context it is used -func (m *JobImportSpecCollection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateJobs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobImportSpecCollection) contextValidateJobs(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Jobs); i++ { - - if m.Jobs[i] != nil { - if err := m.Jobs[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobImportSpecCollection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobImportSpecCollection) UnmarshalBinary(b []byte) error { - var res JobImportSpecCollection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_model.go b/models/job_model.go deleted file mode 100644 index 28094c5..0000000 --- a/models/job_model.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobModel job model -// -// swagger:model JobModel -type JobModel struct { - - // Description of the job. - // Required: true - Description *string `json:"description"` - - // ID of the job. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // If *true*, the job is disabled. - // Required: true - IsDisabled *bool `json:"isDisabled"` - - // Name of the job. - // Required: true - Name *string `json:"name"` - - // type - // Required: true - Type *EJobType `json:"type"` -} - -// Validate validates this job model -func (m *JobModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsDisabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobModel) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *JobModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobModel) validateIsDisabled(formats strfmt.Registry) error { - - if err := validate.Required("isDisabled", "body", m.IsDisabled); err != nil { - return err - } - - return nil -} - -func (m *JobModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *JobModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this job model based on the context it is used -func (m *JobModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobModel) UnmarshalBinary(b []byte) error { - var res JobModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_scripts_settings_model.go b/models/job_scripts_settings_model.go deleted file mode 100644 index 0d16835..0000000 --- a/models/job_scripts_settings_model.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobScriptsSettingsModel Script settings. -// -// swagger:model JobScriptsSettingsModel -type JobScriptsSettingsModel struct { - - // Days of the week when the scripts must be executed. - // Unique: true - DayOfWeek []EDayOfWeek `json:"dayOfWeek"` - - // periodicity type - PeriodicityType EScriptPeriodicityType `json:"periodicityType,omitempty"` - - // Script executed after the backup job. - PostCommand *ScriptCommand `json:"postCommand,omitempty"` - - // Script executed before the backup job. - PreCommand *ScriptCommand `json:"preCommand,omitempty"` - - // Number of the backup job session after which the scripts must be executed. - RunScriptEvery int64 `json:"runScriptEvery,omitempty"` -} - -// Validate validates this job scripts settings model -func (m *JobScriptsSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDayOfWeek(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePeriodicityType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostCommand(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePreCommand(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobScriptsSettingsModel) validateDayOfWeek(formats strfmt.Registry) error { - if swag.IsZero(m.DayOfWeek) { // not required - return nil - } - - if err := validate.UniqueItems("dayOfWeek", "body", m.DayOfWeek); err != nil { - return err - } - - for i := 0; i < len(m.DayOfWeek); i++ { - - if err := m.DayOfWeek[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayOfWeek" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *JobScriptsSettingsModel) validatePeriodicityType(formats strfmt.Registry) error { - if swag.IsZero(m.PeriodicityType) { // not required - return nil - } - - if err := m.PeriodicityType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("periodicityType") - } - return err - } - - return nil -} - -func (m *JobScriptsSettingsModel) validatePostCommand(formats strfmt.Registry) error { - if swag.IsZero(m.PostCommand) { // not required - return nil - } - - if m.PostCommand != nil { - if err := m.PostCommand.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postCommand") - } - return err - } - } - - return nil -} - -func (m *JobScriptsSettingsModel) validatePreCommand(formats strfmt.Registry) error { - if swag.IsZero(m.PreCommand) { // not required - return nil - } - - if m.PreCommand != nil { - if err := m.PreCommand.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("preCommand") - } - return err - } - } - - return nil -} - -// ContextValidate validate this job scripts settings model based on the context it is used -func (m *JobScriptsSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDayOfWeek(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePeriodicityType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostCommand(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePreCommand(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobScriptsSettingsModel) contextValidateDayOfWeek(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.DayOfWeek); i++ { - - if err := m.DayOfWeek[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayOfWeek" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *JobScriptsSettingsModel) contextValidatePeriodicityType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PeriodicityType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("periodicityType") - } - return err - } - - return nil -} - -func (m *JobScriptsSettingsModel) contextValidatePostCommand(ctx context.Context, formats strfmt.Registry) error { - - if m.PostCommand != nil { - if err := m.PostCommand.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postCommand") - } - return err - } - } - - return nil -} - -func (m *JobScriptsSettingsModel) contextValidatePreCommand(ctx context.Context, formats strfmt.Registry) error { - - if m.PreCommand != nil { - if err := m.PreCommand.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("preCommand") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobScriptsSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobScriptsSettingsModel) UnmarshalBinary(b []byte) error { - var res JobScriptsSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_spec.go b/models/job_spec.go deleted file mode 100644 index b998478..0000000 --- a/models/job_spec.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobSpec job spec -// -// swagger:model JobSpec -type JobSpec struct { - - // Job description specified at the time of the job creation. - // Required: true - Description *string `json:"description"` - - // Name of the job. - // Required: true - Name *string `json:"name"` - - // Job type. - // Required: true - Type *EJobType `json:"type"` -} - -// Validate validates this job spec -func (m *JobSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *JobSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *JobSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this job spec based on the context it is used -func (m *JobSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobSpec) UnmarshalBinary(b []byte) error { - var res JobSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_start_spec.go b/models/job_start_spec.go deleted file mode 100644 index cfe8556..0000000 --- a/models/job_start_spec.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobStartSpec job start spec -// -// swagger:model JobStartSpec -type JobStartSpec struct { - - // perform active full - // Required: true - PerformActiveFull bool `json:"performActiveFull"` - - // start chained jobs - StartChainedJobs *bool `json:"startChainedJobs,omitempty"` -} - -// Validate validates this job start spec -func (m *JobStartSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePerformActiveFull(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobStartSpec) validatePerformActiveFull(formats strfmt.Registry) error { - - if err := validate.Required("performActiveFull", "body", bool(m.PerformActiveFull)); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this job start spec based on context it is used -func (m *JobStartSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *JobStartSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobStartSpec) UnmarshalBinary(b []byte) error { - var res JobStartSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_state_model.go b/models/job_state_model.go deleted file mode 100644 index dd99dfa..0000000 --- a/models/job_state_model.go +++ /dev/null @@ -1,407 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobStateModel job state model -// -// swagger:model JobStateModel -type JobStateModel struct { - - // Description of the job. - // Required: true - Description *string `json:"description"` - - // ID of the job. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // last result - // Required: true - LastResult *ESessionResult `json:"lastResult"` - - // Last run of the job. - // Format: date-time - LastRun strfmt.DateTime `json:"lastRun,omitempty"` - - // Name of the job. - // Required: true - Name *string `json:"name"` - - // Next run of the job. - // Format: date-time - NextRun strfmt.DateTime `json:"nextRun,omitempty"` - - // Number of objects processed by the job. - // Required: true - ObjectsCount *int64 `json:"objectsCount"` - - // ID of the backup repository. - // Format: uuid - RepositoryID strfmt.UUID `json:"repositoryId,omitempty"` - - // Name of the backup repository. - RepositoryName string `json:"repositoryName,omitempty"` - - // ID of the last job session. - // Format: uuid - SessionID strfmt.UUID `json:"sessionId,omitempty"` - - // status - // Required: true - Status *EJobStatus `json:"status"` - - // type - // Required: true - Type *EJobType `json:"type"` - - // workload - // Required: true - Workload *EJobWorkload `json:"workload"` -} - -// Validate validates this job state model -func (m *JobStateModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastResult(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastRun(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNextRun(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObjectsCount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepositoryID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSessionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWorkload(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobStateModel) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *JobStateModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStateModel) validateLastResult(formats strfmt.Registry) error { - - if err := validate.Required("lastResult", "body", m.LastResult); err != nil { - return err - } - - if err := validate.Required("lastResult", "body", m.LastResult); err != nil { - return err - } - - if m.LastResult != nil { - if err := m.LastResult.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lastResult") - } - return err - } - } - - return nil -} - -func (m *JobStateModel) validateLastRun(formats strfmt.Registry) error { - if swag.IsZero(m.LastRun) { // not required - return nil - } - - if err := validate.FormatOf("lastRun", "body", "date-time", m.LastRun.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStateModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *JobStateModel) validateNextRun(formats strfmt.Registry) error { - if swag.IsZero(m.NextRun) { // not required - return nil - } - - if err := validate.FormatOf("nextRun", "body", "date-time", m.NextRun.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStateModel) validateObjectsCount(formats strfmt.Registry) error { - - if err := validate.Required("objectsCount", "body", m.ObjectsCount); err != nil { - return err - } - - return nil -} - -func (m *JobStateModel) validateRepositoryID(formats strfmt.Registry) error { - if swag.IsZero(m.RepositoryID) { // not required - return nil - } - - if err := validate.FormatOf("repositoryId", "body", "uuid", m.RepositoryID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStateModel) validateSessionID(formats strfmt.Registry) error { - if swag.IsZero(m.SessionID) { // not required - return nil - } - - if err := validate.FormatOf("sessionId", "body", "uuid", m.SessionID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStateModel) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *JobStateModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *JobStateModel) validateWorkload(formats strfmt.Registry) error { - - if err := validate.Required("workload", "body", m.Workload); err != nil { - return err - } - - if err := validate.Required("workload", "body", m.Workload); err != nil { - return err - } - - if m.Workload != nil { - if err := m.Workload.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workload") - } - return err - } - } - - return nil -} - -// ContextValidate validate this job state model based on the context it is used -func (m *JobStateModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLastResult(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWorkload(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobStateModel) contextValidateLastResult(ctx context.Context, formats strfmt.Registry) error { - - if m.LastResult != nil { - if err := m.LastResult.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lastResult") - } - return err - } - } - - return nil -} - -func (m *JobStateModel) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *JobStateModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *JobStateModel) contextValidateWorkload(ctx context.Context, formats strfmt.Registry) error { - - if m.Workload != nil { - if err := m.Workload.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workload") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobStateModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobStateModel) UnmarshalBinary(b []byte) error { - var res JobStateModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_states_filters.go b/models/job_states_filters.go deleted file mode 100644 index 814d79b..0000000 --- a/models/job_states_filters.go +++ /dev/null @@ -1,347 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobStatesFilters Filters jobs by the specified parameters. -// -// swagger:model JobStatesFilters -type JobStatesFilters struct { - - // id filter - // Format: uuid - IDFilter strfmt.UUID `json:"idFilter,omitempty"` - - // is high priority job filter - IsHighPriorityJobFilter bool `json:"isHighPriorityJobFilter,omitempty"` - - // last result filter - LastResultFilter ESessionResult `json:"lastResultFilter,omitempty"` - - // last run after filter - // Format: date-time - LastRunAfterFilter strfmt.DateTime `json:"lastRunAfterFilter,omitempty"` - - // last run before filter - // Format: date-time - LastRunBeforeFilter strfmt.DateTime `json:"lastRunBeforeFilter,omitempty"` - - // Returns the specified number of jobs. - Limit int32 `json:"limit,omitempty"` - - // Filters jobs by the `nameFilter` pattern. The pattern can match any job state parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - NameFilter string `json:"nameFilter,omitempty"` - - // objects count filter - ObjectsCountFilter int64 `json:"objectsCountFilter,omitempty"` - - // Sorts jobs in the ascending order by the `orderColumn` parameter. - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EJobStatesFiltersOrderColumn `json:"orderColumn,omitempty"` - - // repository Id filter - // Format: uuid - RepositoryIDFilter strfmt.UUID `json:"repositoryIdFilter,omitempty"` - - // Skips the specified number of jobs. - Skip int32 `json:"skip,omitempty"` - - // status filter - StatusFilter EJobStatus `json:"statusFilter,omitempty"` - - // type filter - TypeFilter EJobType `json:"typeFilter,omitempty"` - - // workload filter - WorkloadFilter EJobWorkload `json:"workloadFilter,omitempty"` -} - -// Validate validates this job states filters -func (m *JobStatesFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastResultFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastRunAfterFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastRunBeforeFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepositoryIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatusFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWorkloadFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobStatesFilters) validateIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.IDFilter) { // not required - return nil - } - - if err := validate.FormatOf("idFilter", "body", "uuid", m.IDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStatesFilters) validateLastResultFilter(formats strfmt.Registry) error { - if swag.IsZero(m.LastResultFilter) { // not required - return nil - } - - if err := m.LastResultFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lastResultFilter") - } - return err - } - - return nil -} - -func (m *JobStatesFilters) validateLastRunAfterFilter(formats strfmt.Registry) error { - if swag.IsZero(m.LastRunAfterFilter) { // not required - return nil - } - - if err := validate.FormatOf("lastRunAfterFilter", "body", "date-time", m.LastRunAfterFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStatesFilters) validateLastRunBeforeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.LastRunBeforeFilter) { // not required - return nil - } - - if err := validate.FormatOf("lastRunBeforeFilter", "body", "date-time", m.LastRunBeforeFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStatesFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *JobStatesFilters) validateRepositoryIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.RepositoryIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("repositoryIdFilter", "body", "uuid", m.RepositoryIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *JobStatesFilters) validateStatusFilter(formats strfmt.Registry) error { - if swag.IsZero(m.StatusFilter) { // not required - return nil - } - - if err := m.StatusFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("statusFilter") - } - return err - } - - return nil -} - -func (m *JobStatesFilters) validateTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TypeFilter) { // not required - return nil - } - - if err := m.TypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -func (m *JobStatesFilters) validateWorkloadFilter(formats strfmt.Registry) error { - if swag.IsZero(m.WorkloadFilter) { // not required - return nil - } - - if err := m.WorkloadFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workloadFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this job states filters based on the context it is used -func (m *JobStatesFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLastResultFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatusFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWorkloadFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobStatesFilters) contextValidateLastResultFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.LastResultFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lastResultFilter") - } - return err - } - - return nil -} - -func (m *JobStatesFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *JobStatesFilters) contextValidateStatusFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.StatusFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("statusFilter") - } - return err - } - - return nil -} - -func (m *JobStatesFilters) contextValidateTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -func (m *JobStatesFilters) contextValidateWorkloadFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.WorkloadFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workloadFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobStatesFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobStatesFilters) UnmarshalBinary(b []byte) error { - var res JobStatesFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_states_result.go b/models/job_states_result.go deleted file mode 100644 index b40bb01..0000000 --- a/models/job_states_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobStatesResult job states result -// -// swagger:model JobStatesResult -type JobStatesResult struct { - - // Array of job states. - // Required: true - Data []*JobStateModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this job states result -func (m *JobStatesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobStatesResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *JobStatesResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this job states result based on the context it is used -func (m *JobStatesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobStatesResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *JobStatesResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobStatesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobStatesResult) UnmarshalBinary(b []byte) error { - var res JobStatesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/job_stop_spec.go b/models/job_stop_spec.go deleted file mode 100644 index bc39934..0000000 --- a/models/job_stop_spec.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobStopSpec job stop spec -// -// swagger:model JobStopSpec -type JobStopSpec struct { - - // gracefull stop - // Required: true - GracefullStop bool `json:"gracefullStop"` -} - -// Validate validates this job stop spec -func (m *JobStopSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGracefullStop(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobStopSpec) validateGracefullStop(formats strfmt.Registry) error { - - if err := validate.Required("gracefullStop", "body", bool(m.GracefullStop)); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this job stop spec based on context it is used -func (m *JobStopSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *JobStopSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobStopSpec) UnmarshalBinary(b []byte) error { - var res JobStopSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/jobs_filters.go b/models/jobs_filters.go deleted file mode 100644 index 102a4c5..0000000 --- a/models/jobs_filters.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// JobsFilters Filters jobs by the specified parameters. -// -// swagger:model JobsFilters -type JobsFilters struct { - - // Returns the specified number of jobs. - Limit int32 `json:"limit,omitempty"` - - // Filters jobs by the `nameFilter` pattern. The pattern can match any job parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - NameFilter string `json:"nameFilter,omitempty"` - - // Sorts jobs in the ascending order by the `orderColumn` parameter. - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EJobFiltersOrderColumn `json:"orderColumn,omitempty"` - - // Skips the specified number of jobs. - Skip int32 `json:"skip,omitempty"` - - // type filter - TypeFilter EJobType `json:"typeFilter,omitempty"` -} - -// Validate validates this jobs filters -func (m *JobsFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobsFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *JobsFilters) validateTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TypeFilter) { // not required - return nil - } - - if err := m.TypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this jobs filters based on the context it is used -func (m *JobsFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobsFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *JobsFilters) contextValidateTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobsFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobsFilters) UnmarshalBinary(b []byte) error { - var res JobsFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/jobs_result.go b/models/jobs_result.go deleted file mode 100644 index 7d793e0..0000000 --- a/models/jobs_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// JobsResult jobs result -// -// swagger:model JobsResult -type JobsResult struct { - - // Array of jobs. - // Required: true - Data []*JobModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this jobs result -func (m *JobsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobsResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *JobsResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this jobs result based on the context it is used -func (m *JobsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JobsResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *JobsResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *JobsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JobsResult) UnmarshalBinary(b []byte) error { - var res JobsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_credentials_model.go b/models/linux_credentials_model.go deleted file mode 100644 index 185cc2a..0000000 --- a/models/linux_credentials_model.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// LinuxCredentialsModel linux credentials model -// -// swagger:model LinuxCredentialsModel -type LinuxCredentialsModel struct { - CredentialsModel - - // SSH port used to connect to a Linux server. - SSHPort int64 `json:"SSHPort,omitempty"` - - // If *true*, the account is automatically added to the sudoers file. - AddToSudoers bool `json:"addToSudoers,omitempty"` - - // If *true*, the permissions of the account are automatically elevated to the root user. - AutoElevated bool `json:"autoElevated,omitempty"` - - // Passphrase that protects the private key. - Passphrase string `json:"passphrase,omitempty"` - - // Private key. - PrivateKey string `json:"privateKey,omitempty"` - - // Tag used to identify the credentials record. - Tag string `json:"tag,omitempty"` - - // If *true*, the `su` command is used for Linux distributions where the `sudo` command is not available. - UseSu bool `json:"useSu,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *LinuxCredentialsModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 CredentialsModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.CredentialsModel = aO0 - - // AO1 - var dataAO1 struct { - SSHPort int64 `json:"SSHPort,omitempty"` - - AddToSudoers bool `json:"addToSudoers,omitempty"` - - AutoElevated bool `json:"autoElevated,omitempty"` - - Passphrase string `json:"passphrase,omitempty"` - - PrivateKey string `json:"privateKey,omitempty"` - - Tag string `json:"tag,omitempty"` - - UseSu bool `json:"useSu,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.SSHPort = dataAO1.SSHPort - - m.AddToSudoers = dataAO1.AddToSudoers - - m.AutoElevated = dataAO1.AutoElevated - - m.Passphrase = dataAO1.Passphrase - - m.PrivateKey = dataAO1.PrivateKey - - m.Tag = dataAO1.Tag - - m.UseSu = dataAO1.UseSu - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m LinuxCredentialsModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.CredentialsModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - SSHPort int64 `json:"SSHPort,omitempty"` - - AddToSudoers bool `json:"addToSudoers,omitempty"` - - AutoElevated bool `json:"autoElevated,omitempty"` - - Passphrase string `json:"passphrase,omitempty"` - - PrivateKey string `json:"privateKey,omitempty"` - - Tag string `json:"tag,omitempty"` - - UseSu bool `json:"useSu,omitempty"` - } - - dataAO1.SSHPort = m.SSHPort - - dataAO1.AddToSudoers = m.AddToSudoers - - dataAO1.AutoElevated = m.AutoElevated - - dataAO1.Passphrase = m.Passphrase - - dataAO1.PrivateKey = m.PrivateKey - - dataAO1.Tag = m.Tag - - dataAO1.UseSu = m.UseSu - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this linux credentials model -func (m *LinuxCredentialsModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CredentialsModel - if err := m.CredentialsModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this linux credentials model based on the context it is used -func (m *LinuxCredentialsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CredentialsModel - if err := m.CredentialsModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxCredentialsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxCredentialsModel) UnmarshalBinary(b []byte) error { - var res LinuxCredentialsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_credentials_spec.go b/models/linux_credentials_spec.go deleted file mode 100644 index 5dc84e3..0000000 --- a/models/linux_credentials_spec.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// LinuxCredentialsSpec linux credentials spec -// -// swagger:model LinuxCredentialsSpec -type LinuxCredentialsSpec struct { - CredentialsSpec - - // SSH port used to connect to a Linux server. - SSHPort int64 `json:"SSHPort,omitempty"` - - // If *true*, the account is automatically added to the sudoers file. - AddToSudoers bool `json:"addToSudoers,omitempty"` - - // If *true*, the permissions of the account are automatically elevated to the root user. - AutoElevated bool `json:"autoElevated,omitempty"` - - // Passphrase that protects the private key. - Passphrase string `json:"passphrase,omitempty"` - - // Private key. - PrivateKey string `json:"privateKey,omitempty"` - - // Password for the root account. - RootPassword string `json:"rootPassword,omitempty"` - - // Tag used to identify the credentials record. - Tag string `json:"tag,omitempty"` - - // If *true*, the `su` command is used for Linux distributions where the `sudo` command is not available. - UseSu bool `json:"useSu,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *LinuxCredentialsSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 CredentialsSpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.CredentialsSpec = aO0 - - // AO1 - var dataAO1 struct { - SSHPort int64 `json:"SSHPort,omitempty"` - - AddToSudoers bool `json:"addToSudoers,omitempty"` - - AutoElevated bool `json:"autoElevated,omitempty"` - - Passphrase string `json:"passphrase,omitempty"` - - PrivateKey string `json:"privateKey,omitempty"` - - RootPassword string `json:"rootPassword,omitempty"` - - Tag string `json:"tag,omitempty"` - - UseSu bool `json:"useSu,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.SSHPort = dataAO1.SSHPort - - m.AddToSudoers = dataAO1.AddToSudoers - - m.AutoElevated = dataAO1.AutoElevated - - m.Passphrase = dataAO1.Passphrase - - m.PrivateKey = dataAO1.PrivateKey - - m.RootPassword = dataAO1.RootPassword - - m.Tag = dataAO1.Tag - - m.UseSu = dataAO1.UseSu - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m LinuxCredentialsSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.CredentialsSpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - SSHPort int64 `json:"SSHPort,omitempty"` - - AddToSudoers bool `json:"addToSudoers,omitempty"` - - AutoElevated bool `json:"autoElevated,omitempty"` - - Passphrase string `json:"passphrase,omitempty"` - - PrivateKey string `json:"privateKey,omitempty"` - - RootPassword string `json:"rootPassword,omitempty"` - - Tag string `json:"tag,omitempty"` - - UseSu bool `json:"useSu,omitempty"` - } - - dataAO1.SSHPort = m.SSHPort - - dataAO1.AddToSudoers = m.AddToSudoers - - dataAO1.AutoElevated = m.AutoElevated - - dataAO1.Passphrase = m.Passphrase - - dataAO1.PrivateKey = m.PrivateKey - - dataAO1.RootPassword = m.RootPassword - - dataAO1.Tag = m.Tag - - dataAO1.UseSu = m.UseSu - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this linux credentials spec -func (m *LinuxCredentialsSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CredentialsSpec - if err := m.CredentialsSpec.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this linux credentials spec based on the context it is used -func (m *LinuxCredentialsSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CredentialsSpec - if err := m.CredentialsSpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxCredentialsSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxCredentialsSpec) UnmarshalBinary(b []byte) error { - var res LinuxCredentialsSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_host_import_spec.go b/models/linux_host_import_spec.go deleted file mode 100644 index fbb4b47..0000000 --- a/models/linux_host_import_spec.go +++ /dev/null @@ -1,244 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LinuxHostImportSpec linux host import spec -// -// swagger:model LinuxHostImportSpec -type LinuxHostImportSpec struct { - - // credentials - // Required: true - Credentials *CredentialsImportModel `json:"credentials"` - - // Description of the server. - // Required: true - Description *string `json:"description"` - - // Full DNS name or IP address of the server. - // Required: true - Name *string `json:"name"` - - // SSH key fingerprint used to verify the server identity. - // Required: true - SSHFingerprint *string `json:"sshFingerprint"` - - // ssh settings - SSHSettings *LinuxHostSSHSettingsModel `json:"sshSettings,omitempty"` - - // type - // Required: true - Type *EManagedServerType `json:"type"` -} - -// Validate validates this linux host import spec -func (m *LinuxHostImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSSHFingerprint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSSHSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxHostImportSpec) validateCredentials(formats strfmt.Registry) error { - - if err := validate.Required("credentials", "body", m.Credentials); err != nil { - return err - } - - if m.Credentials != nil { - if err := m.Credentials.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *LinuxHostImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *LinuxHostImportSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *LinuxHostImportSpec) validateSSHFingerprint(formats strfmt.Registry) error { - - if err := validate.Required("sshFingerprint", "body", m.SSHFingerprint); err != nil { - return err - } - - return nil -} - -func (m *LinuxHostImportSpec) validateSSHSettings(formats strfmt.Registry) error { - if swag.IsZero(m.SSHSettings) { // not required - return nil - } - - if m.SSHSettings != nil { - if err := m.SSHSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshSettings") - } - return err - } - } - - return nil -} - -func (m *LinuxHostImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this linux host import spec based on the context it is used -func (m *LinuxHostImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCredentials(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSSHSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxHostImportSpec) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { - - if m.Credentials != nil { - if err := m.Credentials.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *LinuxHostImportSpec) contextValidateSSHSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.SSHSettings != nil { - if err := m.SSHSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshSettings") - } - return err - } - } - - return nil -} - -func (m *LinuxHostImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxHostImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxHostImportSpec) UnmarshalBinary(b []byte) error { - var res LinuxHostImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_host_model.go b/models/linux_host_model.go deleted file mode 100644 index bbc7bb2..0000000 --- a/models/linux_host_model.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// LinuxHostModel linux host model -// -// swagger:model LinuxHostModel -type LinuxHostModel struct { - ManagedServerModel - - // ssh settings - SSHSettings *LinuxHostSSHSettingsModel `json:"sshSettings,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *LinuxHostModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ManagedServerModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ManagedServerModel = aO0 - - // AO1 - var dataAO1 struct { - SSHSettings *LinuxHostSSHSettingsModel `json:"sshSettings,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.SSHSettings = dataAO1.SSHSettings - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m LinuxHostModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ManagedServerModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - SSHSettings *LinuxHostSSHSettingsModel `json:"sshSettings,omitempty"` - } - - dataAO1.SSHSettings = m.SSHSettings - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this linux host model -func (m *LinuxHostModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerModel - if err := m.ManagedServerModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSSHSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxHostModel) validateSSHSettings(formats strfmt.Registry) error { - - if swag.IsZero(m.SSHSettings) { // not required - return nil - } - - if m.SSHSettings != nil { - if err := m.SSHSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshSettings") - } - return err - } - } - - return nil -} - -// ContextValidate validate this linux host model based on the context it is used -func (m *LinuxHostModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerModel - if err := m.ManagedServerModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSSHSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxHostModel) contextValidateSSHSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.SSHSettings != nil { - if err := m.SSHSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxHostModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxHostModel) UnmarshalBinary(b []byte) error { - var res LinuxHostModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_host_spec.go b/models/linux_host_spec.go deleted file mode 100644 index ec55a19..0000000 --- a/models/linux_host_spec.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LinuxHostSpec linux host spec -// -// swagger:model LinuxHostSpec -type LinuxHostSpec struct { - ManagedServerSpec - - // SSH key fingerprint used to verify the server identity. For details on how to get the fingerprint, see [Get TLS Certificate or SSH Fingerprint](#operation/GetConnectionCertificate). - // - // Required: true - SSHFingerprint *string `json:"sshFingerprint"` - - // ssh settings - SSHSettings *LinuxHostSSHSettingsModel `json:"sshSettings,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *LinuxHostSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ManagedServerSpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ManagedServerSpec = aO0 - - // now for regular properties - var propsLinuxHostSpec struct { - SSHFingerprint *string `json:"sshFingerprint"` - - SSHSettings *LinuxHostSSHSettingsModel `json:"sshSettings,omitempty"` - } - if err := swag.ReadJSON(raw, &propsLinuxHostSpec); err != nil { - return err - } - m.SSHFingerprint = propsLinuxHostSpec.SSHFingerprint - - m.SSHSettings = propsLinuxHostSpec.SSHSettings - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m LinuxHostSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.ManagedServerSpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - // now for regular properties - var propsLinuxHostSpec struct { - SSHFingerprint *string `json:"sshFingerprint"` - - SSHSettings *LinuxHostSSHSettingsModel `json:"sshSettings,omitempty"` - } - propsLinuxHostSpec.SSHFingerprint = m.SSHFingerprint - - propsLinuxHostSpec.SSHSettings = m.SSHSettings - - jsonDataPropsLinuxHostSpec, errLinuxHostSpec := swag.WriteJSON(propsLinuxHostSpec) - if errLinuxHostSpec != nil { - return nil, errLinuxHostSpec - } - _parts = append(_parts, jsonDataPropsLinuxHostSpec) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this linux host spec -func (m *LinuxHostSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerSpec - if err := m.ManagedServerSpec.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSSHFingerprint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSSHSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxHostSpec) validateSSHFingerprint(formats strfmt.Registry) error { - - if err := validate.Required("sshFingerprint", "body", m.SSHFingerprint); err != nil { - return err - } - - return nil -} - -func (m *LinuxHostSpec) validateSSHSettings(formats strfmt.Registry) error { - if swag.IsZero(m.SSHSettings) { // not required - return nil - } - - if m.SSHSettings != nil { - if err := m.SSHSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshSettings") - } - return err - } - } - - return nil -} - -// ContextValidate validate this linux host spec based on the context it is used -func (m *LinuxHostSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerSpec - if err := m.ManagedServerSpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSSHSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxHostSpec) contextValidateSSHSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.SSHSettings != nil { - if err := m.SSHSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sshSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxHostSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxHostSpec) UnmarshalBinary(b []byte) error { - var res LinuxHostSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_host_ssh_settings_model.go b/models/linux_host_ssh_settings_model.go deleted file mode 100644 index 07ec8d9..0000000 --- a/models/linux_host_ssh_settings_model.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// LinuxHostSSHSettingsModel SSH settings. -// -// swagger:model LinuxHostSSHSettingsModel -type LinuxHostSSHSettingsModel struct { - - // Port used as a control channel from the Veeam Backup & Replication console to the Linux server. - ManagementPort int64 `json:"managementPort,omitempty"` - - // End port used for data transfer. - PortRangeEnd int64 `json:"portRangeEnd,omitempty"` - - // Start port used for data transfer. - PortRangeStart int64 `json:"portRangeStart,omitempty"` - - // If *true*, the server is run on this side. - ServerThisSide bool `json:"serverThisSide,omitempty"` - - // SSH timeout, in ms. If a task targeted at the server is inactive after the timeout, the task is terminated. - SSHTimeOutMs int64 `json:"sshTimeOutMs,omitempty"` -} - -// Validate validates this linux host SSH settings model -func (m *LinuxHostSSHSettingsModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this linux host SSH settings model based on context it is used -func (m *LinuxHostSSHSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxHostSSHSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxHostSSHSettingsModel) UnmarshalBinary(b []byte) error { - var res LinuxHostSSHSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_local_repository_settings_model.go b/models/linux_local_repository_settings_model.go deleted file mode 100644 index 1153163..0000000 --- a/models/linux_local_repository_settings_model.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// LinuxLocalRepositorySettingsModel Repository settings. -// -// swagger:model LinuxLocalRepositorySettingsModel -type LinuxLocalRepositorySettingsModel struct { - - // advanced settings - AdvancedSettings *RepositoryAdvancedSettingsModel `json:"advancedSettings,omitempty"` - - // Number of days to keep immutable backups. - MakeRecentBackupsImmutableDays int64 `json:"makeRecentBackupsImmutableDays,omitempty"` - - // Maximum number of concurrent tasks. - MaxTaskCount int64 `json:"maxTaskCount,omitempty"` - - // Path to the folder where backup files are stored. - Path string `json:"path,omitempty"` - - // Maximum rate that restricts the total speed of reading and writing data to the backup repository disk. - ReadWriteRate int64 `json:"readWriteRate,omitempty"` - - // [For Linux repository] If *true*, fast cloning on XFS volumes is used. - // - UseFastCloningOnXFSVolumes bool `json:"useFastCloningOnXFSVolumes,omitempty"` - - // If *true*, the Object Lock feature is used to protect recent backups. - UseImmutableBackups bool `json:"useImmutableBackups,omitempty"` -} - -// Validate validates this linux local repository settings model -func (m *LinuxLocalRepositorySettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdvancedSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxLocalRepositorySettingsModel) validateAdvancedSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AdvancedSettings) { // not required - return nil - } - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -// ContextValidate validate this linux local repository settings model based on the context it is used -func (m *LinuxLocalRepositorySettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvancedSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxLocalRepositorySettingsModel) contextValidateAdvancedSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxLocalRepositorySettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxLocalRepositorySettingsModel) UnmarshalBinary(b []byte) error { - var res LinuxLocalRepositorySettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_local_storage_import_spec.go b/models/linux_local_storage_import_spec.go deleted file mode 100644 index d7f14c6..0000000 --- a/models/linux_local_storage_import_spec.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LinuxLocalStorageImportSpec linux local storage import spec -// -// swagger:model LinuxLocalStorageImportSpec -type LinuxLocalStorageImportSpec struct { - - // Description of the backup repository. - // Required: true - Description *string `json:"description"` - - // ID of the server that is used as a backup repository. - // Required: true - HostName *string `json:"hostName"` - - // mount server - // Required: true - MountServer *MountServerSettingsImportSpec `json:"mountServer"` - - // Name of the backup repository. - // Required: true - Name *string `json:"name"` - - // repository - // Required: true - Repository *LinuxLocalRepositorySettingsModel `json:"repository"` - - // VMware vSphere tag assigned to the backup repository. - // Required: true - Tag *string `json:"tag"` - - // type - // Required: true - Type *ERepositoryType `json:"type"` -} - -// Validate validates this linux local storage import spec -func (m *LinuxLocalStorageImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxLocalStorageImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *LinuxLocalStorageImportSpec) validateHostName(formats strfmt.Registry) error { - - if err := validate.Required("hostName", "body", m.HostName); err != nil { - return err - } - - return nil -} - -func (m *LinuxLocalStorageImportSpec) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *LinuxLocalStorageImportSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *LinuxLocalStorageImportSpec) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *LinuxLocalStorageImportSpec) validateTag(formats strfmt.Registry) error { - - if err := validate.Required("tag", "body", m.Tag); err != nil { - return err - } - - return nil -} - -func (m *LinuxLocalStorageImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this linux local storage import spec based on the context it is used -func (m *LinuxLocalStorageImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxLocalStorageImportSpec) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *LinuxLocalStorageImportSpec) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *LinuxLocalStorageImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxLocalStorageImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxLocalStorageImportSpec) UnmarshalBinary(b []byte) error { - var res LinuxLocalStorageImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_local_storage_model.go b/models/linux_local_storage_model.go deleted file mode 100644 index d088f2a..0000000 --- a/models/linux_local_storage_model.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LinuxLocalStorageModel Direct attached storage. -// -// swagger:model LinuxLocalStorageModel -type LinuxLocalStorageModel struct { - RepositoryModel - - // ID of the server that is used as a backup repository. - // Required: true - // Format: uuid - HostID *strfmt.UUID `json:"hostId"` - - // mount server - // Required: true - MountServer *MountServerSettingsModel `json:"mountServer"` - - // repository - // Required: true - Repository *LinuxLocalRepositorySettingsModel `json:"repository"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *LinuxLocalStorageModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RepositoryModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RepositoryModel = aO0 - - // AO1 - var dataAO1 struct { - HostID *strfmt.UUID `json:"hostId"` - - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *LinuxLocalRepositorySettingsModel `json:"repository"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.HostID = dataAO1.HostID - - m.MountServer = dataAO1.MountServer - - m.Repository = dataAO1.Repository - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m LinuxLocalStorageModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.RepositoryModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - HostID *strfmt.UUID `json:"hostId"` - - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *LinuxLocalRepositorySettingsModel `json:"repository"` - } - - dataAO1.HostID = m.HostID - - dataAO1.MountServer = m.MountServer - - dataAO1.Repository = m.Repository - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this linux local storage model -func (m *LinuxLocalStorageModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositoryModel - if err := m.RepositoryModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxLocalStorageModel) validateHostID(formats strfmt.Registry) error { - - if err := validate.Required("hostId", "body", m.HostID); err != nil { - return err - } - - if err := validate.FormatOf("hostId", "body", "uuid", m.HostID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *LinuxLocalStorageModel) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *LinuxLocalStorageModel) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -// ContextValidate validate this linux local storage model based on the context it is used -func (m *LinuxLocalStorageModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositoryModel - if err := m.RepositoryModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxLocalStorageModel) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *LinuxLocalStorageModel) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxLocalStorageModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxLocalStorageModel) UnmarshalBinary(b []byte) error { - var res LinuxLocalStorageModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/linux_local_storage_spec.go b/models/linux_local_storage_spec.go deleted file mode 100644 index 8bdf024..0000000 --- a/models/linux_local_storage_spec.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LinuxLocalStorageSpec linux local storage spec -// -// swagger:model LinuxLocalStorageSpec -type LinuxLocalStorageSpec struct { - RepositorySpec - - // ID of the server that is used as a backup repository. - // Required: true - // Format: uuid - HostID *strfmt.UUID `json:"hostId"` - - // mount server - // Required: true - MountServer *MountServerSettingsModel `json:"mountServer"` - - // repository - // Required: true - Repository *LinuxLocalRepositorySettingsModel `json:"repository"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *LinuxLocalStorageSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RepositorySpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RepositorySpec = aO0 - - // AO1 - var dataAO1 struct { - HostID *strfmt.UUID `json:"hostId"` - - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *LinuxLocalRepositorySettingsModel `json:"repository"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.HostID = dataAO1.HostID - - m.MountServer = dataAO1.MountServer - - m.Repository = dataAO1.Repository - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m LinuxLocalStorageSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.RepositorySpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - HostID *strfmt.UUID `json:"hostId"` - - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *LinuxLocalRepositorySettingsModel `json:"repository"` - } - - dataAO1.HostID = m.HostID - - dataAO1.MountServer = m.MountServer - - dataAO1.Repository = m.Repository - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this linux local storage spec -func (m *LinuxLocalStorageSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositorySpec - if err := m.RepositorySpec.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxLocalStorageSpec) validateHostID(formats strfmt.Registry) error { - - if err := validate.Required("hostId", "body", m.HostID); err != nil { - return err - } - - if err := validate.FormatOf("hostId", "body", "uuid", m.HostID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *LinuxLocalStorageSpec) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *LinuxLocalStorageSpec) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -// ContextValidate validate this linux local storage spec based on the context it is used -func (m *LinuxLocalStorageSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositorySpec - if err := m.RepositorySpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LinuxLocalStorageSpec) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *LinuxLocalStorageSpec) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LinuxLocalStorageSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LinuxLocalStorageSpec) UnmarshalBinary(b []byte) error { - var res LinuxLocalStorageSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/manage_server_export_spec.go b/models/manage_server_export_spec.go deleted file mode 100644 index 762bff3..0000000 --- a/models/manage_server_export_spec.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ManageServerExportSpec manage server export spec -// -// swagger:model ManageServerExportSpec -type ManageServerExportSpec struct { - - // Array of server IDs. - // Unique: true - Ids []strfmt.UUID `json:"ids"` - - // Array of server names. Wildcard characters are supported. - // Unique: true - Names []string `json:"names"` - - // Array of server types. - // Unique: true - Types []EManagedServerType `json:"types"` -} - -// Validate validates this manage server export spec -func (m *ManageServerExportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNames(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManageServerExportSpec) validateIds(formats strfmt.Registry) error { - if swag.IsZero(m.Ids) { // not required - return nil - } - - if err := validate.UniqueItems("ids", "body", m.Ids); err != nil { - return err - } - - for i := 0; i < len(m.Ids); i++ { - - if err := validate.FormatOf("ids"+"."+strconv.Itoa(i), "body", "uuid", m.Ids[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -func (m *ManageServerExportSpec) validateNames(formats strfmt.Registry) error { - if swag.IsZero(m.Names) { // not required - return nil - } - - if err := validate.UniqueItems("names", "body", m.Names); err != nil { - return err - } - - return nil -} - -func (m *ManageServerExportSpec) validateTypes(formats strfmt.Registry) error { - if swag.IsZero(m.Types) { // not required - return nil - } - - if err := validate.UniqueItems("types", "body", m.Types); err != nil { - return err - } - - for i := 0; i < len(m.Types); i++ { - - if err := m.Types[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("types" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this manage server export spec based on the context it is used -func (m *ManageServerExportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManageServerExportSpec) contextValidateTypes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Types); i++ { - - if err := m.Types[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("types" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ManageServerExportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ManageServerExportSpec) UnmarshalBinary(b []byte) error { - var res ManageServerExportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/manage_server_import_spec_collection.go b/models/manage_server_import_spec_collection.go deleted file mode 100644 index fe32609..0000000 --- a/models/manage_server_import_spec_collection.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ManageServerImportSpecCollection manage server import spec collection -// -// swagger:model ManageServerImportSpecCollection -type ManageServerImportSpecCollection struct { - - // Array of managed Linux servers. - // Unique: true - LinuxHosts []*LinuxHostImportSpec `json:"linuxHosts"` - - // Array of VMware vSphere servers. - // Unique: true - ViHosts []*ViHostImportSpec `json:"viHosts"` - - // Array of managed Microsoft Windows servers. - // Unique: true - WindowsHosts []*WindowsHostImportSpec `json:"windowsHosts"` -} - -// Validate validates this manage server import spec collection -func (m *ManageServerImportSpecCollection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinuxHosts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViHosts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWindowsHosts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManageServerImportSpecCollection) validateLinuxHosts(formats strfmt.Registry) error { - if swag.IsZero(m.LinuxHosts) { // not required - return nil - } - - if err := validate.UniqueItems("linuxHosts", "body", m.LinuxHosts); err != nil { - return err - } - - for i := 0; i < len(m.LinuxHosts); i++ { - if swag.IsZero(m.LinuxHosts[i]) { // not required - continue - } - - if m.LinuxHosts[i] != nil { - if err := m.LinuxHosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("linuxHosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ManageServerImportSpecCollection) validateViHosts(formats strfmt.Registry) error { - if swag.IsZero(m.ViHosts) { // not required - return nil - } - - if err := validate.UniqueItems("viHosts", "body", m.ViHosts); err != nil { - return err - } - - for i := 0; i < len(m.ViHosts); i++ { - if swag.IsZero(m.ViHosts[i]) { // not required - continue - } - - if m.ViHosts[i] != nil { - if err := m.ViHosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viHosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ManageServerImportSpecCollection) validateWindowsHosts(formats strfmt.Registry) error { - if swag.IsZero(m.WindowsHosts) { // not required - return nil - } - - if err := validate.UniqueItems("windowsHosts", "body", m.WindowsHosts); err != nil { - return err - } - - for i := 0; i < len(m.WindowsHosts); i++ { - if swag.IsZero(m.WindowsHosts[i]) { // not required - continue - } - - if m.WindowsHosts[i] != nil { - if err := m.WindowsHosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("windowsHosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this manage server import spec collection based on the context it is used -func (m *ManageServerImportSpecCollection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinuxHosts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateViHosts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWindowsHosts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManageServerImportSpecCollection) contextValidateLinuxHosts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.LinuxHosts); i++ { - - if m.LinuxHosts[i] != nil { - if err := m.LinuxHosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("linuxHosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ManageServerImportSpecCollection) contextValidateViHosts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ViHosts); i++ { - - if m.ViHosts[i] != nil { - if err := m.ViHosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viHosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ManageServerImportSpecCollection) contextValidateWindowsHosts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.WindowsHosts); i++ { - - if m.WindowsHosts[i] != nil { - if err := m.WindowsHosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("windowsHosts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ManageServerImportSpecCollection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ManageServerImportSpecCollection) UnmarshalBinary(b []byte) error { - var res ManageServerImportSpecCollection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/managed_server_model.go b/models/managed_server_model.go deleted file mode 100644 index c9a6145..0000000 --- a/models/managed_server_model.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ManagedServerModel managed server model -// -// swagger:model ManagedServerModel -type ManagedServerModel struct { - - // ID of a credentials record used to connect to the server. - // Required: true - // Format: uuid - CredentialsID *strfmt.UUID `json:"credentialsId"` - - // Description of the server. - // Required: true - Description *string `json:"description"` - - // ID of the server. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Full DNS name or IP address of the server. - // Required: true - Name *string `json:"name"` - - // type - // Required: true - Type *EManagedServerType `json:"type"` -} - -// Validate validates this managed server model -func (m *ManagedServerModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentialsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManagedServerModel) validateCredentialsID(formats strfmt.Registry) error { - - if err := validate.Required("credentialsId", "body", m.CredentialsID); err != nil { - return err - } - - if err := validate.FormatOf("credentialsId", "body", "uuid", m.CredentialsID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ManagedServerModel) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ManagedServerModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ManagedServerModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ManagedServerModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this managed server model based on the context it is used -func (m *ManagedServerModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManagedServerModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ManagedServerModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ManagedServerModel) UnmarshalBinary(b []byte) error { - var res ManagedServerModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/managed_server_spec.go b/models/managed_server_spec.go deleted file mode 100644 index d74d802..0000000 --- a/models/managed_server_spec.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ManagedServerSpec managed server spec -// -// swagger:model ManagedServerSpec -type ManagedServerSpec struct { - - // ID of the credentials used to connect to the server. - // Required: true - // Format: uuid - CredentialsID *strfmt.UUID `json:"credentialsId"` - - // Description of the server. - // Required: true - Description *string `json:"description"` - - // Full DNS name or IP address of the server. - // Required: true - Name *string `json:"name"` - - // type - // Required: true - Type *EManagedServerType `json:"type"` -} - -// Validate validates this managed server spec -func (m *ManagedServerSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentialsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManagedServerSpec) validateCredentialsID(formats strfmt.Registry) error { - - if err := validate.Required("credentialsId", "body", m.CredentialsID); err != nil { - return err - } - - if err := validate.FormatOf("credentialsId", "body", "uuid", m.CredentialsID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ManagedServerSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ManagedServerSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ManagedServerSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this managed server spec based on the context it is used -func (m *ManagedServerSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManagedServerSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ManagedServerSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ManagedServerSpec) UnmarshalBinary(b []byte) error { - var res ManagedServerSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/managed_servers_filters.go b/models/managed_servers_filters.go deleted file mode 100644 index c27f755..0000000 --- a/models/managed_servers_filters.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ManagedServersFilters managed servers filters -// -// swagger:model ManagedServersFilters -type ManagedServersFilters struct { - - // limit - Limit int32 `json:"limit,omitempty"` - - // name filter - NameFilter string `json:"nameFilter,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EManagedServersFiltersOrderColumn `json:"orderColumn,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` - - // type filter - TypeFilter EManagedServerType `json:"typeFilter,omitempty"` - - // vi type filter - ViTypeFilter EViHostType `json:"viTypeFilter,omitempty"` -} - -// Validate validates this managed servers filters -func (m *ManagedServersFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViTypeFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManagedServersFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *ManagedServersFilters) validateTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TypeFilter) { // not required - return nil - } - - if err := m.TypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -func (m *ManagedServersFilters) validateViTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.ViTypeFilter) { // not required - return nil - } - - if err := m.ViTypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viTypeFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this managed servers filters based on the context it is used -func (m *ManagedServersFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateViTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManagedServersFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *ManagedServersFilters) contextValidateTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -func (m *ManagedServersFilters) contextValidateViTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ViTypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viTypeFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ManagedServersFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ManagedServersFilters) UnmarshalBinary(b []byte) error { - var res ManagedServersFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/managed_servers_result.go b/models/managed_servers_result.go deleted file mode 100644 index d87a827..0000000 --- a/models/managed_servers_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ManagedServersResult managed servers result -// -// swagger:model ManagedServersResult -type ManagedServersResult struct { - - // Array of managed servers. - // Required: true - Data []*ManagedServerModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this managed servers result -func (m *ManagedServersResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManagedServersResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ManagedServersResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this managed servers result based on the context it is used -func (m *ManagedServersResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ManagedServersResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ManagedServersResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ManagedServersResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ManagedServersResult) UnmarshalBinary(b []byte) error { - var res ManagedServersResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/mount_server_settings_import_spec.go b/models/mount_server_settings_import_spec.go deleted file mode 100644 index 036b87a..0000000 --- a/models/mount_server_settings_import_spec.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MountServerSettingsImportSpec mount server settings import spec -// -// swagger:model MountServerSettingsImportSpec -type MountServerSettingsImportSpec struct { - - // Name of the mount server. - // Required: true - MountServerName *string `json:"mountServerName"` - - // If *true*, the vPower NFS Service is enabled on the mount server. - // Required: true - VPowerNFSEnabled *bool `json:"vPowerNFSEnabled"` - - // v power n f s port settings - VPowerNFSPortSettings *VPowerNFSPortSettingsModel `json:"vPowerNFSPortSettings,omitempty"` - - // Path to the folder used for writing cache during mount operations. - // Required: true - WriteCacheFolder *string `json:"writeCacheFolder"` -} - -// Validate validates this mount server settings import spec -func (m *MountServerSettingsImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMountServerName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVPowerNFSEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVPowerNFSPortSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWriteCacheFolder(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MountServerSettingsImportSpec) validateMountServerName(formats strfmt.Registry) error { - - if err := validate.Required("mountServerName", "body", m.MountServerName); err != nil { - return err - } - - return nil -} - -func (m *MountServerSettingsImportSpec) validateVPowerNFSEnabled(formats strfmt.Registry) error { - - if err := validate.Required("vPowerNFSEnabled", "body", m.VPowerNFSEnabled); err != nil { - return err - } - - return nil -} - -func (m *MountServerSettingsImportSpec) validateVPowerNFSPortSettings(formats strfmt.Registry) error { - if swag.IsZero(m.VPowerNFSPortSettings) { // not required - return nil - } - - if m.VPowerNFSPortSettings != nil { - if err := m.VPowerNFSPortSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vPowerNFSPortSettings") - } - return err - } - } - - return nil -} - -func (m *MountServerSettingsImportSpec) validateWriteCacheFolder(formats strfmt.Registry) error { - - if err := validate.Required("writeCacheFolder", "body", m.WriteCacheFolder); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this mount server settings import spec based on the context it is used -func (m *MountServerSettingsImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVPowerNFSPortSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MountServerSettingsImportSpec) contextValidateVPowerNFSPortSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.VPowerNFSPortSettings != nil { - if err := m.VPowerNFSPortSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vPowerNFSPortSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MountServerSettingsImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MountServerSettingsImportSpec) UnmarshalBinary(b []byte) error { - var res MountServerSettingsImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/mount_server_settings_model.go b/models/mount_server_settings_model.go deleted file mode 100644 index f9d134b..0000000 --- a/models/mount_server_settings_model.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MountServerSettingsModel Settings for the mount server that is used for file-level and application items restore. -// -// swagger:model MountServerSettingsModel -type MountServerSettingsModel struct { - - // ID of the mount server. - // Required: true - // Format: uuid - MountServerID *strfmt.UUID `json:"mountServerId"` - - // If *true*, the vPower NFS Service is enabled on the mount server. - // Required: true - VPowerNFSEnabled *bool `json:"vPowerNFSEnabled"` - - // v power n f s port settings - VPowerNFSPortSettings *VPowerNFSPortSettingsModel `json:"vPowerNFSPortSettings,omitempty"` - - // Path to the folder used for writing cache during mount operations. - // Required: true - WriteCacheFolder *string `json:"writeCacheFolder"` -} - -// Validate validates this mount server settings model -func (m *MountServerSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMountServerID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVPowerNFSEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVPowerNFSPortSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWriteCacheFolder(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MountServerSettingsModel) validateMountServerID(formats strfmt.Registry) error { - - if err := validate.Required("mountServerId", "body", m.MountServerID); err != nil { - return err - } - - if err := validate.FormatOf("mountServerId", "body", "uuid", m.MountServerID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MountServerSettingsModel) validateVPowerNFSEnabled(formats strfmt.Registry) error { - - if err := validate.Required("vPowerNFSEnabled", "body", m.VPowerNFSEnabled); err != nil { - return err - } - - return nil -} - -func (m *MountServerSettingsModel) validateVPowerNFSPortSettings(formats strfmt.Registry) error { - if swag.IsZero(m.VPowerNFSPortSettings) { // not required - return nil - } - - if m.VPowerNFSPortSettings != nil { - if err := m.VPowerNFSPortSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vPowerNFSPortSettings") - } - return err - } - } - - return nil -} - -func (m *MountServerSettingsModel) validateWriteCacheFolder(formats strfmt.Registry) error { - - if err := validate.Required("writeCacheFolder", "body", m.WriteCacheFolder); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this mount server settings model based on the context it is used -func (m *MountServerSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVPowerNFSPortSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MountServerSettingsModel) contextValidateVPowerNFSPortSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.VPowerNFSPortSettings != nil { - if err := m.VPowerNFSPortSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vPowerNFSPortSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MountServerSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MountServerSettingsModel) UnmarshalBinary(b []byte) error { - var res MountServerSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/network_repository_settings_model.go b/models/network_repository_settings_model.go deleted file mode 100644 index fdbfc99..0000000 --- a/models/network_repository_settings_model.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NetworkRepositorySettingsModel Repository settings. -// -// swagger:model NetworkRepositorySettingsModel -type NetworkRepositorySettingsModel struct { - - // advanced settings - AdvancedSettings *RepositoryAdvancedSettingsModel `json:"advancedSettings,omitempty"` - - // Maximum number of concurrent tasks. - MaxTaskCount int64 `json:"maxTaskCount,omitempty"` - - // Maximum rate that restricts the total speed of reading and writing data to the backup repository disk. - ReadWriteRate int64 `json:"readWriteRate,omitempty"` -} - -// Validate validates this network repository settings model -func (m *NetworkRepositorySettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdvancedSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkRepositorySettingsModel) validateAdvancedSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AdvancedSettings) { // not required - return nil - } - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -// ContextValidate validate this network repository settings model based on the context it is used -func (m *NetworkRepositorySettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvancedSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NetworkRepositorySettingsModel) contextValidateAdvancedSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkRepositorySettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkRepositorySettingsModel) UnmarshalBinary(b []byte) error { - var res NetworkRepositorySettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/nfs_repository_share_settings_model.go b/models/nfs_repository_share_settings_model.go deleted file mode 100644 index 8682cd5..0000000 --- a/models/nfs_repository_share_settings_model.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NfsRepositoryShareSettingsModel Share settings. -// -// swagger:model NfsRepositoryShareSettingsModel -type NfsRepositoryShareSettingsModel struct { - - // gateway server - GatewayServer *RepositoryShareGatewayModel `json:"gatewayServer,omitempty"` - - // Path to the shared folder that that is used as a backup repository. - // Required: true - SharePath *string `json:"sharePath"` -} - -// Validate validates this nfs repository share settings model -func (m *NfsRepositoryShareSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGatewayServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSharePath(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsRepositoryShareSettingsModel) validateGatewayServer(formats strfmt.Registry) error { - if swag.IsZero(m.GatewayServer) { // not required - return nil - } - - if m.GatewayServer != nil { - if err := m.GatewayServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gatewayServer") - } - return err - } - } - - return nil -} - -func (m *NfsRepositoryShareSettingsModel) validateSharePath(formats strfmt.Registry) error { - - if err := validate.Required("sharePath", "body", m.SharePath); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this nfs repository share settings model based on the context it is used -func (m *NfsRepositoryShareSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGatewayServer(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsRepositoryShareSettingsModel) contextValidateGatewayServer(ctx context.Context, formats strfmt.Registry) error { - - if m.GatewayServer != nil { - if err := m.GatewayServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gatewayServer") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NfsRepositoryShareSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NfsRepositoryShareSettingsModel) UnmarshalBinary(b []byte) error { - var res NfsRepositoryShareSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/nfs_repository_share_settings_spec.go b/models/nfs_repository_share_settings_spec.go deleted file mode 100644 index 69f4783..0000000 --- a/models/nfs_repository_share_settings_spec.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NfsRepositoryShareSettingsSpec nfs repository share settings spec -// -// swagger:model NfsRepositoryShareSettingsSpec -type NfsRepositoryShareSettingsSpec struct { - - // gateway server - GatewayServer *RepositoryShareGatewayImportSpec `json:"gatewayServer,omitempty"` - - // Path to the shared folder that that is used as a backup repository. - // Required: true - SharePath *string `json:"sharePath"` -} - -// Validate validates this nfs repository share settings spec -func (m *NfsRepositoryShareSettingsSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGatewayServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSharePath(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsRepositoryShareSettingsSpec) validateGatewayServer(formats strfmt.Registry) error { - if swag.IsZero(m.GatewayServer) { // not required - return nil - } - - if m.GatewayServer != nil { - if err := m.GatewayServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gatewayServer") - } - return err - } - } - - return nil -} - -func (m *NfsRepositoryShareSettingsSpec) validateSharePath(formats strfmt.Registry) error { - - if err := validate.Required("sharePath", "body", m.SharePath); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this nfs repository share settings spec based on the context it is used -func (m *NfsRepositoryShareSettingsSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGatewayServer(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsRepositoryShareSettingsSpec) contextValidateGatewayServer(ctx context.Context, formats strfmt.Registry) error { - - if m.GatewayServer != nil { - if err := m.GatewayServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gatewayServer") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NfsRepositoryShareSettingsSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NfsRepositoryShareSettingsSpec) UnmarshalBinary(b []byte) error { - var res NfsRepositoryShareSettingsSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/nfs_storage_import_spec.go b/models/nfs_storage_import_spec.go deleted file mode 100644 index 970f207..0000000 --- a/models/nfs_storage_import_spec.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NfsStorageImportSpec nfs storage import spec -// -// swagger:model NfsStorageImportSpec -type NfsStorageImportSpec struct { - - // Description of the backup repository. - // Required: true - Description *string `json:"description"` - - // mount server - // Required: true - MountServer *MountServerSettingsImportSpec `json:"mountServer"` - - // Name of the backup repository. - // Required: true - Name *string `json:"name"` - - // repository - // Required: true - Repository *NetworkRepositorySettingsModel `json:"repository"` - - // share - // Required: true - Share *NfsRepositoryShareSettingsSpec `json:"share"` - - // VMware vSphere tag assigned to the backup repository. - // Required: true - Tag *string `json:"tag"` - - // type - // Required: true - Type *ERepositoryType `json:"type"` -} - -// Validate validates this nfs storage import spec -func (m *NfsStorageImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShare(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsStorageImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *NfsStorageImportSpec) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *NfsStorageImportSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *NfsStorageImportSpec) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *NfsStorageImportSpec) validateShare(formats strfmt.Registry) error { - - if err := validate.Required("share", "body", m.Share); err != nil { - return err - } - - if m.Share != nil { - if err := m.Share.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -func (m *NfsStorageImportSpec) validateTag(formats strfmt.Registry) error { - - if err := validate.Required("tag", "body", m.Tag); err != nil { - return err - } - - return nil -} - -func (m *NfsStorageImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this nfs storage import spec based on the context it is used -func (m *NfsStorageImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShare(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsStorageImportSpec) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *NfsStorageImportSpec) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *NfsStorageImportSpec) contextValidateShare(ctx context.Context, formats strfmt.Registry) error { - - if m.Share != nil { - if err := m.Share.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -func (m *NfsStorageImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NfsStorageImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NfsStorageImportSpec) UnmarshalBinary(b []byte) error { - var res NfsStorageImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/nfs_storage_model.go b/models/nfs_storage_model.go deleted file mode 100644 index c9535c6..0000000 --- a/models/nfs_storage_model.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NfsStorageModel Network attached storage. -// -// swagger:model NfsStorageModel -type NfsStorageModel struct { - RepositoryModel - - // mount server - // Required: true - MountServer *MountServerSettingsModel `json:"mountServer"` - - // repository - // Required: true - Repository *NetworkRepositorySettingsModel `json:"repository"` - - // share - // Required: true - Share *NfsRepositoryShareSettingsModel `json:"share"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *NfsStorageModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RepositoryModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RepositoryModel = aO0 - - // AO1 - var dataAO1 struct { - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *NetworkRepositorySettingsModel `json:"repository"` - - Share *NfsRepositoryShareSettingsModel `json:"share"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.MountServer = dataAO1.MountServer - - m.Repository = dataAO1.Repository - - m.Share = dataAO1.Share - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m NfsStorageModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.RepositoryModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *NetworkRepositorySettingsModel `json:"repository"` - - Share *NfsRepositoryShareSettingsModel `json:"share"` - } - - dataAO1.MountServer = m.MountServer - - dataAO1.Repository = m.Repository - - dataAO1.Share = m.Share - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this nfs storage model -func (m *NfsStorageModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositoryModel - if err := m.RepositoryModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShare(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsStorageModel) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *NfsStorageModel) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *NfsStorageModel) validateShare(formats strfmt.Registry) error { - - if err := validate.Required("share", "body", m.Share); err != nil { - return err - } - - if m.Share != nil { - if err := m.Share.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -// ContextValidate validate this nfs storage model based on the context it is used -func (m *NfsStorageModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositoryModel - if err := m.RepositoryModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShare(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsStorageModel) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *NfsStorageModel) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *NfsStorageModel) contextValidateShare(ctx context.Context, formats strfmt.Registry) error { - - if m.Share != nil { - if err := m.Share.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NfsStorageModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NfsStorageModel) UnmarshalBinary(b []byte) error { - var res NfsStorageModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/nfs_storage_spec.go b/models/nfs_storage_spec.go deleted file mode 100644 index 2fb1dd2..0000000 --- a/models/nfs_storage_spec.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NfsStorageSpec nfs storage spec -// -// swagger:model NfsStorageSpec -type NfsStorageSpec struct { - RepositorySpec - - // mount server - // Required: true - MountServer *MountServerSettingsModel `json:"mountServer"` - - // repository - // Required: true - Repository *NetworkRepositorySettingsModel `json:"repository"` - - // share - // Required: true - Share *NfsRepositoryShareSettingsModel `json:"share"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *NfsStorageSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RepositorySpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RepositorySpec = aO0 - - // AO1 - var dataAO1 struct { - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *NetworkRepositorySettingsModel `json:"repository"` - - Share *NfsRepositoryShareSettingsModel `json:"share"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.MountServer = dataAO1.MountServer - - m.Repository = dataAO1.Repository - - m.Share = dataAO1.Share - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m NfsStorageSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.RepositorySpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *NetworkRepositorySettingsModel `json:"repository"` - - Share *NfsRepositoryShareSettingsModel `json:"share"` - } - - dataAO1.MountServer = m.MountServer - - dataAO1.Repository = m.Repository - - dataAO1.Share = m.Share - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this nfs storage spec -func (m *NfsStorageSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositorySpec - if err := m.RepositorySpec.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShare(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsStorageSpec) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *NfsStorageSpec) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *NfsStorageSpec) validateShare(formats strfmt.Registry) error { - - if err := validate.Required("share", "body", m.Share); err != nil { - return err - } - - if m.Share != nil { - if err := m.Share.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -// ContextValidate validate this nfs storage spec based on the context it is used -func (m *NfsStorageSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositorySpec - if err := m.RepositorySpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShare(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NfsStorageSpec) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *NfsStorageSpec) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *NfsStorageSpec) contextValidateShare(ctx context.Context, formats strfmt.Registry) error { - - if m.Share != nil { - if err := m.Share.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NfsStorageSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NfsStorageSpec) UnmarshalBinary(b []byte) error { - var res NfsStorageSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/notification_settings_model.go b/models/notification_settings_model.go deleted file mode 100644 index ce5dcce..0000000 --- a/models/notification_settings_model.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NotificationSettingsModel Notification settings for the backup job. -// -// swagger:model NotificationSettingsModel -type NotificationSettingsModel struct { - - // email notifications - EmailNotifications *EmailNotificationSettingsModel `json:"emailNotifications,omitempty"` - - // If *true*, SNMP notifications are enabled for this job. - SendSNMPNotifications bool `json:"sendSNMPNotifications,omitempty"` - - // vm attribute - VMAttribute *NotificationVMAttributeSettingsModel `json:"vmAttribute,omitempty"` -} - -// Validate validates this notification settings model -func (m *NotificationSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEmailNotifications(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVMAttribute(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NotificationSettingsModel) validateEmailNotifications(formats strfmt.Registry) error { - if swag.IsZero(m.EmailNotifications) { // not required - return nil - } - - if m.EmailNotifications != nil { - if err := m.EmailNotifications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("emailNotifications") - } - return err - } - } - - return nil -} - -func (m *NotificationSettingsModel) validateVMAttribute(formats strfmt.Registry) error { - if swag.IsZero(m.VMAttribute) { // not required - return nil - } - - if m.VMAttribute != nil { - if err := m.VMAttribute.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmAttribute") - } - return err - } - } - - return nil -} - -// ContextValidate validate this notification settings model based on the context it is used -func (m *NotificationSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEmailNotifications(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVMAttribute(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NotificationSettingsModel) contextValidateEmailNotifications(ctx context.Context, formats strfmt.Registry) error { - - if m.EmailNotifications != nil { - if err := m.EmailNotifications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("emailNotifications") - } - return err - } - } - - return nil -} - -func (m *NotificationSettingsModel) contextValidateVMAttribute(ctx context.Context, formats strfmt.Registry) error { - - if m.VMAttribute != nil { - if err := m.VMAttribute.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmAttribute") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NotificationSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NotificationSettingsModel) UnmarshalBinary(b []byte) error { - var res NotificationSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/notification_vm_attribute_settings_model.go b/models/notification_vm_attribute_settings_model.go deleted file mode 100644 index 8602011..0000000 --- a/models/notification_vm_attribute_settings_model.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NotificationVMAttributeSettingsModel VM attribute settings. -// -// swagger:model NotificationVmAttributeSettingsModel -type NotificationVMAttributeSettingsModel struct { - - // If *true*, information about successfully performed backup is appended to the existing value of the attribute added by the user. - AppendToExisitingValue bool `json:"appendToExisitingValue,omitempty"` - - // If *true*, information about successfully performed backup is written to a VM attribute. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // Name of the VM attribute. - Notes string `json:"notes,omitempty"` -} - -// Validate validates this notification Vm attribute settings model -func (m *NotificationVMAttributeSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NotificationVMAttributeSettingsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this notification Vm attribute settings model based on context it is used -func (m *NotificationVMAttributeSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NotificationVMAttributeSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NotificationVMAttributeSettingsModel) UnmarshalBinary(b []byte) error { - var res NotificationVMAttributeSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/object_restore_point_disk_model.go b/models/object_restore_point_disk_model.go deleted file mode 100644 index 15eabf8..0000000 --- a/models/object_restore_point_disk_model.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ObjectRestorePointDiskModel object restore point disk model -// -// swagger:model ObjectRestorePointDiskModel -type ObjectRestorePointDiskModel struct { - - // Capacity of the disk. - // Required: true - Capacity *int64 `json:"capacity"` - - // Name of the disk. - // Required: true - Name *string `json:"name"` - - // state - // Required: true - State *EDiskInfoProcessState `json:"state"` - - // type - // Required: true - Type *EDiskInfoType `json:"type"` - - // ID of the disk. - // Required: true - UID *string `json:"uid"` -} - -// Validate validates this object restore point disk model -func (m *ObjectRestorePointDiskModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapacity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointDiskModel) validateCapacity(formats strfmt.Registry) error { - - if err := validate.Required("capacity", "body", m.Capacity); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointDiskModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointDiskModel) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if m.State != nil { - if err := m.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -func (m *ObjectRestorePointDiskModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *ObjectRestorePointDiskModel) validateUID(formats strfmt.Registry) error { - - if err := validate.Required("uid", "body", m.UID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this object restore point disk model based on the context it is used -func (m *ObjectRestorePointDiskModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointDiskModel) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if m.State != nil { - if err := m.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -func (m *ObjectRestorePointDiskModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ObjectRestorePointDiskModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ObjectRestorePointDiskModel) UnmarshalBinary(b []byte) error { - var res ObjectRestorePointDiskModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/object_restore_point_disks_result.go b/models/object_restore_point_disks_result.go deleted file mode 100644 index b4a2171..0000000 --- a/models/object_restore_point_disks_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ObjectRestorePointDisksResult object restore point disks result -// -// swagger:model ObjectRestorePointDisksResult -type ObjectRestorePointDisksResult struct { - - // Array of disks. - // Required: true - Data []*ObjectRestorePointDiskModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this object restore point disks result -func (m *ObjectRestorePointDisksResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointDisksResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ObjectRestorePointDisksResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this object restore point disks result based on the context it is used -func (m *ObjectRestorePointDisksResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointDisksResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ObjectRestorePointDisksResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ObjectRestorePointDisksResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ObjectRestorePointDisksResult) UnmarshalBinary(b []byte) error { - var res ObjectRestorePointDisksResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/object_restore_point_model.go b/models/object_restore_point_model.go deleted file mode 100644 index f3100d3..0000000 --- a/models/object_restore_point_model.go +++ /dev/null @@ -1,261 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ObjectRestorePointModel object restore point model -// -// swagger:model ObjectRestorePointModel -type ObjectRestorePointModel struct { - - // Array of operations allowed for the restore point. - // Required: true - AllowedOperations []EObjectRestorePointOperation `json:"allowedOperations"` - - // ID of a backup that contains the restore point. - // Required: true - // Format: uuid - BackupID *strfmt.UUID `json:"backupId"` - - // Date and time when the restore point was created. - // Required: true - // Format: date-time - CreationTime *strfmt.DateTime `json:"creationTime"` - - // id - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // name - // Required: true - Name *string `json:"name"` - - // ID of a platform on which the object was created. - // Required: true - // Format: uuid - PlatformID *strfmt.UUID `json:"platformId"` - - // platform name - // Required: true - PlatformName *EPlatformType `json:"platformName"` -} - -// Validate validates this object restore point model -func (m *ObjectRestorePointModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAllowedOperations(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointModel) validateAllowedOperations(formats strfmt.Registry) error { - - if err := validate.Required("allowedOperations", "body", m.AllowedOperations); err != nil { - return err - } - - for i := 0; i < len(m.AllowedOperations); i++ { - - if err := m.AllowedOperations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("allowedOperations" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *ObjectRestorePointModel) validateBackupID(formats strfmt.Registry) error { - - if err := validate.Required("backupId", "body", m.BackupID); err != nil { - return err - } - - if err := validate.FormatOf("backupId", "body", "uuid", m.BackupID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointModel) validateCreationTime(formats strfmt.Registry) error { - - if err := validate.Required("creationTime", "body", m.CreationTime); err != nil { - return err - } - - if err := validate.FormatOf("creationTime", "body", "date-time", m.CreationTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointModel) validatePlatformID(formats strfmt.Registry) error { - - if err := validate.Required("platformId", "body", m.PlatformID); err != nil { - return err - } - - if err := validate.FormatOf("platformId", "body", "uuid", m.PlatformID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointModel) validatePlatformName(formats strfmt.Registry) error { - - if err := validate.Required("platformName", "body", m.PlatformName); err != nil { - return err - } - - if err := validate.Required("platformName", "body", m.PlatformName); err != nil { - return err - } - - if m.PlatformName != nil { - if err := m.PlatformName.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformName") - } - return err - } - } - - return nil -} - -// ContextValidate validate this object restore point model based on the context it is used -func (m *ObjectRestorePointModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAllowedOperations(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePlatformName(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointModel) contextValidateAllowedOperations(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.AllowedOperations); i++ { - - if err := m.AllowedOperations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("allowedOperations" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *ObjectRestorePointModel) contextValidatePlatformName(ctx context.Context, formats strfmt.Registry) error { - - if m.PlatformName != nil { - if err := m.PlatformName.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformName") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ObjectRestorePointModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ObjectRestorePointModel) UnmarshalBinary(b []byte) error { - var res ObjectRestorePointModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/object_restore_points_filters.go b/models/object_restore_points_filters.go deleted file mode 100644 index fd32d87..0000000 --- a/models/object_restore_points_filters.go +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ObjectRestorePointsFilters object restore points filters -// -// swagger:model ObjectRestorePointsFilters -type ObjectRestorePointsFilters struct { - - // backup Id filter - // Format: uuid - BackupIDFilter strfmt.UUID `json:"backupIdFilter,omitempty"` - - // backup object Id filter - // Format: uuid - BackupObjectIDFilter strfmt.UUID `json:"backupObjectIdFilter,omitempty"` - - // created after filter - // Format: date-time - CreatedAfterFilter strfmt.DateTime `json:"createdAfterFilter,omitempty"` - - // created before filter - // Format: date-time - CreatedBeforeFilter strfmt.DateTime `json:"createdBeforeFilter,omitempty"` - - // limit - Limit int32 `json:"limit,omitempty"` - - // name filter - NameFilter string `json:"nameFilter,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EObjectRestorePointsFiltersOrderColumn `json:"orderColumn,omitempty"` - - // platform Id filter - // Format: uuid - PlatformIDFilter strfmt.UUID `json:"platformIdFilter,omitempty"` - - // platform name filter - PlatformNameFilter EPlatformType `json:"platformNameFilter,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` -} - -// Validate validates this object restore points filters -func (m *ObjectRestorePointsFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackupIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupObjectIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAfterFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedBeforeFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlatformNameFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointsFilters) validateBackupIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.BackupIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("backupIdFilter", "body", "uuid", m.BackupIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointsFilters) validateBackupObjectIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.BackupObjectIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("backupObjectIdFilter", "body", "uuid", m.BackupObjectIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointsFilters) validateCreatedAfterFilter(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAfterFilter) { // not required - return nil - } - - if err := validate.FormatOf("createdAfterFilter", "body", "date-time", m.CreatedAfterFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointsFilters) validateCreatedBeforeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedBeforeFilter) { // not required - return nil - } - - if err := validate.FormatOf("createdBeforeFilter", "body", "date-time", m.CreatedBeforeFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointsFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *ObjectRestorePointsFilters) validatePlatformIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.PlatformIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("platformIdFilter", "body", "uuid", m.PlatformIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ObjectRestorePointsFilters) validatePlatformNameFilter(formats strfmt.Registry) error { - if swag.IsZero(m.PlatformNameFilter) { // not required - return nil - } - - if err := m.PlatformNameFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformNameFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this object restore points filters based on the context it is used -func (m *ObjectRestorePointsFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePlatformNameFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointsFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *ObjectRestorePointsFilters) contextValidatePlatformNameFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PlatformNameFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platformNameFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ObjectRestorePointsFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ObjectRestorePointsFilters) UnmarshalBinary(b []byte) error { - var res ObjectRestorePointsFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/object_restore_points_result.go b/models/object_restore_points_result.go deleted file mode 100644 index cd7e6d9..0000000 --- a/models/object_restore_points_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ObjectRestorePointsResult object restore points result -// -// swagger:model ObjectRestorePointsResult -type ObjectRestorePointsResult struct { - - // Array of restore points. - // Required: true - Data []*ObjectRestorePointModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this object restore points result -func (m *ObjectRestorePointsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointsResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ObjectRestorePointsResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this object restore points result based on the context it is used -func (m *ObjectRestorePointsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ObjectRestorePointsResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ObjectRestorePointsResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ObjectRestorePointsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ObjectRestorePointsResult) UnmarshalBinary(b []byte) error { - var res ObjectRestorePointsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/pagination_result.go b/models/pagination_result.go deleted file mode 100644 index d4d20e8..0000000 --- a/models/pagination_result.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaginationResult Pagination settings. -// -// swagger:model PaginationResult -type PaginationResult struct { - - // Number of returned results. - // Required: true - Count *int32 `json:"count"` - - // Maximum number of results to return. - Limit int32 `json:"limit,omitempty"` - - // Number of skipped results. - Skip int32 `json:"skip,omitempty"` - - // Total number of results. - // Required: true - Total *int32 `json:"total"` -} - -// Validate validates this pagination result -func (m *PaginationResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotal(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaginationResult) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *PaginationResult) validateTotal(formats strfmt.Registry) error { - - if err := validate.Required("total", "body", m.Total); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this pagination result based on context it is used -func (m *PaginationResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PaginationResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaginationResult) UnmarshalBinary(b []byte) error { - var res PaginationResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/performance_extent_model.go b/models/performance_extent_model.go deleted file mode 100644 index cda8f32..0000000 --- a/models/performance_extent_model.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PerformanceExtentModel performance extent model -// -// swagger:model PerformanceExtentModel -type PerformanceExtentModel struct { - - // ID of the backup repository added as a performance extent. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name of the backup repository added as a performance extent. - // Required: true - Name *string `json:"name"` - - // status - // Required: true - Status *ERepositoryExtentStatusType `json:"status"` -} - -// Validate validates this performance extent model -func (m *PerformanceExtentModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PerformanceExtentModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PerformanceExtentModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *PerformanceExtentModel) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -// ContextValidate validate this performance extent model based on the context it is used -func (m *PerformanceExtentModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PerformanceExtentModel) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PerformanceExtentModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PerformanceExtentModel) UnmarshalBinary(b []byte) error { - var res PerformanceExtentModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/performance_tier_advanced_settings_model.go b/models/performance_tier_advanced_settings_model.go deleted file mode 100644 index 8b252d0..0000000 --- a/models/performance_tier_advanced_settings_model.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PerformanceTierAdvancedSettingsModel Advanced settings of the performance tier. -// -// swagger:model PerformanceTierAdvancedSettingsModel -type PerformanceTierAdvancedSettingsModel struct { - - // If *true*, Veeam Backup & Replication creates a full backup file instead of an incremental backup file in case the required extent is offline. - FullWhenExtentOffline bool `json:"fullWhenExtentOffline,omitempty"` - - // If *true*, Veeam Backup & Replication creates a separate backup file for every VM in the job. - PerVMBackup bool `json:"perVmBackup,omitempty"` -} - -// Validate validates this performance tier advanced settings model -func (m *PerformanceTierAdvancedSettingsModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this performance tier advanced settings model based on context it is used -func (m *PerformanceTierAdvancedSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PerformanceTierAdvancedSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PerformanceTierAdvancedSettingsModel) UnmarshalBinary(b []byte) error { - var res PerformanceTierAdvancedSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/performance_tier_model.go b/models/performance_tier_model.go deleted file mode 100644 index 5b31caf..0000000 --- a/models/performance_tier_model.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PerformanceTierModel Performance tier. -// -// swagger:model PerformanceTierModel -type PerformanceTierModel struct { - - // advanced settings - AdvancedSettings *PerformanceTierAdvancedSettingsModel `json:"advancedSettings,omitempty"` - - // Array of performance extents. - PerformanceExtents []*PerformanceExtentModel `json:"performanceExtents"` -} - -// Validate validates this performance tier model -func (m *PerformanceTierModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdvancedSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePerformanceExtents(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PerformanceTierModel) validateAdvancedSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AdvancedSettings) { // not required - return nil - } - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -func (m *PerformanceTierModel) validatePerformanceExtents(formats strfmt.Registry) error { - if swag.IsZero(m.PerformanceExtents) { // not required - return nil - } - - for i := 0; i < len(m.PerformanceExtents); i++ { - if swag.IsZero(m.PerformanceExtents[i]) { // not required - continue - } - - if m.PerformanceExtents[i] != nil { - if err := m.PerformanceExtents[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("performanceExtents" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this performance tier model based on the context it is used -func (m *PerformanceTierModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvancedSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePerformanceExtents(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PerformanceTierModel) contextValidateAdvancedSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -func (m *PerformanceTierModel) contextValidatePerformanceExtents(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PerformanceExtents); i++ { - - if m.PerformanceExtents[i] != nil { - if err := m.PerformanceExtents[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("performanceExtents" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PerformanceTierModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PerformanceTierModel) UnmarshalBinary(b []byte) error { - var res PerformanceTierModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/placement_policy_model.go b/models/placement_policy_model.go deleted file mode 100644 index 3b01023..0000000 --- a/models/placement_policy_model.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PlacementPolicyModel Backup file placement policy. -// -// swagger:model PlacementPolicyModel -type PlacementPolicyModel struct { - - // settings - // Required: true - Settings []*BackupPlacementSettingsModel `json:"settings"` - - // type - // Required: true - Type *EPlacementPolicyType `json:"type"` -} - -// Validate validates this placement policy model -func (m *PlacementPolicyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PlacementPolicyModel) validateSettings(formats strfmt.Registry) error { - - if err := validate.Required("settings", "body", m.Settings); err != nil { - return err - } - - for i := 0; i < len(m.Settings); i++ { - if swag.IsZero(m.Settings[i]) { // not required - continue - } - - if m.Settings[i] != nil { - if err := m.Settings[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("settings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PlacementPolicyModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this placement policy model based on the context it is used -func (m *PlacementPolicyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PlacementPolicyModel) contextValidateSettings(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Settings); i++ { - - if m.Settings[i] != nil { - if err := m.Settings[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("settings" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PlacementPolicyModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PlacementPolicyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PlacementPolicyModel) UnmarshalBinary(b []byte) error { - var res PlacementPolicyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/preferred_network_model.go b/models/preferred_network_model.go deleted file mode 100644 index 66f0426..0000000 --- a/models/preferred_network_model.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PreferredNetworkModel preferred network model -// -// swagger:model PreferredNetworkModel -type PreferredNetworkModel struct { - - // CIDR notation. - CidrNotation string `json:"cidrNotation,omitempty"` - - // IP address. - IPAddress string `json:"ipAddress,omitempty"` - - // Subnet mask. - SubnetMask string `json:"subnetMask,omitempty"` -} - -// Validate validates this preferred network model -func (m *PreferredNetworkModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this preferred network model based on context it is used -func (m *PreferredNetworkModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PreferredNetworkModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PreferredNetworkModel) UnmarshalBinary(b []byte) error { - var res PreferredNetworkModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/preferred_networks_model.go b/models/preferred_networks_model.go deleted file mode 100644 index 9332191..0000000 --- a/models/preferred_networks_model.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PreferredNetworksModel Preferred networks used for backup and replication traffic. -// -// swagger:model PreferredNetworksModel -type PreferredNetworksModel struct { - - // If *true*, prefered networks are enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // Array of networks. - Networks []*PreferredNetworkModel `json:"networks"` -} - -// Validate validates this preferred networks model -func (m *PreferredNetworksModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PreferredNetworksModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -func (m *PreferredNetworksModel) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required - return nil - } - - for i := 0; i < len(m.Networks); i++ { - if swag.IsZero(m.Networks[i]) { // not required - continue - } - - if m.Networks[i] != nil { - if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this preferred networks model based on the context it is used -func (m *PreferredNetworksModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNetworks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PreferredNetworksModel) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Networks); i++ { - - if m.Networks[i] != nil { - if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PreferredNetworksModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PreferredNetworksModel) UnmarshalBinary(b []byte) error { - var res PreferredNetworksModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/primary_storage_integration_settings_model.go b/models/primary_storage_integration_settings_model.go deleted file mode 100644 index 4835165..0000000 --- a/models/primary_storage_integration_settings_model.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PrimaryStorageIntegrationSettingsModel Primary storage integration settings for the backup job. -// -// swagger:model PrimaryStorageIntegrationSettingsModel -type PrimaryStorageIntegrationSettingsModel struct { - - // If *true*, failover to the regular VM processing mode is enabled. In this case, if backup from storage snapshot fails, VM snapshots are used. - FailoverToStandardBackup bool `json:"failoverToStandardBackup,omitempty"` - - // If *true*, the primary storage integration is enabled. In this case, storage snapshots (instead of VM snapshots) are used for VM data processing. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // If *true*, the number of processed VMs per storage snapshot is limited. - LimitProcessedVM bool `json:"limitProcessedVm,omitempty"` - - // Number of processed VMs per storage snapshot. - LimitProcessedVMCount int64 `json:"limitProcessedVmCount,omitempty"` -} - -// Validate validates this primary storage integration settings model -func (m *PrimaryStorageIntegrationSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PrimaryStorageIntegrationSettingsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this primary storage integration settings model based on context it is used -func (m *PrimaryStorageIntegrationSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PrimaryStorageIntegrationSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PrimaryStorageIntegrationSettingsModel) UnmarshalBinary(b []byte) error { - var res PrimaryStorageIntegrationSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/private_key_change_spec.go b/models/private_key_change_spec.go deleted file mode 100644 index 17e6011..0000000 --- a/models/private_key_change_spec.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PrivateKeyChangeSpec private key change spec -// -// swagger:model PrivateKeyChangeSpec -type PrivateKeyChangeSpec struct { - - // Passphrase that protects the private key. - Passphrase string `json:"passphrase,omitempty"` - - // Private key. - // Required: true - PrivateKey *string `json:"privateKey"` -} - -// Validate validates this private key change spec -func (m *PrivateKeyChangeSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePrivateKey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PrivateKeyChangeSpec) validatePrivateKey(formats strfmt.Registry) error { - - if err := validate.Required("privateKey", "body", m.PrivateKey); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this private key change spec based on context it is used -func (m *PrivateKeyChangeSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PrivateKeyChangeSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PrivateKeyChangeSpec) UnmarshalBinary(b []byte) error { - var res PrivateKeyChangeSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxies_filters.go b/models/proxies_filters.go deleted file mode 100644 index df76790..0000000 --- a/models/proxies_filters.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxiesFilters proxies filters -// -// swagger:model ProxiesFilters -type ProxiesFilters struct { - - // host Id filter - // Format: uuid - HostIDFilter strfmt.UUID `json:"hostIdFilter,omitempty"` - - // limit - Limit int32 `json:"limit,omitempty"` - - // name filter - NameFilter string `json:"nameFilter,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EProxiesFiltersOrderColumn `json:"orderColumn,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` - - // type filter - TypeFilter EProxyType `json:"typeFilter,omitempty"` -} - -// Validate validates this proxies filters -func (m *ProxiesFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHostIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxiesFilters) validateHostIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.HostIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("hostIdFilter", "body", "uuid", m.HostIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProxiesFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *ProxiesFilters) validateTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TypeFilter) { // not required - return nil - } - - if err := m.TypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this proxies filters based on the context it is used -func (m *ProxiesFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxiesFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *ProxiesFilters) contextValidateTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxiesFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxiesFilters) UnmarshalBinary(b []byte) error { - var res ProxiesFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxies_result.go b/models/proxies_result.go deleted file mode 100644 index 4ed9a3e..0000000 --- a/models/proxies_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxiesResult proxies result -// -// swagger:model ProxiesResult -type ProxiesResult struct { - - // Array of backup proxies. - // Required: true - Data []*ProxyModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this proxies result -func (m *ProxiesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxiesResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ProxiesResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this proxies result based on the context it is used -func (m *ProxiesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxiesResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ProxiesResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxiesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxiesResult) UnmarshalBinary(b []byte) error { - var res ProxiesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_datastore_model.go b/models/proxy_datastore_model.go deleted file mode 100644 index 3fa6c12..0000000 --- a/models/proxy_datastore_model.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProxyDatastoreModel proxy datastore model -// -// swagger:model ProxyDatastoreModel -type ProxyDatastoreModel struct { - - // datastore - Datastore *VmwareObjectModel `json:"datastore,omitempty"` - - // Number of VMs. - VMCount int64 `json:"vmCount,omitempty"` -} - -// Validate validates this proxy datastore model -func (m *ProxyDatastoreModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDatastore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyDatastoreModel) validateDatastore(formats strfmt.Registry) error { - if swag.IsZero(m.Datastore) { // not required - return nil - } - - if m.Datastore != nil { - if err := m.Datastore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datastore") - } - return err - } - } - - return nil -} - -// ContextValidate validate this proxy datastore model based on the context it is used -func (m *ProxyDatastoreModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDatastore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyDatastoreModel) contextValidateDatastore(ctx context.Context, formats strfmt.Registry) error { - - if m.Datastore != nil { - if err := m.Datastore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datastore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxyDatastoreModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxyDatastoreModel) UnmarshalBinary(b []byte) error { - var res ProxyDatastoreModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_datastore_settings_model.go b/models/proxy_datastore_settings_model.go deleted file mode 100644 index 7fb5187..0000000 --- a/models/proxy_datastore_settings_model.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxyDatastoreSettingsModel Datastores to which the backup proxy has a direct SAN or NFS connection. -// -// swagger:model ProxyDatastoreSettingsModel -type ProxyDatastoreSettingsModel struct { - - // If *true*, all datastores that the backup proxy can access are detected automatically. - // Required: true - AutoSelect *bool `json:"autoSelect"` - - // Array of datastores to which the backup proxy has a direct SAN or NFS connection. - Datastores []*ProxyDatastoreModel `json:"datastores"` -} - -// Validate validates this proxy datastore settings model -func (m *ProxyDatastoreSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAutoSelect(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDatastores(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyDatastoreSettingsModel) validateAutoSelect(formats strfmt.Registry) error { - - if err := validate.Required("autoSelect", "body", m.AutoSelect); err != nil { - return err - } - - return nil -} - -func (m *ProxyDatastoreSettingsModel) validateDatastores(formats strfmt.Registry) error { - if swag.IsZero(m.Datastores) { // not required - return nil - } - - for i := 0; i < len(m.Datastores); i++ { - if swag.IsZero(m.Datastores[i]) { // not required - continue - } - - if m.Datastores[i] != nil { - if err := m.Datastores[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datastores" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this proxy datastore settings model based on the context it is used -func (m *ProxyDatastoreSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDatastores(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyDatastoreSettingsModel) contextValidateDatastores(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Datastores); i++ { - - if m.Datastores[i] != nil { - if err := m.Datastores[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datastores" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxyDatastoreSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxyDatastoreSettingsModel) UnmarshalBinary(b []byte) error { - var res ProxyDatastoreSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_export_spec.go b/models/proxy_export_spec.go deleted file mode 100644 index 338f239..0000000 --- a/models/proxy_export_spec.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxyExportSpec proxy export spec -// -// swagger:model ProxyExportSpec -type ProxyExportSpec struct { - - // Array of backup proxy IDs. - // Unique: true - Ids []strfmt.UUID `json:"ids"` - - // Array of backup proxy names. Wildcard characters are supported. - // Unique: true - Names []string `json:"names"` - - // Array of backup proxy types. - // Unique: true - Types []EProxyType `json:"types"` -} - -// Validate validates this proxy export spec -func (m *ProxyExportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNames(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyExportSpec) validateIds(formats strfmt.Registry) error { - if swag.IsZero(m.Ids) { // not required - return nil - } - - if err := validate.UniqueItems("ids", "body", m.Ids); err != nil { - return err - } - - for i := 0; i < len(m.Ids); i++ { - - if err := validate.FormatOf("ids"+"."+strconv.Itoa(i), "body", "uuid", m.Ids[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -func (m *ProxyExportSpec) validateNames(formats strfmt.Registry) error { - if swag.IsZero(m.Names) { // not required - return nil - } - - if err := validate.UniqueItems("names", "body", m.Names); err != nil { - return err - } - - return nil -} - -func (m *ProxyExportSpec) validateTypes(formats strfmt.Registry) error { - if swag.IsZero(m.Types) { // not required - return nil - } - - if err := validate.UniqueItems("types", "body", m.Types); err != nil { - return err - } - - for i := 0; i < len(m.Types); i++ { - - if err := m.Types[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("types" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this proxy export spec based on the context it is used -func (m *ProxyExportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyExportSpec) contextValidateTypes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Types); i++ { - - if err := m.Types[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("types" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxyExportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxyExportSpec) UnmarshalBinary(b []byte) error { - var res ProxyExportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_import_spec.go b/models/proxy_import_spec.go deleted file mode 100644 index ea0b8cc..0000000 --- a/models/proxy_import_spec.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxyImportSpec proxy import spec -// -// swagger:model ProxyImportSpec -type ProxyImportSpec struct { - - // Description of the backup proxy. - // Required: true - Description *string `json:"description"` - - // server - // Required: true - Server *ProxyServerSettingsImportSpec `json:"server"` - - // type - // Required: true - Type *EProxyType `json:"type"` -} - -// Validate validates this proxy import spec -func (m *ProxyImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ProxyImportSpec) validateServer(formats strfmt.Registry) error { - - if err := validate.Required("server", "body", m.Server); err != nil { - return err - } - - if m.Server != nil { - if err := m.Server.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("server") - } - return err - } - } - - return nil -} - -func (m *ProxyImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this proxy import spec based on the context it is used -func (m *ProxyImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyImportSpec) contextValidateServer(ctx context.Context, formats strfmt.Registry) error { - - if m.Server != nil { - if err := m.Server.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("server") - } - return err - } - } - - return nil -} - -func (m *ProxyImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxyImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxyImportSpec) UnmarshalBinary(b []byte) error { - var res ProxyImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_import_spec_collection.go b/models/proxy_import_spec_collection.go deleted file mode 100644 index e1b5e76..0000000 --- a/models/proxy_import_spec_collection.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxyImportSpecCollection proxy import spec collection -// -// swagger:model ProxyImportSpecCollection -type ProxyImportSpecCollection struct { - - // Array of backup proxies. - // Required: true - // Unique: true - Proxies []*ProxyImportSpec `json:"proxies"` -} - -// Validate validates this proxy import spec collection -func (m *ProxyImportSpecCollection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateProxies(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyImportSpecCollection) validateProxies(formats strfmt.Registry) error { - - if err := validate.Required("proxies", "body", m.Proxies); err != nil { - return err - } - - if err := validate.UniqueItems("proxies", "body", m.Proxies); err != nil { - return err - } - - for i := 0; i < len(m.Proxies); i++ { - if swag.IsZero(m.Proxies[i]) { // not required - continue - } - - if m.Proxies[i] != nil { - if err := m.Proxies[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proxies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this proxy import spec collection based on the context it is used -func (m *ProxyImportSpecCollection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateProxies(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyImportSpecCollection) contextValidateProxies(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Proxies); i++ { - - if m.Proxies[i] != nil { - if err := m.Proxies[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proxies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxyImportSpecCollection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxyImportSpecCollection) UnmarshalBinary(b []byte) error { - var res ProxyImportSpecCollection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_model.go b/models/proxy_model.go deleted file mode 100644 index cce50be..0000000 --- a/models/proxy_model.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxyModel proxy model -// -// swagger:model ProxyModel -type ProxyModel struct { - - // Description of the backup proxy. - // Required: true - Description *string `json:"description"` - - // ID of the backup proxy. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name of the backup proxy. - // Required: true - Name *string `json:"name"` - - // type - // Required: true - Type *EProxyType `json:"type"` -} - -// Validate validates this proxy model -func (m *ProxyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyModel) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ProxyModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProxyModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ProxyModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this proxy model based on the context it is used -func (m *ProxyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxyModel) UnmarshalBinary(b []byte) error { - var res ProxyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_server_settings_import_spec.go b/models/proxy_server_settings_import_spec.go deleted file mode 100644 index dce003d..0000000 --- a/models/proxy_server_settings_import_spec.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxyServerSettingsImportSpec Settings of the server that is used as a backup proxy. -// -// swagger:model ProxyServerSettingsImportSpec -type ProxyServerSettingsImportSpec struct { - - // connected datastores - ConnectedDatastores *ProxyDatastoreSettingsModel `json:"connectedDatastores,omitempty"` - - // failover to network - FailoverToNetwork bool `json:"failoverToNetwork,omitempty"` - - // Name of the server. - // Required: true - HostName *string `json:"hostName"` - - // Tag assigned to the server. - HostTag string `json:"hostTag,omitempty"` - - // [For the Network mode] If *true*, VM data is transferred over an encrypted TLS connection. - // - HostToProxyEncryption bool `json:"hostToProxyEncryption,omitempty"` - - // Maximum number of concurrent tasks. - MaxTaskCount int64 `json:"maxTaskCount,omitempty"` - - // transport mode - TransportMode EBackupProxyTransportMode `json:"transportMode,omitempty"` -} - -// Validate validates this proxy server settings import spec -func (m *ProxyServerSettingsImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConnectedDatastores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportMode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyServerSettingsImportSpec) validateConnectedDatastores(formats strfmt.Registry) error { - if swag.IsZero(m.ConnectedDatastores) { // not required - return nil - } - - if m.ConnectedDatastores != nil { - if err := m.ConnectedDatastores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("connectedDatastores") - } - return err - } - } - - return nil -} - -func (m *ProxyServerSettingsImportSpec) validateHostName(formats strfmt.Registry) error { - - if err := validate.Required("hostName", "body", m.HostName); err != nil { - return err - } - - return nil -} - -func (m *ProxyServerSettingsImportSpec) validateTransportMode(formats strfmt.Registry) error { - if swag.IsZero(m.TransportMode) { // not required - return nil - } - - if err := m.TransportMode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportMode") - } - return err - } - - return nil -} - -// ContextValidate validate this proxy server settings import spec based on the context it is used -func (m *ProxyServerSettingsImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConnectedDatastores(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportMode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyServerSettingsImportSpec) contextValidateConnectedDatastores(ctx context.Context, formats strfmt.Registry) error { - - if m.ConnectedDatastores != nil { - if err := m.ConnectedDatastores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("connectedDatastores") - } - return err - } - } - - return nil -} - -func (m *ProxyServerSettingsImportSpec) contextValidateTransportMode(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TransportMode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportMode") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxyServerSettingsImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxyServerSettingsImportSpec) UnmarshalBinary(b []byte) error { - var res ProxyServerSettingsImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_server_settings_model.go b/models/proxy_server_settings_model.go deleted file mode 100644 index 986458d..0000000 --- a/models/proxy_server_settings_model.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxyServerSettingsModel Server settings for the backup proxy. -// -// swagger:model ProxyServerSettingsModel -type ProxyServerSettingsModel struct { - - // connected datastores - ConnectedDatastores *ProxyDatastoreSettingsModel `json:"connectedDatastores,omitempty"` - - // [For the Direct storage access and Virtual appliance transport modes] If *true*, Veeam Backup & Replication failovers to the network transport mode in case the primary mode fails or is unavailable. - // - FailoverToNetwork bool `json:"failoverToNetwork,omitempty"` - - // ID of the server. - // Required: true - // Format: uuid - HostID *strfmt.UUID `json:"hostId"` - - // [For the Network mode] If *true*, VM data is transferred over an encrypted TLS connection. - // - HostToProxyEncryption bool `json:"hostToProxyEncryption,omitempty"` - - // Maximum number of concurrent tasks. - MaxTaskCount int64 `json:"maxTaskCount,omitempty"` - - // transport mode - TransportMode EBackupProxyTransportMode `json:"transportMode,omitempty"` -} - -// Validate validates this proxy server settings model -func (m *ProxyServerSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConnectedDatastores(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportMode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyServerSettingsModel) validateConnectedDatastores(formats strfmt.Registry) error { - if swag.IsZero(m.ConnectedDatastores) { // not required - return nil - } - - if m.ConnectedDatastores != nil { - if err := m.ConnectedDatastores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("connectedDatastores") - } - return err - } - } - - return nil -} - -func (m *ProxyServerSettingsModel) validateHostID(formats strfmt.Registry) error { - - if err := validate.Required("hostId", "body", m.HostID); err != nil { - return err - } - - if err := validate.FormatOf("hostId", "body", "uuid", m.HostID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProxyServerSettingsModel) validateTransportMode(formats strfmt.Registry) error { - if swag.IsZero(m.TransportMode) { // not required - return nil - } - - if err := m.TransportMode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportMode") - } - return err - } - - return nil -} - -// ContextValidate validate this proxy server settings model based on the context it is used -func (m *ProxyServerSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConnectedDatastores(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportMode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxyServerSettingsModel) contextValidateConnectedDatastores(ctx context.Context, formats strfmt.Registry) error { - - if m.ConnectedDatastores != nil { - if err := m.ConnectedDatastores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("connectedDatastores") - } - return err - } - } - - return nil -} - -func (m *ProxyServerSettingsModel) contextValidateTransportMode(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TransportMode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportMode") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxyServerSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxyServerSettingsModel) UnmarshalBinary(b []byte) error { - var res ProxyServerSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/proxy_spec.go b/models/proxy_spec.go deleted file mode 100644 index 3376c13..0000000 --- a/models/proxy_spec.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProxySpec proxy spec -// -// swagger:model ProxySpec -type ProxySpec struct { - - // Description of the backup proxy. - // Required: true - Description *string `json:"description"` - - // type - // Required: true - Type *EProxyType `json:"type"` -} - -// Validate validates this proxy spec -func (m *ProxySpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxySpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ProxySpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this proxy spec based on the context it is used -func (m *ProxySpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProxySpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProxySpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProxySpec) UnmarshalBinary(b []byte) error { - var res ProxySpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repositories_filters.go b/models/repositories_filters.go deleted file mode 100644 index d696af4..0000000 --- a/models/repositories_filters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoriesFilters repositories filters -// -// swagger:model RepositoriesFilters -type RepositoriesFilters struct { - - // host Id filter - // Format: uuid - HostIDFilter strfmt.UUID `json:"hostIdFilter,omitempty"` - - // limit - Limit int32 `json:"limit,omitempty"` - - // name filter - NameFilter string `json:"nameFilter,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn ERepositoryFiltersOrderColumn `json:"orderColumn,omitempty"` - - // path filter - PathFilter string `json:"pathFilter,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` - - // type filter - TypeFilter ERepositoryType `json:"typeFilter,omitempty"` - - // VmbApiFilterModel as json serialized in base64 format (see VmbApiFilterModel) - VmbAPIFilter string `json:"vmbApiFilter,omitempty"` -} - -// Validate validates this repositories filters -func (m *RepositoriesFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHostIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoriesFilters) validateHostIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.HostIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("hostIdFilter", "body", "uuid", m.HostIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RepositoriesFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *RepositoriesFilters) validateTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TypeFilter) { // not required - return nil - } - - if err := m.TypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this repositories filters based on the context it is used -func (m *RepositoriesFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoriesFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *RepositoriesFilters) contextValidateTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoriesFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoriesFilters) UnmarshalBinary(b []byte) error { - var res RepositoriesFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repositories_result.go b/models/repositories_result.go deleted file mode 100644 index defe353..0000000 --- a/models/repositories_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoriesResult repositories result -// -// swagger:model RepositoriesResult -type RepositoriesResult struct { - - // Array of backup repositories. - // Required: true - Data []*RepositoryModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this repositories result -func (m *RepositoriesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoriesResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoriesResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this repositories result based on the context it is used -func (m *RepositoriesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoriesResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoriesResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoriesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoriesResult) UnmarshalBinary(b []byte) error { - var res RepositoriesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_advanced_settings_model.go b/models/repository_advanced_settings_model.go deleted file mode 100644 index 67b4a69..0000000 --- a/models/repository_advanced_settings_model.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RepositoryAdvancedSettingsModel Advanced settings for the backup repository. -// -// swagger:model RepositoryAdvancedSettingsModel -type RepositoryAdvancedSettingsModel struct { - - // If *true*, Veeam Backup & Replication aligns VM data saved to a backup file at a 4 KB block boundary. - AlignDataBlocks bool `json:"alignDataBlocks,omitempty"` - - // If *true*, Veeam Backup & Replication decompresses backup data blocks before storing to improve deduplication ratios. - DecompressBeforeStoring bool `json:"decompressBeforeStoring,omitempty"` - - // If *true*, Veeam Backup & Replication creates a separate backup file for every VM in the job. - PerVMBackup bool `json:"perVmBackup,omitempty"` - - // If *true*, the repository drive is rotated. - RotatedDrives bool `json:"rotatedDrives,omitempty"` -} - -// Validate validates this repository advanced settings model -func (m *RepositoryAdvancedSettingsModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this repository advanced settings model based on context it is used -func (m *RepositoryAdvancedSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryAdvancedSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryAdvancedSettingsModel) UnmarshalBinary(b []byte) error { - var res RepositoryAdvancedSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_export_spec.go b/models/repository_export_spec.go deleted file mode 100644 index 7817630..0000000 --- a/models/repository_export_spec.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoryExportSpec repository export spec -// -// swagger:model RepositoryExportSpec -type RepositoryExportSpec struct { - - // Array of backup repository IDs. - // Unique: true - Ids []strfmt.UUID `json:"ids"` - - // Array of repository names. Wildcard characters are supported. - // Unique: true - Names []string `json:"names"` - - // Array of backup repository types. - // Unique: true - Types []ERepositoryType `json:"types"` -} - -// Validate validates this repository export spec -func (m *RepositoryExportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNames(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryExportSpec) validateIds(formats strfmt.Registry) error { - if swag.IsZero(m.Ids) { // not required - return nil - } - - if err := validate.UniqueItems("ids", "body", m.Ids); err != nil { - return err - } - - for i := 0; i < len(m.Ids); i++ { - - if err := validate.FormatOf("ids"+"."+strconv.Itoa(i), "body", "uuid", m.Ids[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -func (m *RepositoryExportSpec) validateNames(formats strfmt.Registry) error { - if swag.IsZero(m.Names) { // not required - return nil - } - - if err := validate.UniqueItems("names", "body", m.Names); err != nil { - return err - } - - return nil -} - -func (m *RepositoryExportSpec) validateTypes(formats strfmt.Registry) error { - if swag.IsZero(m.Types) { // not required - return nil - } - - if err := validate.UniqueItems("types", "body", m.Types); err != nil { - return err - } - - for i := 0; i < len(m.Types); i++ { - - if err := m.Types[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("types" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this repository export spec based on the context it is used -func (m *RepositoryExportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryExportSpec) contextValidateTypes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Types); i++ { - - if err := m.Types[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("types" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryExportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryExportSpec) UnmarshalBinary(b []byte) error { - var res RepositoryExportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_import_spec_collection.go b/models/repository_import_spec_collection.go deleted file mode 100644 index 3ace393..0000000 --- a/models/repository_import_spec_collection.go +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoryImportSpecCollection repository import spec collection -// -// swagger:model RepositoryImportSpecCollection -type RepositoryImportSpecCollection struct { - - // Array of linux local storages. - // Unique: true - LinuxLocalRepositories []*LinuxLocalStorageImportSpec `json:"LinuxLocalRepositories"` - - // Array of network attached storages. - // Unique: true - NfsRepositories []*NfsStorageImportSpec `json:"NfsRepositories"` - - // Array of network attached storages. - // Unique: true - SmbRepositories []*SmbStorageImportSpec `json:"SmbRepositories"` - - // Array of windows local storages. - // Unique: true - WindowsLocalRepositories []*WindowsLocalStorageImportSpec `json:"WindowsLocalRepositories"` -} - -// Validate validates this repository import spec collection -func (m *RepositoryImportSpecCollection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinuxLocalRepositories(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNfsRepositories(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSmbRepositories(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWindowsLocalRepositories(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryImportSpecCollection) validateLinuxLocalRepositories(formats strfmt.Registry) error { - if swag.IsZero(m.LinuxLocalRepositories) { // not required - return nil - } - - if err := validate.UniqueItems("LinuxLocalRepositories", "body", m.LinuxLocalRepositories); err != nil { - return err - } - - for i := 0; i < len(m.LinuxLocalRepositories); i++ { - if swag.IsZero(m.LinuxLocalRepositories[i]) { // not required - continue - } - - if m.LinuxLocalRepositories[i] != nil { - if err := m.LinuxLocalRepositories[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("LinuxLocalRepositories" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoryImportSpecCollection) validateNfsRepositories(formats strfmt.Registry) error { - if swag.IsZero(m.NfsRepositories) { // not required - return nil - } - - if err := validate.UniqueItems("NfsRepositories", "body", m.NfsRepositories); err != nil { - return err - } - - for i := 0; i < len(m.NfsRepositories); i++ { - if swag.IsZero(m.NfsRepositories[i]) { // not required - continue - } - - if m.NfsRepositories[i] != nil { - if err := m.NfsRepositories[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("NfsRepositories" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoryImportSpecCollection) validateSmbRepositories(formats strfmt.Registry) error { - if swag.IsZero(m.SmbRepositories) { // not required - return nil - } - - if err := validate.UniqueItems("SmbRepositories", "body", m.SmbRepositories); err != nil { - return err - } - - for i := 0; i < len(m.SmbRepositories); i++ { - if swag.IsZero(m.SmbRepositories[i]) { // not required - continue - } - - if m.SmbRepositories[i] != nil { - if err := m.SmbRepositories[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("SmbRepositories" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoryImportSpecCollection) validateWindowsLocalRepositories(formats strfmt.Registry) error { - if swag.IsZero(m.WindowsLocalRepositories) { // not required - return nil - } - - if err := validate.UniqueItems("WindowsLocalRepositories", "body", m.WindowsLocalRepositories); err != nil { - return err - } - - for i := 0; i < len(m.WindowsLocalRepositories); i++ { - if swag.IsZero(m.WindowsLocalRepositories[i]) { // not required - continue - } - - if m.WindowsLocalRepositories[i] != nil { - if err := m.WindowsLocalRepositories[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("WindowsLocalRepositories" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this repository import spec collection based on the context it is used -func (m *RepositoryImportSpecCollection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinuxLocalRepositories(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNfsRepositories(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSmbRepositories(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWindowsLocalRepositories(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryImportSpecCollection) contextValidateLinuxLocalRepositories(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.LinuxLocalRepositories); i++ { - - if m.LinuxLocalRepositories[i] != nil { - if err := m.LinuxLocalRepositories[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("LinuxLocalRepositories" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoryImportSpecCollection) contextValidateNfsRepositories(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.NfsRepositories); i++ { - - if m.NfsRepositories[i] != nil { - if err := m.NfsRepositories[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("NfsRepositories" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoryImportSpecCollection) contextValidateSmbRepositories(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.SmbRepositories); i++ { - - if m.SmbRepositories[i] != nil { - if err := m.SmbRepositories[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("SmbRepositories" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoryImportSpecCollection) contextValidateWindowsLocalRepositories(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.WindowsLocalRepositories); i++ { - - if m.WindowsLocalRepositories[i] != nil { - if err := m.WindowsLocalRepositories[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("WindowsLocalRepositories" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryImportSpecCollection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryImportSpecCollection) UnmarshalBinary(b []byte) error { - var res RepositoryImportSpecCollection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_model.go b/models/repository_model.go deleted file mode 100644 index 844f963..0000000 --- a/models/repository_model.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoryModel repository model -// -// swagger:model RepositoryModel -type RepositoryModel struct { - - // Description of the backup repository. - // Required: true - Description *string `json:"description"` - - // ID of the backup repository. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name of the backup repository. - // Required: true - Name *string `json:"name"` - - // VMware vSphere tag assigned to the backup repository. - Tag string `json:"tag,omitempty"` - - // type - // Required: true - Type *ERepositoryType `json:"type"` -} - -// Validate validates this repository model -func (m *RepositoryModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryModel) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *RepositoryModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RepositoryModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *RepositoryModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this repository model based on the context it is used -func (m *RepositoryModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryModel) UnmarshalBinary(b []byte) error { - var res RepositoryModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_share_gateway_import_spec.go b/models/repository_share_gateway_import_spec.go deleted file mode 100644 index e2ccefc..0000000 --- a/models/repository_share_gateway_import_spec.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RepositoryShareGatewayImportSpec Settings for the gateway server. -// -// swagger:model RepositoryShareGatewayImportSpec -type RepositoryShareGatewayImportSpec struct { - - // If *true*, Veeam Backup & Replication automatically selects a gateway server. - AutoSelect bool `json:"autoSelect,omitempty"` - - // Name of the gateway server. - GatewayServerName string `json:"gatewayServerName,omitempty"` -} - -// Validate validates this repository share gateway import spec -func (m *RepositoryShareGatewayImportSpec) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this repository share gateway import spec based on context it is used -func (m *RepositoryShareGatewayImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryShareGatewayImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryShareGatewayImportSpec) UnmarshalBinary(b []byte) error { - var res RepositoryShareGatewayImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_share_gateway_model.go b/models/repository_share_gateway_model.go deleted file mode 100644 index c7a6349..0000000 --- a/models/repository_share_gateway_model.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoryShareGatewayModel Settings for the gateway server. -// -// swagger:model RepositoryShareGatewayModel -type RepositoryShareGatewayModel struct { - - // If *true*, Veeam Backup & Replication automatically selects a gateway server. - AutoSelect bool `json:"autoSelect,omitempty"` - - // ID of the gateway server. - // Format: uuid - GatewayServerID strfmt.UUID `json:"gatewayServerId,omitempty"` -} - -// Validate validates this repository share gateway model -func (m *RepositoryShareGatewayModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGatewayServerID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryShareGatewayModel) validateGatewayServerID(formats strfmt.Registry) error { - if swag.IsZero(m.GatewayServerID) { // not required - return nil - } - - if err := validate.FormatOf("gatewayServerId", "body", "uuid", m.GatewayServerID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this repository share gateway model based on context it is used -func (m *RepositoryShareGatewayModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryShareGatewayModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryShareGatewayModel) UnmarshalBinary(b []byte) error { - var res RepositoryShareGatewayModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_spec.go b/models/repository_spec.go deleted file mode 100644 index c8951fb..0000000 --- a/models/repository_spec.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositorySpec repository spec -// -// swagger:model RepositorySpec -type RepositorySpec struct { - - // Description of the backup repository. - // Required: true - Description *string `json:"description"` - - // Name of the backup repository. - // Required: true - Name *string `json:"name"` - - // VMware vSphere tag assigned to the backup repository. - Tag string `json:"tag,omitempty"` - - // type - // Required: true - Type *ERepositoryType `json:"type"` -} - -// Validate validates this repository spec -func (m *RepositorySpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositorySpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *RepositorySpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *RepositorySpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this repository spec based on the context it is used -func (m *RepositorySpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositorySpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositorySpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositorySpec) UnmarshalBinary(b []byte) error { - var res RepositorySpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_state_model.go b/models/repository_state_model.go deleted file mode 100644 index 49bdc0e..0000000 --- a/models/repository_state_model.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoryStateModel repository state model -// -// swagger:model RepositoryStateModel -type RepositoryStateModel struct { - - // Repository capacity in GB. - // Required: true - CapacityGB *float64 `json:"capacityGB"` - - // description - // Required: true - Description *string `json:"description"` - - // Repository free space in GB. - // Required: true - FreeGB *float64 `json:"freeGB"` - - // ID of the server that is used as a backup repository. - // Format: uuid - HostID strfmt.UUID `json:"hostId,omitempty"` - - // Name of the server that is used as a backup repository. - HostName string `json:"hostName,omitempty"` - - // ID of the backup repository. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name of the backup repository. - // Required: true - Name *string `json:"name"` - - // Path to the folder where backup files are stored. - Path string `json:"path,omitempty"` - - // type - // Required: true - Type *ERepositoryType `json:"type"` - - // Repository used space in GB. - // Required: true - UsedSpaceGB *float64 `json:"usedSpaceGB"` -} - -// Validate validates this repository state model -func (m *RepositoryStateModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCapacityGB(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFreeGB(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsedSpaceGB(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryStateModel) validateCapacityGB(formats strfmt.Registry) error { - - if err := validate.Required("capacityGB", "body", m.CapacityGB); err != nil { - return err - } - - return nil -} - -func (m *RepositoryStateModel) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *RepositoryStateModel) validateFreeGB(formats strfmt.Registry) error { - - if err := validate.Required("freeGB", "body", m.FreeGB); err != nil { - return err - } - - return nil -} - -func (m *RepositoryStateModel) validateHostID(formats strfmt.Registry) error { - if swag.IsZero(m.HostID) { // not required - return nil - } - - if err := validate.FormatOf("hostId", "body", "uuid", m.HostID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RepositoryStateModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RepositoryStateModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *RepositoryStateModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *RepositoryStateModel) validateUsedSpaceGB(formats strfmt.Registry) error { - - if err := validate.Required("usedSpaceGB", "body", m.UsedSpaceGB); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this repository state model based on the context it is used -func (m *RepositoryStateModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryStateModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryStateModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryStateModel) UnmarshalBinary(b []byte) error { - var res RepositoryStateModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_states_filters.go b/models/repository_states_filters.go deleted file mode 100644 index 4cdb9aa..0000000 --- a/models/repository_states_filters.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoryStatesFilters Filters repositories by the specified parameters. -// -// swagger:model RepositoryStatesFilters -type RepositoryStatesFilters struct { - - // Filters repositories by repository capacity. - CapacityFilter float64 `json:"capacityFilter,omitempty"` - - // Filters repositories by repository free space. - FreeSpaceFilter float64 `json:"freeSpaceFilter,omitempty"` - - // id filter - // Format: uuid - IDFilter strfmt.UUID `json:"idFilter,omitempty"` - - // Returns the specified number of repositories. - Limit int32 `json:"limit,omitempty"` - - // Filters repositories by the `nameFilter` pattern. The pattern can match any repository parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - NameFilter string `json:"nameFilter,omitempty"` - - // Sorts repositories in the ascending order by the `orderColumn` parameter. - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn ERepositoryStatesFiltersOrderColumn `json:"orderColumn,omitempty"` - - // Skips the specified number of repositories. - Skip int32 `json:"skip,omitempty"` - - // type filter - TypeFilter ERepositoryType `json:"typeFilter,omitempty"` - - // Filters repositories by repository used space. - UsedSpaceFilter float64 `json:"usedSpaceFilter,omitempty"` -} - -// Validate validates this repository states filters -func (m *RepositoryStatesFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryStatesFilters) validateIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.IDFilter) { // not required - return nil - } - - if err := validate.FormatOf("idFilter", "body", "uuid", m.IDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RepositoryStatesFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *RepositoryStatesFilters) validateTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TypeFilter) { // not required - return nil - } - - if err := m.TypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this repository states filters based on the context it is used -func (m *RepositoryStatesFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryStatesFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *RepositoryStatesFilters) contextValidateTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryStatesFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryStatesFilters) UnmarshalBinary(b []byte) error { - var res RepositoryStatesFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/repository_states_result.go b/models/repository_states_result.go deleted file mode 100644 index dddfec5..0000000 --- a/models/repository_states_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RepositoryStatesResult repository states result -// -// swagger:model RepositoryStatesResult -type RepositoryStatesResult struct { - - // Array of repository states. - // Required: true - Data []*RepositoryStateModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this repository states result -func (m *RepositoryStatesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryStatesResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoryStatesResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this repository states result based on the context it is used -func (m *RepositoryStatesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RepositoryStatesResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *RepositoryStatesResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RepositoryStatesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RepositoryStatesResult) UnmarshalBinary(b []byte) error { - var res RepositoryStatesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/scale_out_extent_maintenance_spec.go b/models/scale_out_extent_maintenance_spec.go deleted file mode 100644 index 55467c2..0000000 --- a/models/scale_out_extent_maintenance_spec.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ScaleOutExtentMaintenanceSpec scale out extent maintenance spec -// -// swagger:model ScaleOutExtentMaintenanceSpec -type ScaleOutExtentMaintenanceSpec struct { - - // repository ids - // Required: true - RepositoryIds []strfmt.UUID `json:"repositoryIds"` -} - -// Validate validates this scale out extent maintenance spec -func (m *ScaleOutExtentMaintenanceSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRepositoryIds(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScaleOutExtentMaintenanceSpec) validateRepositoryIds(formats strfmt.Registry) error { - - if err := validate.Required("repositoryIds", "body", m.RepositoryIds); err != nil { - return err - } - - for i := 0; i < len(m.RepositoryIds); i++ { - - if err := validate.FormatOf("repositoryIds"+"."+strconv.Itoa(i), "body", "uuid", m.RepositoryIds[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -// ContextValidate validates this scale out extent maintenance spec based on context it is used -func (m *ScaleOutExtentMaintenanceSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ScaleOutExtentMaintenanceSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScaleOutExtentMaintenanceSpec) UnmarshalBinary(b []byte) error { - var res ScaleOutExtentMaintenanceSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/scale_out_repositories_filters.go b/models/scale_out_repositories_filters.go deleted file mode 100644 index 2f1ff98..0000000 --- a/models/scale_out_repositories_filters.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ScaleOutRepositoriesFilters scale out repositories filters -// -// swagger:model ScaleOutRepositoriesFilters -type ScaleOutRepositoriesFilters struct { - - // Maximum number of repositories to return. - Limit int32 `json:"limit,omitempty"` - - // Filters repositories by the `nameFilter` substring. The substring can be part of any repository parameter. - NameFilter string `json:"nameFilter,omitempty"` - - // Sorts repositories in the ascending order by the `orderColumn` parameter. - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EScaleOutRepositoryFiltersOrderColumn `json:"orderColumn,omitempty"` - - // Number of repositories to skip. - Skip int32 `json:"skip,omitempty"` -} - -// Validate validates this scale out repositories filters -func (m *ScaleOutRepositoriesFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScaleOutRepositoriesFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// ContextValidate validate this scale out repositories filters based on the context it is used -func (m *ScaleOutRepositoriesFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScaleOutRepositoriesFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ScaleOutRepositoriesFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScaleOutRepositoriesFilters) UnmarshalBinary(b []byte) error { - var res ScaleOutRepositoriesFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/scale_out_repositories_result.go b/models/scale_out_repositories_result.go deleted file mode 100644 index 4fb9723..0000000 --- a/models/scale_out_repositories_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ScaleOutRepositoriesResult scale out repositories result -// -// swagger:model ScaleOutRepositoriesResult -type ScaleOutRepositoriesResult struct { - - // Array of scale-out backup repositories. - // Required: true - Data []*ScaleOutRepositoryModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this scale out repositories result -func (m *ScaleOutRepositoriesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScaleOutRepositoriesResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ScaleOutRepositoriesResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this scale out repositories result based on the context it is used -func (m *ScaleOutRepositoriesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScaleOutRepositoriesResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ScaleOutRepositoriesResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ScaleOutRepositoriesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScaleOutRepositoriesResult) UnmarshalBinary(b []byte) error { - var res ScaleOutRepositoriesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/scale_out_repository_model.go b/models/scale_out_repository_model.go deleted file mode 100644 index bdd3c74..0000000 --- a/models/scale_out_repository_model.go +++ /dev/null @@ -1,302 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ScaleOutRepositoryModel scale out repository model -// -// swagger:model ScaleOutRepositoryModel -type ScaleOutRepositoryModel struct { - - // archive tier - ArchiveTier *ArchiveTierModel `json:"archiveTier,omitempty"` - - // capacity tier - CapacityTier *CapacityTierModel `json:"capacityTier,omitempty"` - - // Description of the scale-out backup repository. - // Required: true - Description *string `json:"description"` - - // ID of the scale-out backup repository. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name of the scale-out backup repository. - // Required: true - Name *string `json:"name"` - - // performance tier - // Required: true - PerformanceTier *PerformanceTierModel `json:"performanceTier"` - - // placement policy - PlacementPolicy *PlacementPolicyModel `json:"placementPolicy,omitempty"` - - // Tag assigned to of the scale-out backup repository. - // Required: true - Tag *string `json:"tag"` -} - -// Validate validates this scale out repository model -func (m *ScaleOutRepositoryModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateArchiveTier(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCapacityTier(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePerformanceTier(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlacementPolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTag(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScaleOutRepositoryModel) validateArchiveTier(formats strfmt.Registry) error { - if swag.IsZero(m.ArchiveTier) { // not required - return nil - } - - if m.ArchiveTier != nil { - if err := m.ArchiveTier.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("archiveTier") - } - return err - } - } - - return nil -} - -func (m *ScaleOutRepositoryModel) validateCapacityTier(formats strfmt.Registry) error { - if swag.IsZero(m.CapacityTier) { // not required - return nil - } - - if m.CapacityTier != nil { - if err := m.CapacityTier.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacityTier") - } - return err - } - } - - return nil -} - -func (m *ScaleOutRepositoryModel) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ScaleOutRepositoryModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ScaleOutRepositoryModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ScaleOutRepositoryModel) validatePerformanceTier(formats strfmt.Registry) error { - - if err := validate.Required("performanceTier", "body", m.PerformanceTier); err != nil { - return err - } - - if m.PerformanceTier != nil { - if err := m.PerformanceTier.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("performanceTier") - } - return err - } - } - - return nil -} - -func (m *ScaleOutRepositoryModel) validatePlacementPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PlacementPolicy) { // not required - return nil - } - - if m.PlacementPolicy != nil { - if err := m.PlacementPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("placementPolicy") - } - return err - } - } - - return nil -} - -func (m *ScaleOutRepositoryModel) validateTag(formats strfmt.Registry) error { - - if err := validate.Required("tag", "body", m.Tag); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this scale out repository model based on the context it is used -func (m *ScaleOutRepositoryModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateArchiveTier(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCapacityTier(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePerformanceTier(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePlacementPolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScaleOutRepositoryModel) contextValidateArchiveTier(ctx context.Context, formats strfmt.Registry) error { - - if m.ArchiveTier != nil { - if err := m.ArchiveTier.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("archiveTier") - } - return err - } - } - - return nil -} - -func (m *ScaleOutRepositoryModel) contextValidateCapacityTier(ctx context.Context, formats strfmt.Registry) error { - - if m.CapacityTier != nil { - if err := m.CapacityTier.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capacityTier") - } - return err - } - } - - return nil -} - -func (m *ScaleOutRepositoryModel) contextValidatePerformanceTier(ctx context.Context, formats strfmt.Registry) error { - - if m.PerformanceTier != nil { - if err := m.PerformanceTier.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("performanceTier") - } - return err - } - } - - return nil -} - -func (m *ScaleOutRepositoryModel) contextValidatePlacementPolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.PlacementPolicy != nil { - if err := m.PlacementPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("placementPolicy") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ScaleOutRepositoryModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScaleOutRepositoryModel) UnmarshalBinary(b []byte) error { - var res ScaleOutRepositoryModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/schedule_after_this_job_model.go b/models/schedule_after_this_job_model.go deleted file mode 100644 index a06e433..0000000 --- a/models/schedule_after_this_job_model.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ScheduleAfterThisJobModel Job chaining options. -// -// swagger:model ScheduleAfterThisJobModel -type ScheduleAfterThisJobModel struct { - - // If *true*, job chaining is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // Name of the preceding job. - JobName string `json:"jobName,omitempty"` -} - -// Validate validates this schedule after this job model -func (m *ScheduleAfterThisJobModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScheduleAfterThisJobModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this schedule after this job model based on context it is used -func (m *ScheduleAfterThisJobModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ScheduleAfterThisJobModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScheduleAfterThisJobModel) UnmarshalBinary(b []byte) error { - var res ScheduleAfterThisJobModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/schedule_backup_window_model.go b/models/schedule_backup_window_model.go deleted file mode 100644 index 3ecdadc..0000000 --- a/models/schedule_backup_window_model.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ScheduleBackupWindowModel schedule backup window model -// -// swagger:model ScheduleBackupWindowModel -type ScheduleBackupWindowModel struct { - - // window setting - WindowSetting *BackupWindowSettingModel `json:"WindowSetting,omitempty"` - - // If *true*, periodic schedule is enabled. - // Required: true - IsEnabled bool `json:"isEnabled"` -} - -// Validate validates this schedule backup window model -func (m *ScheduleBackupWindowModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWindowSetting(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScheduleBackupWindowModel) validateWindowSetting(formats strfmt.Registry) error { - if swag.IsZero(m.WindowSetting) { // not required - return nil - } - - if m.WindowSetting != nil { - if err := m.WindowSetting.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("WindowSetting") - } - return err - } - } - - return nil -} - -func (m *ScheduleBackupWindowModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", bool(m.IsEnabled)); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this schedule backup window model based on the context it is used -func (m *ScheduleBackupWindowModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateWindowSetting(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScheduleBackupWindowModel) contextValidateWindowSetting(ctx context.Context, formats strfmt.Registry) error { - - if m.WindowSetting != nil { - if err := m.WindowSetting.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("WindowSetting") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ScheduleBackupWindowModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScheduleBackupWindowModel) UnmarshalBinary(b []byte) error { - var res ScheduleBackupWindowModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/schedule_daily_model.go b/models/schedule_daily_model.go deleted file mode 100644 index 5d62f37..0000000 --- a/models/schedule_daily_model.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ScheduleDailyModel Daily scheduling options. -// -// swagger:model ScheduleDailyModel -type ScheduleDailyModel struct { - - // daily kind - DailyKind EDailyKinds `json:"dailyKind,omitempty"` - - // Days of the week when the job must start. - // Unique: true - Days []EDayOfWeek `json:"days"` - - // If *true*, daily schedule is enabled. - // Required: true - IsEnabled bool `json:"isEnabled"` - - // Local time when the job must start. - LocalTime string `json:"localTime,omitempty"` -} - -// Validate validates this schedule daily model -func (m *ScheduleDailyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDailyKind(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDays(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScheduleDailyModel) validateDailyKind(formats strfmt.Registry) error { - if swag.IsZero(m.DailyKind) { // not required - return nil - } - - if err := m.DailyKind.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dailyKind") - } - return err - } - - return nil -} - -func (m *ScheduleDailyModel) validateDays(formats strfmt.Registry) error { - if swag.IsZero(m.Days) { // not required - return nil - } - - if err := validate.UniqueItems("days", "body", m.Days); err != nil { - return err - } - - for i := 0; i < len(m.Days); i++ { - - if err := m.Days[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("days" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *ScheduleDailyModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", bool(m.IsEnabled)); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this schedule daily model based on the context it is used -func (m *ScheduleDailyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDailyKind(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDays(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScheduleDailyModel) contextValidateDailyKind(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DailyKind.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dailyKind") - } - return err - } - - return nil -} - -func (m *ScheduleDailyModel) contextValidateDays(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Days); i++ { - - if err := m.Days[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("days" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ScheduleDailyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScheduleDailyModel) UnmarshalBinary(b []byte) error { - var res ScheduleDailyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/schedule_monthly_model.go b/models/schedule_monthly_model.go deleted file mode 100644 index bd6ec23..0000000 --- a/models/schedule_monthly_model.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ScheduleMonthlyModel Monthly scheduling options. -// -// swagger:model ScheduleMonthlyModel -type ScheduleMonthlyModel struct { - - // day number in month - DayNumberInMonth EDayNumberInMonth `json:"dayNumberInMonth,omitempty"` - - // Day of the month when the job must start. - DayOfMonth int64 `json:"dayOfMonth,omitempty"` - - // day of week - DayOfWeek EDayOfWeek `json:"dayOfWeek,omitempty"` - - // If *true*, monthly schedule is enabled. - // Required: true - IsEnabled bool `json:"isEnabled"` - - // Local time when the job must start. - LocalTime string `json:"localTime,omitempty"` - - // Months when the job must start. - // Unique: true - Months []EMonth `json:"months"` -} - -// Validate validates this schedule monthly model -func (m *ScheduleMonthlyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDayNumberInMonth(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDayOfWeek(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMonths(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScheduleMonthlyModel) validateDayNumberInMonth(formats strfmt.Registry) error { - if swag.IsZero(m.DayNumberInMonth) { // not required - return nil - } - - if err := m.DayNumberInMonth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayNumberInMonth") - } - return err - } - - return nil -} - -func (m *ScheduleMonthlyModel) validateDayOfWeek(formats strfmt.Registry) error { - if swag.IsZero(m.DayOfWeek) { // not required - return nil - } - - if err := m.DayOfWeek.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayOfWeek") - } - return err - } - - return nil -} - -func (m *ScheduleMonthlyModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", bool(m.IsEnabled)); err != nil { - return err - } - - return nil -} - -func (m *ScheduleMonthlyModel) validateMonths(formats strfmt.Registry) error { - if swag.IsZero(m.Months) { // not required - return nil - } - - if err := validate.UniqueItems("months", "body", m.Months); err != nil { - return err - } - - for i := 0; i < len(m.Months); i++ { - - if err := m.Months[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("months" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this schedule monthly model based on the context it is used -func (m *ScheduleMonthlyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDayNumberInMonth(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDayOfWeek(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMonths(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScheduleMonthlyModel) contextValidateDayNumberInMonth(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DayNumberInMonth.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayNumberInMonth") - } - return err - } - - return nil -} - -func (m *ScheduleMonthlyModel) contextValidateDayOfWeek(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DayOfWeek.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dayOfWeek") - } - return err - } - - return nil -} - -func (m *ScheduleMonthlyModel) contextValidateMonths(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Months); i++ { - - if err := m.Months[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("months" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ScheduleMonthlyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScheduleMonthlyModel) UnmarshalBinary(b []byte) error { - var res ScheduleMonthlyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/schedule_periodically_model.go b/models/schedule_periodically_model.go deleted file mode 100644 index ee7904d..0000000 --- a/models/schedule_periodically_model.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SchedulePeriodicallyModel Periodic scheduling options. -// -// swagger:model SchedulePeriodicallyModel -type SchedulePeriodicallyModel struct { - - // backup window - BackupWindow *BackupWindowSettingModel `json:"backupWindow,omitempty"` - - // Number of time units that defines the time interval. - Frequency int64 `json:"frequency,omitempty"` - - // If *true*, periodic schedule is enabled. - // Required: true - IsEnabled bool `json:"isEnabled"` - - // periodically kind - PeriodicallyKind EPeriodicallyKinds `json:"periodicallyKind,omitempty"` -} - -// Validate validates this schedule periodically model -func (m *SchedulePeriodicallyModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackupWindow(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePeriodicallyKind(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SchedulePeriodicallyModel) validateBackupWindow(formats strfmt.Registry) error { - if swag.IsZero(m.BackupWindow) { // not required - return nil - } - - if m.BackupWindow != nil { - if err := m.BackupWindow.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupWindow") - } - return err - } - } - - return nil -} - -func (m *SchedulePeriodicallyModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", bool(m.IsEnabled)); err != nil { - return err - } - - return nil -} - -func (m *SchedulePeriodicallyModel) validatePeriodicallyKind(formats strfmt.Registry) error { - if swag.IsZero(m.PeriodicallyKind) { // not required - return nil - } - - if err := m.PeriodicallyKind.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("periodicallyKind") - } - return err - } - - return nil -} - -// ContextValidate validate this schedule periodically model based on the context it is used -func (m *SchedulePeriodicallyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBackupWindow(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePeriodicallyKind(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SchedulePeriodicallyModel) contextValidateBackupWindow(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupWindow != nil { - if err := m.BackupWindow.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupWindow") - } - return err - } - } - - return nil -} - -func (m *SchedulePeriodicallyModel) contextValidatePeriodicallyKind(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PeriodicallyKind.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("periodicallyKind") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SchedulePeriodicallyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SchedulePeriodicallyModel) UnmarshalBinary(b []byte) error { - var res SchedulePeriodicallyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/schedule_retry_model.go b/models/schedule_retry_model.go deleted file mode 100644 index c479468..0000000 --- a/models/schedule_retry_model.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ScheduleRetryModel Retry options. -// -// swagger:model ScheduleRetryModel -type ScheduleRetryModel struct { - - // Time interval between job retries in minutes. - AwaitMinutes int64 `json:"awaitMinutes,omitempty"` - - // If *true*, retry options are enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` - - // Number of retries set for the job. - RetryCount int64 `json:"retryCount,omitempty"` -} - -// Validate validates this schedule retry model -func (m *ScheduleRetryModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this schedule retry model based on context it is used -func (m *ScheduleRetryModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ScheduleRetryModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScheduleRetryModel) UnmarshalBinary(b []byte) error { - var res ScheduleRetryModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/script_command.go b/models/script_command.go deleted file mode 100644 index 10ec5cd..0000000 --- a/models/script_command.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ScriptCommand Script settings. -// -// swagger:model ScriptCommand -type ScriptCommand struct { - - // Path to the script. - Command string `json:"command,omitempty"` - - // If *true*, script execution is enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` -} - -// Validate validates this script command -func (m *ScriptCommand) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ScriptCommand) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this script command based on context it is used -func (m *ScriptCommand) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ScriptCommand) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ScriptCommand) UnmarshalBinary(b []byte) error { - var res ScriptCommand - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/server_time_model.go b/models/server_time_model.go deleted file mode 100644 index f21b192..0000000 --- a/models/server_time_model.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServerTimeModel server time model -// -// swagger:model ServerTimeModel -type ServerTimeModel struct { - - // Current date and time on the server. - // Required: true - // Format: date-time - ServerTime *strfmt.DateTime `json:"serverTime"` - - // time zone - TimeZone string `json:"timeZone,omitempty"` -} - -// Validate validates this server time model -func (m *ServerTimeModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateServerTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServerTimeModel) validateServerTime(formats strfmt.Registry) error { - - if err := validate.Required("serverTime", "body", m.ServerTime); err != nil { - return err - } - - if err := validate.FormatOf("serverTime", "body", "date-time", m.ServerTime.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this server time model based on context it is used -func (m *ServerTimeModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServerTimeModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServerTimeModel) UnmarshalBinary(b []byte) error { - var res ServerTimeModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/services_filters.go b/models/services_filters.go deleted file mode 100644 index d72ceec..0000000 --- a/models/services_filters.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServicesFilters services filters -// -// swagger:model ServicesFilters -type ServicesFilters struct { - - // limit - Limit int32 `json:"limit,omitempty"` - - // name filter - NameFilter string `json:"nameFilter,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EServicesFiltersOrderColumn `json:"orderColumn,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` -} - -// Validate validates this services filters -func (m *ServicesFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicesFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// ContextValidate validate this services filters based on the context it is used -func (m *ServicesFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicesFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServicesFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServicesFilters) UnmarshalBinary(b []byte) error { - var res ServicesFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/services_model.go b/models/services_model.go deleted file mode 100644 index 5699305..0000000 --- a/models/services_model.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServicesModel services model -// -// swagger:model ServicesModel -type ServicesModel struct { - - // Name of the service. - // Required: true - Name *string `json:"name"` - - // Port used to communicate with the service. - // Required: true - Port *int64 `json:"port"` -} - -// Validate validates this services model -func (m *ServicesModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePort(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicesModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServicesModel) validatePort(formats strfmt.Registry) error { - - if err := validate.Required("port", "body", m.Port); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this services model based on context it is used -func (m *ServicesModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServicesModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServicesModel) UnmarshalBinary(b []byte) error { - var res ServicesModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/services_result.go b/models/services_result.go deleted file mode 100644 index 8fdc1eb..0000000 --- a/models/services_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServicesResult services result -// -// swagger:model ServicesResult -type ServicesResult struct { - - // Array of services. - // Required: true - Data []*ServicesModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this services result -func (m *ServicesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicesResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ServicesResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this services result based on the context it is used -func (m *ServicesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicesResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ServicesResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServicesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServicesResult) UnmarshalBinary(b []byte) error { - var res ServicesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/session_log_record_model.go b/models/session_log_record_model.go deleted file mode 100644 index 4ca9e0d..0000000 --- a/models/session_log_record_model.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SessionLogRecordModel Record of the session log. -// -// swagger:model SessionLogRecordModel -type SessionLogRecordModel struct { - - // Description of the log record. - Description string `json:"description,omitempty"` - - // ID of the log record. - ID int64 `json:"id,omitempty"` - - // Date and time the operation was started. - // Format: date-time - StartTime strfmt.DateTime `json:"startTime,omitempty"` - - // Status of the operation described by the log record. - Status ETaskLogRecordStatus `json:"status,omitempty"` - - // Title of the log record. - Title string `json:"title,omitempty"` - - // Date and time the log record was updated. - // Format: date-time - UpdateTime strfmt.DateTime `json:"updateTime,omitempty"` -} - -// Validate validates this session log record model -func (m *SessionLogRecordModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdateTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionLogRecordModel) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(m.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("startTime", "body", "date-time", m.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionLogRecordModel) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - - return nil -} - -func (m *SessionLogRecordModel) validateUpdateTime(formats strfmt.Registry) error { - if swag.IsZero(m.UpdateTime) { // not required - return nil - } - - if err := validate.FormatOf("updateTime", "body", "date-time", m.UpdateTime.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this session log record model based on the context it is used -func (m *SessionLogRecordModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionLogRecordModel) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionLogRecordModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionLogRecordModel) UnmarshalBinary(b []byte) error { - var res SessionLogRecordModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/session_log_result.go b/models/session_log_result.go deleted file mode 100644 index 55d692c..0000000 --- a/models/session_log_result.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SessionLogResult Log of the session. -// -// swagger:model SessionLogResult -type SessionLogResult struct { - - // Array of log records. - Records []*SessionLogRecordModel `json:"records"` - - // Total number of records. - TotalRecords int64 `json:"totalRecords,omitempty"` -} - -// Validate validates this session log result -func (m *SessionLogResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRecords(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionLogResult) validateRecords(formats strfmt.Registry) error { - if swag.IsZero(m.Records) { // not required - return nil - } - - for i := 0; i < len(m.Records); i++ { - if swag.IsZero(m.Records[i]) { // not required - continue - } - - if m.Records[i] != nil { - if err := m.Records[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("records" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this session log result based on the context it is used -func (m *SessionLogResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRecords(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionLogResult) contextValidateRecords(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Records); i++ { - - if m.Records[i] != nil { - if err := m.Records[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("records" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionLogResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionLogResult) UnmarshalBinary(b []byte) error { - var res SessionLogResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/session_model.go b/models/session_model.go deleted file mode 100644 index b74e395..0000000 --- a/models/session_model.go +++ /dev/null @@ -1,363 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SessionModel session model -// -// swagger:model SessionModel -type SessionModel struct { - - // ID of the activity. - // Required: true - // Format: uuid - ActivityID *strfmt.UUID `json:"activityId"` - - // Date and time the session was created. - // Required: true - // Format: date-time - CreationTime *strfmt.DateTime `json:"creationTime"` - - // Date and time the session was ended. - // Format: date-time - EndTime strfmt.DateTime `json:"endTime,omitempty"` - - // ID of the session. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name of the session. - // Required: true - Name *string `json:"name"` - - // ID of the parent session. - // Format: uuid - ParentSessionID strfmt.UUID `json:"parentSessionId,omitempty"` - - // Progress percentage of the session. - ProgressPercent int64 `json:"progressPercent,omitempty"` - - // ID of the resource. - // Format: uuid - ResourceID strfmt.UUID `json:"resourceId,omitempty"` - - // URI of the resource. - ResourceReference string `json:"resourceReference,omitempty"` - - // result - Result *SessionResultModel `json:"result,omitempty"` - - // session type - // Required: true - SessionType *ESessionType `json:"sessionType"` - - // state - // Required: true - State *ESessionState `json:"state"` - - // Update sequence number. - // Required: true - Usn *int64 `json:"usn"` -} - -// Validate validates this session model -func (m *SessionModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActivityID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreationTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEndTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateParentSessionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResourceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResult(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSessionType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionModel) validateActivityID(formats strfmt.Registry) error { - - if err := validate.Required("activityId", "body", m.ActivityID); err != nil { - return err - } - - if err := validate.FormatOf("activityId", "body", "uuid", m.ActivityID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionModel) validateCreationTime(formats strfmt.Registry) error { - - if err := validate.Required("creationTime", "body", m.CreationTime); err != nil { - return err - } - - if err := validate.FormatOf("creationTime", "body", "date-time", m.CreationTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionModel) validateEndTime(formats strfmt.Registry) error { - if swag.IsZero(m.EndTime) { // not required - return nil - } - - if err := validate.FormatOf("endTime", "body", "date-time", m.EndTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionModel) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SessionModel) validateParentSessionID(formats strfmt.Registry) error { - if swag.IsZero(m.ParentSessionID) { // not required - return nil - } - - if err := validate.FormatOf("parentSessionId", "body", "uuid", m.ParentSessionID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionModel) validateResourceID(formats strfmt.Registry) error { - if swag.IsZero(m.ResourceID) { // not required - return nil - } - - if err := validate.FormatOf("resourceId", "body", "uuid", m.ResourceID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionModel) validateResult(formats strfmt.Registry) error { - if swag.IsZero(m.Result) { // not required - return nil - } - - if m.Result != nil { - if err := m.Result.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("result") - } - return err - } - } - - return nil -} - -func (m *SessionModel) validateSessionType(formats strfmt.Registry) error { - - if err := validate.Required("sessionType", "body", m.SessionType); err != nil { - return err - } - - if err := validate.Required("sessionType", "body", m.SessionType); err != nil { - return err - } - - if m.SessionType != nil { - if err := m.SessionType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sessionType") - } - return err - } - } - - return nil -} - -func (m *SessionModel) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if m.State != nil { - if err := m.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -func (m *SessionModel) validateUsn(formats strfmt.Registry) error { - - if err := validate.Required("usn", "body", m.Usn); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this session model based on the context it is used -func (m *SessionModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateResult(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSessionType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionModel) contextValidateResult(ctx context.Context, formats strfmt.Registry) error { - - if m.Result != nil { - if err := m.Result.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("result") - } - return err - } - } - - return nil -} - -func (m *SessionModel) contextValidateSessionType(ctx context.Context, formats strfmt.Registry) error { - - if m.SessionType != nil { - if err := m.SessionType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sessionType") - } - return err - } - } - - return nil -} - -func (m *SessionModel) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if m.State != nil { - if err := m.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionModel) UnmarshalBinary(b []byte) error { - var res SessionModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/session_result_model.go b/models/session_result_model.go deleted file mode 100644 index b247707..0000000 --- a/models/session_result_model.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SessionResultModel session result model -// -// swagger:model SessionResultModel -type SessionResultModel struct { - - // If *true*, the session has been canceled. - IsCanceled bool `json:"isCanceled,omitempty"` - - // Message that explains the session result. - Message string `json:"message,omitempty"` - - // result - // Required: true - Result *ESessionResult `json:"result"` -} - -// Validate validates this session result model -func (m *SessionResultModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateResult(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionResultModel) validateResult(formats strfmt.Registry) error { - - if err := validate.Required("result", "body", m.Result); err != nil { - return err - } - - if err := validate.Required("result", "body", m.Result); err != nil { - return err - } - - if m.Result != nil { - if err := m.Result.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("result") - } - return err - } - } - - return nil -} - -// ContextValidate validate this session result model based on the context it is used -func (m *SessionResultModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateResult(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionResultModel) contextValidateResult(ctx context.Context, formats strfmt.Registry) error { - - if m.Result != nil { - if err := m.Result.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("result") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionResultModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionResultModel) UnmarshalBinary(b []byte) error { - var res SessionResultModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/sessions_filters.go b/models/sessions_filters.go deleted file mode 100644 index 6e6ca84..0000000 --- a/models/sessions_filters.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SessionsFilters sessions filters -// -// swagger:model SessionsFilters -type SessionsFilters struct { - - // created after filter - // Format: date-time - CreatedAfterFilter strfmt.DateTime `json:"createdAfterFilter,omitempty"` - - // created before filter - // Format: date-time - CreatedBeforeFilter strfmt.DateTime `json:"createdBeforeFilter,omitempty"` - - // ended after filter - // Format: date-time - EndedAfterFilter strfmt.DateTime `json:"endedAfterFilter,omitempty"` - - // ended before filter - // Format: date-time - EndedBeforeFilter strfmt.DateTime `json:"endedBeforeFilter,omitempty"` - - // job Id filter - // Format: uuid - JobIDFilter strfmt.UUID `json:"jobIdFilter,omitempty"` - - // limit - Limit int32 `json:"limit,omitempty"` - - // name filter - NameFilter string `json:"nameFilter,omitempty"` - - // order asc - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn ESessionsFiltersOrderColumn `json:"orderColumn,omitempty"` - - // result filter - ResultFilter ESessionResult `json:"resultFilter,omitempty"` - - // skip - Skip int32 `json:"skip,omitempty"` - - // state filter - StateFilter ESessionState `json:"stateFilter,omitempty"` - - // type filter - TypeFilter ESessionType `json:"typeFilter,omitempty"` -} - -// Validate validates this sessions filters -func (m *SessionsFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAfterFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedBeforeFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEndedAfterFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEndedBeforeFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJobIDFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResultFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStateFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionsFilters) validateCreatedAfterFilter(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAfterFilter) { // not required - return nil - } - - if err := validate.FormatOf("createdAfterFilter", "body", "date-time", m.CreatedAfterFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionsFilters) validateCreatedBeforeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedBeforeFilter) { // not required - return nil - } - - if err := validate.FormatOf("createdBeforeFilter", "body", "date-time", m.CreatedBeforeFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionsFilters) validateEndedAfterFilter(formats strfmt.Registry) error { - if swag.IsZero(m.EndedAfterFilter) { // not required - return nil - } - - if err := validate.FormatOf("endedAfterFilter", "body", "date-time", m.EndedAfterFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionsFilters) validateEndedBeforeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.EndedBeforeFilter) { // not required - return nil - } - - if err := validate.FormatOf("endedBeforeFilter", "body", "date-time", m.EndedBeforeFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionsFilters) validateJobIDFilter(formats strfmt.Registry) error { - if swag.IsZero(m.JobIDFilter) { // not required - return nil - } - - if err := validate.FormatOf("jobIdFilter", "body", "uuid", m.JobIDFilter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SessionsFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *SessionsFilters) validateResultFilter(formats strfmt.Registry) error { - if swag.IsZero(m.ResultFilter) { // not required - return nil - } - - if err := m.ResultFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resultFilter") - } - return err - } - - return nil -} - -func (m *SessionsFilters) validateStateFilter(formats strfmt.Registry) error { - if swag.IsZero(m.StateFilter) { // not required - return nil - } - - if err := m.StateFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("stateFilter") - } - return err - } - - return nil -} - -func (m *SessionsFilters) validateTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TypeFilter) { // not required - return nil - } - - if err := m.TypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this sessions filters based on the context it is used -func (m *SessionsFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResultFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStateFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionsFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *SessionsFilters) contextValidateResultFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ResultFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resultFilter") - } - return err - } - - return nil -} - -func (m *SessionsFilters) contextValidateStateFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.StateFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("stateFilter") - } - return err - } - - return nil -} - -func (m *SessionsFilters) contextValidateTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionsFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionsFilters) UnmarshalBinary(b []byte) error { - var res SessionsFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/sessions_result.go b/models/sessions_result.go deleted file mode 100644 index f85e1e2..0000000 --- a/models/sessions_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SessionsResult sessions result -// -// swagger:model SessionsResult -type SessionsResult struct { - - // Array of sessions. - // Required: true - Data []*SessionModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this sessions result -func (m *SessionsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionsResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SessionsResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this sessions result based on the context it is used -func (m *SessionsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionsResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SessionsResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionsResult) UnmarshalBinary(b []byte) error { - var res SessionsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/smb_repository_share_settings_model.go b/models/smb_repository_share_settings_model.go deleted file mode 100644 index 5f5e880..0000000 --- a/models/smb_repository_share_settings_model.go +++ /dev/null @@ -1,140 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SmbRepositoryShareSettingsModel Share settings. -// -// swagger:model SmbRepositoryShareSettingsModel -type SmbRepositoryShareSettingsModel struct { - - // ID of the credentials record used to access the shared folder. - // Required: true - // Format: uuid - CredentialsID *strfmt.UUID `json:"credentialsId"` - - // gateway server - GatewayServer *RepositoryShareGatewayModel `json:"gatewayServer,omitempty"` - - // Path to the shared folder that that is used as a backup repository. - // Required: true - SharePath *string `json:"sharePath"` -} - -// Validate validates this smb repository share settings model -func (m *SmbRepositoryShareSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentialsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGatewayServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSharePath(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbRepositoryShareSettingsModel) validateCredentialsID(formats strfmt.Registry) error { - - if err := validate.Required("credentialsId", "body", m.CredentialsID); err != nil { - return err - } - - if err := validate.FormatOf("credentialsId", "body", "uuid", m.CredentialsID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SmbRepositoryShareSettingsModel) validateGatewayServer(formats strfmt.Registry) error { - if swag.IsZero(m.GatewayServer) { // not required - return nil - } - - if m.GatewayServer != nil { - if err := m.GatewayServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gatewayServer") - } - return err - } - } - - return nil -} - -func (m *SmbRepositoryShareSettingsModel) validateSharePath(formats strfmt.Registry) error { - - if err := validate.Required("sharePath", "body", m.SharePath); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this smb repository share settings model based on the context it is used -func (m *SmbRepositoryShareSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGatewayServer(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbRepositoryShareSettingsModel) contextValidateGatewayServer(ctx context.Context, formats strfmt.Registry) error { - - if m.GatewayServer != nil { - if err := m.GatewayServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gatewayServer") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmbRepositoryShareSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmbRepositoryShareSettingsModel) UnmarshalBinary(b []byte) error { - var res SmbRepositoryShareSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/smb_repository_share_settings_spec.go b/models/smb_repository_share_settings_spec.go deleted file mode 100644 index d287dcd..0000000 --- a/models/smb_repository_share_settings_spec.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SmbRepositoryShareSettingsSpec smb repository share settings spec -// -// swagger:model SmbRepositoryShareSettingsSpec -type SmbRepositoryShareSettingsSpec struct { - - // credentials - // Required: true - Credentials *CredentialsImportModel `json:"credentials"` - - // gateway server - GatewayServer *RepositoryShareGatewayImportSpec `json:"gatewayServer,omitempty"` - - // Path to the shared folder that that is used as a backup repository. - // Required: true - SharePath *string `json:"sharePath"` -} - -// Validate validates this smb repository share settings spec -func (m *SmbRepositoryShareSettingsSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGatewayServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSharePath(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbRepositoryShareSettingsSpec) validateCredentials(formats strfmt.Registry) error { - - if err := validate.Required("credentials", "body", m.Credentials); err != nil { - return err - } - - if m.Credentials != nil { - if err := m.Credentials.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *SmbRepositoryShareSettingsSpec) validateGatewayServer(formats strfmt.Registry) error { - if swag.IsZero(m.GatewayServer) { // not required - return nil - } - - if m.GatewayServer != nil { - if err := m.GatewayServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gatewayServer") - } - return err - } - } - - return nil -} - -func (m *SmbRepositoryShareSettingsSpec) validateSharePath(formats strfmt.Registry) error { - - if err := validate.Required("sharePath", "body", m.SharePath); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this smb repository share settings spec based on the context it is used -func (m *SmbRepositoryShareSettingsSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCredentials(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGatewayServer(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbRepositoryShareSettingsSpec) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { - - if m.Credentials != nil { - if err := m.Credentials.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *SmbRepositoryShareSettingsSpec) contextValidateGatewayServer(ctx context.Context, formats strfmt.Registry) error { - - if m.GatewayServer != nil { - if err := m.GatewayServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gatewayServer") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmbRepositoryShareSettingsSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmbRepositoryShareSettingsSpec) UnmarshalBinary(b []byte) error { - var res SmbRepositoryShareSettingsSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/smb_storage_import_spec.go b/models/smb_storage_import_spec.go deleted file mode 100644 index 58de1c8..0000000 --- a/models/smb_storage_import_spec.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SmbStorageImportSpec smb storage import spec -// -// swagger:model SmbStorageImportSpec -type SmbStorageImportSpec struct { - - // Description of the backup repository. - // Required: true - Description *string `json:"description"` - - // mount server - // Required: true - MountServer *MountServerSettingsImportSpec `json:"mountServer"` - - // Name of the backup repository. - // Required: true - Name *string `json:"name"` - - // repository - // Required: true - Repository *NetworkRepositorySettingsModel `json:"repository"` - - // share - // Required: true - Share *SmbRepositoryShareSettingsSpec `json:"share"` - - // VMware vSphere tag assigned to the backup repository. - // Required: true - Tag *string `json:"tag"` - - // type - // Required: true - Type *ERepositoryType `json:"type"` -} - -// Validate validates this smb storage import spec -func (m *SmbStorageImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShare(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbStorageImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *SmbStorageImportSpec) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *SmbStorageImportSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *SmbStorageImportSpec) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *SmbStorageImportSpec) validateShare(formats strfmt.Registry) error { - - if err := validate.Required("share", "body", m.Share); err != nil { - return err - } - - if m.Share != nil { - if err := m.Share.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -func (m *SmbStorageImportSpec) validateTag(formats strfmt.Registry) error { - - if err := validate.Required("tag", "body", m.Tag); err != nil { - return err - } - - return nil -} - -func (m *SmbStorageImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this smb storage import spec based on the context it is used -func (m *SmbStorageImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShare(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbStorageImportSpec) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *SmbStorageImportSpec) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *SmbStorageImportSpec) contextValidateShare(ctx context.Context, formats strfmt.Registry) error { - - if m.Share != nil { - if err := m.Share.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -func (m *SmbStorageImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmbStorageImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmbStorageImportSpec) UnmarshalBinary(b []byte) error { - var res SmbStorageImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/smb_storage_model.go b/models/smb_storage_model.go deleted file mode 100644 index c883a49..0000000 --- a/models/smb_storage_model.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SmbStorageModel Network attached storage. -// -// swagger:model SmbStorageModel -type SmbStorageModel struct { - RepositoryModel - - // mount server - // Required: true - MountServer *MountServerSettingsModel `json:"mountServer"` - - // repository - // Required: true - Repository *NetworkRepositorySettingsModel `json:"repository"` - - // share - // Required: true - Share *SmbRepositoryShareSettingsModel `json:"share"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *SmbStorageModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RepositoryModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RepositoryModel = aO0 - - // AO1 - var dataAO1 struct { - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *NetworkRepositorySettingsModel `json:"repository"` - - Share *SmbRepositoryShareSettingsModel `json:"share"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.MountServer = dataAO1.MountServer - - m.Repository = dataAO1.Repository - - m.Share = dataAO1.Share - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m SmbStorageModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.RepositoryModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *NetworkRepositorySettingsModel `json:"repository"` - - Share *SmbRepositoryShareSettingsModel `json:"share"` - } - - dataAO1.MountServer = m.MountServer - - dataAO1.Repository = m.Repository - - dataAO1.Share = m.Share - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this smb storage model -func (m *SmbStorageModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositoryModel - if err := m.RepositoryModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShare(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbStorageModel) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *SmbStorageModel) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *SmbStorageModel) validateShare(formats strfmt.Registry) error { - - if err := validate.Required("share", "body", m.Share); err != nil { - return err - } - - if m.Share != nil { - if err := m.Share.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -// ContextValidate validate this smb storage model based on the context it is used -func (m *SmbStorageModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositoryModel - if err := m.RepositoryModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShare(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbStorageModel) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *SmbStorageModel) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *SmbStorageModel) contextValidateShare(ctx context.Context, formats strfmt.Registry) error { - - if m.Share != nil { - if err := m.Share.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmbStorageModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmbStorageModel) UnmarshalBinary(b []byte) error { - var res SmbStorageModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/smb_storage_spec.go b/models/smb_storage_spec.go deleted file mode 100644 index bbd121a..0000000 --- a/models/smb_storage_spec.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SmbStorageSpec smb storage spec -// -// swagger:model SmbStorageSpec -type SmbStorageSpec struct { - RepositorySpec - - // mount server - // Required: true - MountServer *MountServerSettingsModel `json:"mountServer"` - - // repository - // Required: true - Repository *NetworkRepositorySettingsModel `json:"repository"` - - // share - // Required: true - Share *SmbRepositoryShareSettingsModel `json:"share"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *SmbStorageSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RepositorySpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RepositorySpec = aO0 - - // AO1 - var dataAO1 struct { - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *NetworkRepositorySettingsModel `json:"repository"` - - Share *SmbRepositoryShareSettingsModel `json:"share"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.MountServer = dataAO1.MountServer - - m.Repository = dataAO1.Repository - - m.Share = dataAO1.Share - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m SmbStorageSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.RepositorySpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *NetworkRepositorySettingsModel `json:"repository"` - - Share *SmbRepositoryShareSettingsModel `json:"share"` - } - - dataAO1.MountServer = m.MountServer - - dataAO1.Repository = m.Repository - - dataAO1.Share = m.Share - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this smb storage spec -func (m *SmbStorageSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositorySpec - if err := m.RepositorySpec.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShare(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbStorageSpec) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *SmbStorageSpec) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *SmbStorageSpec) validateShare(formats strfmt.Registry) error { - - if err := validate.Required("share", "body", m.Share); err != nil { - return err - } - - if m.Share != nil { - if err := m.Share.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -// ContextValidate validate this smb storage spec based on the context it is used -func (m *SmbStorageSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositorySpec - if err := m.RepositorySpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShare(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmbStorageSpec) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *SmbStorageSpec) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *SmbStorageSpec) contextValidateShare(ctx context.Context, formats strfmt.Registry) error { - - if m.Share != nil { - if err := m.Share.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("share") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmbStorageSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmbStorageSpec) UnmarshalBinary(b []byte) error { - var res SmbStorageSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/standard_credentials_model.go b/models/standard_credentials_model.go deleted file mode 100644 index 3f3497e..0000000 --- a/models/standard_credentials_model.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StandardCredentialsModel standard credentials model -// -// swagger:model StandardCredentialsModel -type StandardCredentialsModel struct { - CredentialsModel - - // Tag used to identify the credentials record. - Tag string `json:"tag,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *StandardCredentialsModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 CredentialsModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.CredentialsModel = aO0 - - // AO1 - var dataAO1 struct { - Tag string `json:"tag,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Tag = dataAO1.Tag - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m StandardCredentialsModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.CredentialsModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Tag string `json:"tag,omitempty"` - } - - dataAO1.Tag = m.Tag - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this standard credentials model -func (m *StandardCredentialsModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CredentialsModel - if err := m.CredentialsModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this standard credentials model based on the context it is used -func (m *StandardCredentialsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CredentialsModel - if err := m.CredentialsModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *StandardCredentialsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StandardCredentialsModel) UnmarshalBinary(b []byte) error { - var res StandardCredentialsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/standard_credentials_spec.go b/models/standard_credentials_spec.go deleted file mode 100644 index f51ddd7..0000000 --- a/models/standard_credentials_spec.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// StandardCredentialsSpec standard credentials spec -// -// swagger:model StandardCredentialsSpec -type StandardCredentialsSpec struct { - CredentialsSpec - - // Tag used to identify the credentials record. - Tag string `json:"tag,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *StandardCredentialsSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 CredentialsSpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.CredentialsSpec = aO0 - - // AO1 - var dataAO1 struct { - Tag string `json:"tag,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Tag = dataAO1.Tag - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m StandardCredentialsSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.CredentialsSpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Tag string `json:"tag,omitempty"` - } - - dataAO1.Tag = m.Tag - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this standard credentials spec -func (m *StandardCredentialsSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CredentialsSpec - if err := m.CredentialsSpec.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this standard credentials spec based on the context it is used -func (m *StandardCredentialsSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CredentialsSpec - if err := m.CredentialsSpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *StandardCredentialsSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StandardCredentialsSpec) UnmarshalBinary(b []byte) error { - var res StandardCredentialsSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/synthetic_full_settings_model.go b/models/synthetic_full_settings_model.go deleted file mode 100644 index 4eb745e..0000000 --- a/models/synthetic_full_settings_model.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SyntheticFullSettingsModel Synthetic full backup settings. -// -// swagger:model SyntheticFullSettingsModel -type SyntheticFullSettingsModel struct { - - // Days of the week when Veeam Backup & Replication creates a synthetic full backup. - // Unique: true - Days []EDayOfWeek `json:"days"` - - // If *true*, synthetic full backups are enabled. - // Required: true - IsEnabled *bool `json:"isEnabled"` -} - -// Validate validates this synthetic full settings model -func (m *SyntheticFullSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDays(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SyntheticFullSettingsModel) validateDays(formats strfmt.Registry) error { - if swag.IsZero(m.Days) { // not required - return nil - } - - if err := validate.UniqueItems("days", "body", m.Days); err != nil { - return err - } - - for i := 0; i < len(m.Days); i++ { - - if err := m.Days[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("days" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *SyntheticFullSettingsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this synthetic full settings model based on the context it is used -func (m *SyntheticFullSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDays(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SyntheticFullSettingsModel) contextValidateDays(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Days); i++ { - - if err := m.Days[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("days" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SyntheticFullSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SyntheticFullSettingsModel) UnmarshalBinary(b []byte) error { - var res SyntheticFullSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/token_login_spec.go b/models/token_login_spec.go deleted file mode 100644 index 3d560d6..0000000 --- a/models/token_login_spec.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TokenLoginSpec token login spec -// -// swagger:model TokenLoginSpec -type TokenLoginSpec struct { - - // Authorization code. Required if the `grant_type` value is `authorization_code`. - Code string `json:"code,omitempty"` - - // grant type - // Required: true - GrantType *ELoginGrantType `json:"grant_type"` - - // Password. Required if the `grant_type` value is `password`. - // Format: password - Password strfmt.Password `json:"password,omitempty"` - - // Refresh token. Required if the `grant_type` value is `refresh_token`. - RefreshToken string `json:"refresh_token,omitempty"` - - // If *true*, a short-term refresh token is used. Lifetime of the short-term refresh token is the access token lifetime plus 15 minutes. - UseShortTermRefresh bool `json:"use_short_term_refresh,omitempty"` - - // User name. Required if the `grant_type` value is `password`. - Username string `json:"username,omitempty"` -} - -// Validate validates this token login spec -func (m *TokenLoginSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGrantType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassword(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TokenLoginSpec) validateGrantType(formats strfmt.Registry) error { - - if err := validate.Required("grant_type", "body", m.GrantType); err != nil { - return err - } - - if err := validate.Required("grant_type", "body", m.GrantType); err != nil { - return err - } - - if m.GrantType != nil { - if err := m.GrantType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_type") - } - return err - } - } - - return nil -} - -func (m *TokenLoginSpec) validatePassword(formats strfmt.Registry) error { - if swag.IsZero(m.Password) { // not required - return nil - } - - if err := validate.FormatOf("password", "body", "password", m.Password.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this token login spec based on the context it is used -func (m *TokenLoginSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGrantType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TokenLoginSpec) contextValidateGrantType(ctx context.Context, formats strfmt.Registry) error { - - if m.GrantType != nil { - if err := m.GrantType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TokenLoginSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TokenLoginSpec) UnmarshalBinary(b []byte) error { - var res TokenLoginSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/token_model.go b/models/token_model.go deleted file mode 100644 index 5517d62..0000000 --- a/models/token_model.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TokenModel token model -// -// swagger:model TokenModel -type TokenModel struct { - - // Date and time the access token expires. - // Required: true - // Format: date-time - Expires *strfmt.DateTime `json:".expires"` - - // Date and time the access token is issued. - // Required: true - // Format: date-time - Issued *strfmt.DateTime `json:".issued"` - - // String that represents authorization issued to the client. It must be specified in all requests. An access token can be used multiple times, but its lifetime is 15 minutes. - // Required: true - AccessToken *string `json:"access_token"` - - // Lifetime of the access token, in seconds. - // Required: true - ExpiresIn *int32 `json:"expires_in"` - - // String that is used to obtain a new access token if the current access token expires or becomes lost. A refresh token can be used only once, and its default lifetime is 14 days. - // Required: true - RefreshToken *string `json:"refresh_token"` - - // Type of the access token. - // Required: true - TokenType *string `json:"token_type"` -} - -// Validate validates this token model -func (m *TokenModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpires(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssued(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAccessToken(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpiresIn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRefreshToken(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTokenType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TokenModel) validateExpires(formats strfmt.Registry) error { - - if err := validate.Required(".expires", "body", m.Expires); err != nil { - return err - } - - if err := validate.FormatOf(".expires", "body", "date-time", m.Expires.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TokenModel) validateIssued(formats strfmt.Registry) error { - - if err := validate.Required(".issued", "body", m.Issued); err != nil { - return err - } - - if err := validate.FormatOf(".issued", "body", "date-time", m.Issued.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TokenModel) validateAccessToken(formats strfmt.Registry) error { - - if err := validate.Required("access_token", "body", m.AccessToken); err != nil { - return err - } - - return nil -} - -func (m *TokenModel) validateExpiresIn(formats strfmt.Registry) error { - - if err := validate.Required("expires_in", "body", m.ExpiresIn); err != nil { - return err - } - - return nil -} - -func (m *TokenModel) validateRefreshToken(formats strfmt.Registry) error { - - if err := validate.Required("refresh_token", "body", m.RefreshToken); err != nil { - return err - } - - return nil -} - -func (m *TokenModel) validateTokenType(formats strfmt.Registry) error { - - if err := validate.Required("token_type", "body", m.TokenType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this token model based on context it is used -func (m *TokenModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TokenModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TokenModel) UnmarshalBinary(b []byte) error { - var res TokenModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/traffic_rule_model.go b/models/traffic_rule_model.go deleted file mode 100644 index df05613..0000000 --- a/models/traffic_rule_model.go +++ /dev/null @@ -1,256 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TrafficRuleModel traffic rule model -// -// swagger:model TrafficRuleModel -type TrafficRuleModel struct { - - // If *true*, traffic encryption is enabled. - EncryptionEnabled bool `json:"encryptionEnabled,omitempty"` - - // ID of the rule. - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Name of the rule. - // Required: true - Name *string `json:"name"` - - // End IP address of the range for the backup infrastructure components on the source side. - // Required: true - SourceIPEnd *string `json:"sourceIPEnd"` - - // Start IP address of the range for the backup infrastructure components on the source side. - // Required: true - SourceIPStart *string `json:"sourceIPStart"` - - // End IP address of the range for the backup infrastructure components on the target side. - // Required: true - TargetIPEnd *string `json:"targetIPEnd"` - - // Start IP address of the range for the backup infrastructure components on the target side. - // Required: true - TargetIPStart *string `json:"targetIPStart"` - - // If *true*, traffic throttling is enabled. - ThrottlingEnabled bool `json:"throttlingEnabled,omitempty"` - - // throttling unit - ThrottlingUnit ESpeedUnit `json:"throttlingUnit,omitempty"` - - // Maximum speed that must be used to transfer data from source to target. - ThrottlingValue int32 `json:"throttlingValue,omitempty"` - - // If *true*, throttling window during which the speed must be limited is enabled. - ThrottlingWindowEnabled bool `json:"throttlingWindowEnabled,omitempty"` - - // throttling window options - ThrottlingWindowOptions *BackupWindowSettingModel `json:"throttlingWindowOptions,omitempty"` -} - -// Validate validates this traffic rule model -func (m *TrafficRuleModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSourceIPEnd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSourceIPStart(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTargetIPEnd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTargetIPStart(formats); err != nil { - res = append(res, err) - } - - if err := m.validateThrottlingUnit(formats); err != nil { - res = append(res, err) - } - - if err := m.validateThrottlingWindowOptions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TrafficRuleModel) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required - return nil - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TrafficRuleModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *TrafficRuleModel) validateSourceIPEnd(formats strfmt.Registry) error { - - if err := validate.Required("sourceIPEnd", "body", m.SourceIPEnd); err != nil { - return err - } - - return nil -} - -func (m *TrafficRuleModel) validateSourceIPStart(formats strfmt.Registry) error { - - if err := validate.Required("sourceIPStart", "body", m.SourceIPStart); err != nil { - return err - } - - return nil -} - -func (m *TrafficRuleModel) validateTargetIPEnd(formats strfmt.Registry) error { - - if err := validate.Required("targetIPEnd", "body", m.TargetIPEnd); err != nil { - return err - } - - return nil -} - -func (m *TrafficRuleModel) validateTargetIPStart(formats strfmt.Registry) error { - - if err := validate.Required("targetIPStart", "body", m.TargetIPStart); err != nil { - return err - } - - return nil -} - -func (m *TrafficRuleModel) validateThrottlingUnit(formats strfmt.Registry) error { - if swag.IsZero(m.ThrottlingUnit) { // not required - return nil - } - - if err := m.ThrottlingUnit.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("throttlingUnit") - } - return err - } - - return nil -} - -func (m *TrafficRuleModel) validateThrottlingWindowOptions(formats strfmt.Registry) error { - if swag.IsZero(m.ThrottlingWindowOptions) { // not required - return nil - } - - if m.ThrottlingWindowOptions != nil { - if err := m.ThrottlingWindowOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("throttlingWindowOptions") - } - return err - } - } - - return nil -} - -// ContextValidate validate this traffic rule model based on the context it is used -func (m *TrafficRuleModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateThrottlingUnit(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateThrottlingWindowOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TrafficRuleModel) contextValidateThrottlingUnit(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ThrottlingUnit.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("throttlingUnit") - } - return err - } - - return nil -} - -func (m *TrafficRuleModel) contextValidateThrottlingWindowOptions(ctx context.Context, formats strfmt.Registry) error { - - if m.ThrottlingWindowOptions != nil { - if err := m.ThrottlingWindowOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("throttlingWindowOptions") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TrafficRuleModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TrafficRuleModel) UnmarshalBinary(b []byte) error { - var res TrafficRuleModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/v_center_inventory_filters.go b/models/v_center_inventory_filters.go deleted file mode 100644 index 9b0f6c2..0000000 --- a/models/v_center_inventory_filters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VCenterInventoryFilters v center inventory filters -// -// swagger:model VCenterInventoryFilters -type VCenterInventoryFilters struct { - - // hierarchy type filter - HierarchyTypeFilter EHierarchyType `json:"hierarchyTypeFilter,omitempty"` - - // Maximum number of objects to return. - Limit int32 `json:"limit,omitempty"` - - // Filters objects by the `nameFilter` pattern. The pattern can match any object parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - NameFilter string `json:"nameFilter,omitempty"` - - // Filters objects by object ID. - ObjectIDFilter string `json:"objectIdFilter,omitempty"` - - // Sorts objects in the ascending order by the `orderColumn` parameter. - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EvCentersInventoryFiltersOrderColumn `json:"orderColumn,omitempty"` - - // Filters objects by name of the parent container. - ParentContainerNameFilter string `json:"parentContainerNameFilter,omitempty"` - - // Number of objects to skip. - Skip int32 `json:"skip,omitempty"` - - // type filter - TypeFilter EVmwareInventoryType `json:"typeFilter,omitempty"` -} - -// Validate validates this v center inventory filters -func (m *VCenterInventoryFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHierarchyTypeFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeFilter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VCenterInventoryFilters) validateHierarchyTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.HierarchyTypeFilter) { // not required - return nil - } - - if err := m.HierarchyTypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hierarchyTypeFilter") - } - return err - } - - return nil -} - -func (m *VCenterInventoryFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *VCenterInventoryFilters) validateTypeFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TypeFilter) { // not required - return nil - } - - if err := m.TypeFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// ContextValidate validate this v center inventory filters based on the context it is used -func (m *VCenterInventoryFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateHierarchyTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeFilter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VCenterInventoryFilters) contextValidateHierarchyTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.HierarchyTypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hierarchyTypeFilter") - } - return err - } - - return nil -} - -func (m *VCenterInventoryFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -func (m *VCenterInventoryFilters) contextValidateTypeFilter(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeFilter") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VCenterInventoryFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VCenterInventoryFilters) UnmarshalBinary(b []byte) error { - var res VCenterInventoryFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/v_center_inventory_result.go b/models/v_center_inventory_result.go deleted file mode 100644 index 41fb548..0000000 --- a/models/v_center_inventory_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VCenterInventoryResult v center inventory result -// -// swagger:model VCenterInventoryResult -type VCenterInventoryResult struct { - - // Array of vCenter Servers. - // Required: true - Data []*VmwareObjectSizeModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this v center inventory result -func (m *VCenterInventoryResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VCenterInventoryResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *VCenterInventoryResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this v center inventory result based on the context it is used -func (m *VCenterInventoryResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VCenterInventoryResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *VCenterInventoryResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VCenterInventoryResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VCenterInventoryResult) UnmarshalBinary(b []byte) error { - var res VCenterInventoryResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/v_power_n_f_s_port_settings_model.go b/models/v_power_n_f_s_port_settings_model.go deleted file mode 100644 index 9f8722e..0000000 --- a/models/v_power_n_f_s_port_settings_model.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VPowerNFSPortSettingsModel Network ports used by the vPower NFS Service. -// -// swagger:model VPowerNFSPortSettingsModel -type VPowerNFSPortSettingsModel struct { - - // Mount port. - MountPort int64 `json:"mountPort,omitempty"` - - // vPower NFS port. - VPowerNFSPort int64 `json:"vPowerNFSPort,omitempty"` -} - -// Validate validates this v power n f s port settings model -func (m *VPowerNFSPortSettingsModel) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this v power n f s port settings model based on context it is used -func (m *VPowerNFSPortSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VPowerNFSPortSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VPowerNFSPortSettingsModel) UnmarshalBinary(b []byte) error { - var res VPowerNFSPortSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/v_sphere_changed_block_tracking_settings_model.go b/models/v_sphere_changed_block_tracking_settings_model.go deleted file mode 100644 index 08f7b37..0000000 --- a/models/v_sphere_changed_block_tracking_settings_model.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VSphereChangedBlockTrackingSettingsModel CBT settings for the backup job. -// -// swagger:model VSphereChangedBlockTrackingSettingsModel -type VSphereChangedBlockTrackingSettingsModel struct { - - // If *true*, CBT is enabled for all processed VMs even if CBT is disabled in VM configuration. CBT is used for VMs with virtual hardware version 7 or later. These VMs must not have existing snapshots. - EnableCBTautomatically bool `json:"enableCBTautomatically,omitempty"` - - // If *true*, CBT data is used. - // Required: true - IsEnabled *bool `json:"isEnabled"` - - // If *true*, CBT is reset before creating active full backups. - ResetCBTonActiveFull bool `json:"resetCBTonActiveFull,omitempty"` -} - -// Validate validates this v sphere changed block tracking settings model -func (m *VSphereChangedBlockTrackingSettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsEnabled(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VSphereChangedBlockTrackingSettingsModel) validateIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isEnabled", "body", m.IsEnabled); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this v sphere changed block tracking settings model based on context it is used -func (m *VSphereChangedBlockTrackingSettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VSphereChangedBlockTrackingSettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VSphereChangedBlockTrackingSettingsModel) UnmarshalBinary(b []byte) error { - var res VSphereChangedBlockTrackingSettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vi_backup_object_model.go b/models/vi_backup_object_model.go deleted file mode 100644 index 4deb179..0000000 --- a/models/vi_backup_object_model.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ViBackupObjectModel vi backup object model -// -// swagger:model ViBackupObjectModel -type ViBackupObjectModel struct { - BackupObjectModel - - // ID of the virtual infrastructure object: mo-ref or ID, depending on the virtualization platform. - // - ObjectID string `json:"objectId,omitempty"` - - // Path to the object. - Path string `json:"path,omitempty"` - - // vi type - ViType EVmwareInventoryType `json:"viType,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ViBackupObjectModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BackupObjectModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BackupObjectModel = aO0 - - // AO1 - var dataAO1 struct { - ObjectID string `json:"objectId,omitempty"` - - Path string `json:"path,omitempty"` - - ViType EVmwareInventoryType `json:"viType,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.ObjectID = dataAO1.ObjectID - - m.Path = dataAO1.Path - - m.ViType = dataAO1.ViType - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ViBackupObjectModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BackupObjectModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - ObjectID string `json:"objectId,omitempty"` - - Path string `json:"path,omitempty"` - - ViType EVmwareInventoryType `json:"viType,omitempty"` - } - - dataAO1.ObjectID = m.ObjectID - - dataAO1.Path = m.Path - - dataAO1.ViType = m.ViType - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this vi backup object model -func (m *ViBackupObjectModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BackupObjectModel - if err := m.BackupObjectModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViBackupObjectModel) validateViType(formats strfmt.Registry) error { - - if swag.IsZero(m.ViType) { // not required - return nil - } - - if err := m.ViType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viType") - } - return err - } - - return nil -} - -// ContextValidate validate this vi backup object model based on the context it is used -func (m *ViBackupObjectModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BackupObjectModel - if err := m.BackupObjectModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateViType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViBackupObjectModel) contextValidateViType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ViType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ViBackupObjectModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ViBackupObjectModel) UnmarshalBinary(b []byte) error { - var res ViBackupObjectModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vi_host_import_spec.go b/models/vi_host_import_spec.go deleted file mode 100644 index b574c2c..0000000 --- a/models/vi_host_import_spec.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ViHostImportSpec vi host import spec -// -// swagger:model ViHostImportSpec -type ViHostImportSpec struct { - - // [Optional] Certificate thumbprint used to verify the server identity. - // - CertificateThumbprint string `json:"certificateThumbprint,omitempty"` - - // credentials - // Required: true - Credentials *CredentialsImportModel `json:"credentials"` - - // Description of the server. - // Required: true - Description *string `json:"description"` - - // Full DNS name or IP address of the server. - // Required: true - Name *string `json:"name"` - - // Port used to communicate with the server. - Port int64 `json:"port,omitempty"` - - // type - // Required: true - Type *EManagedServerType `json:"type"` - - // vi host type - // Required: true - ViHostType *EViHostType `json:"viHostType"` -} - -// Validate validates this vi host import spec -func (m *ViHostImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViHostType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViHostImportSpec) validateCredentials(formats strfmt.Registry) error { - - if err := validate.Required("credentials", "body", m.Credentials); err != nil { - return err - } - - if m.Credentials != nil { - if err := m.Credentials.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *ViHostImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ViHostImportSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ViHostImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *ViHostImportSpec) validateViHostType(formats strfmt.Registry) error { - - if err := validate.Required("viHostType", "body", m.ViHostType); err != nil { - return err - } - - if err := validate.Required("viHostType", "body", m.ViHostType); err != nil { - return err - } - - if m.ViHostType != nil { - if err := m.ViHostType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viHostType") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vi host import spec based on the context it is used -func (m *ViHostImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCredentials(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateViHostType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViHostImportSpec) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { - - if m.Credentials != nil { - if err := m.Credentials.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *ViHostImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *ViHostImportSpec) contextValidateViHostType(ctx context.Context, formats strfmt.Registry) error { - - if m.ViHostType != nil { - if err := m.ViHostType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viHostType") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ViHostImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ViHostImportSpec) UnmarshalBinary(b []byte) error { - var res ViHostImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vi_host_model.go b/models/vi_host_model.go deleted file mode 100644 index fb9a79a..0000000 --- a/models/vi_host_model.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ViHostModel vi host model -// -// swagger:model ViHostModel -type ViHostModel struct { - ManagedServerModel - - // Port used to communicate with the server. - // Required: true - Port *int64 `json:"port"` - - // vi host type - ViHostType EViHostType `json:"viHostType,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ViHostModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ManagedServerModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ManagedServerModel = aO0 - - // AO1 - var dataAO1 struct { - Port *int64 `json:"port"` - - ViHostType EViHostType `json:"viHostType,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Port = dataAO1.Port - - m.ViHostType = dataAO1.ViHostType - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ViHostModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ManagedServerModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Port *int64 `json:"port"` - - ViHostType EViHostType `json:"viHostType,omitempty"` - } - - dataAO1.Port = m.Port - - dataAO1.ViHostType = m.ViHostType - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this vi host model -func (m *ViHostModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerModel - if err := m.ManagedServerModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePort(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViHostType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViHostModel) validatePort(formats strfmt.Registry) error { - - if err := validate.Required("port", "body", m.Port); err != nil { - return err - } - - return nil -} - -func (m *ViHostModel) validateViHostType(formats strfmt.Registry) error { - - if swag.IsZero(m.ViHostType) { // not required - return nil - } - - if err := m.ViHostType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viHostType") - } - return err - } - - return nil -} - -// ContextValidate validate this vi host model based on the context it is used -func (m *ViHostModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerModel - if err := m.ManagedServerModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateViHostType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViHostModel) contextValidateViHostType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ViHostType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("viHostType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ViHostModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ViHostModel) UnmarshalBinary(b []byte) error { - var res ViHostModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vi_host_spec.go b/models/vi_host_spec.go deleted file mode 100644 index 63fef40..0000000 --- a/models/vi_host_spec.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ViHostSpec vi host spec -// -// swagger:model ViHostSpec -type ViHostSpec struct { - ManagedServerSpec - - // [Optional] Certificate thumbprint used to verify the server identity. For details on how to get the thumbprint, see [Get TLS Certificate or SSH Fingerprint](#operation/GetConnectionCertificate). - // - CertificateThumbprint string `json:"certificateThumbprint,omitempty"` - - // Port used to communicate with the server. - Port int64 `json:"port,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ViHostSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ManagedServerSpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ManagedServerSpec = aO0 - - // AO1 - var dataAO1 struct { - CertificateThumbprint string `json:"certificateThumbprint,omitempty"` - - Port int64 `json:"port,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.CertificateThumbprint = dataAO1.CertificateThumbprint - - m.Port = dataAO1.Port - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ViHostSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ManagedServerSpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - CertificateThumbprint string `json:"certificateThumbprint,omitempty"` - - Port int64 `json:"port,omitempty"` - } - - dataAO1.CertificateThumbprint = m.CertificateThumbprint - - dataAO1.Port = m.Port - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this vi host spec -func (m *ViHostSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerSpec - if err := m.ManagedServerSpec.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this vi host spec based on the context it is used -func (m *ViHostSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerSpec - if err := m.ManagedServerSpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ViHostSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ViHostSpec) UnmarshalBinary(b []byte) error { - var res ViHostSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vi_proxy_model.go b/models/vi_proxy_model.go deleted file mode 100644 index e37b3c0..0000000 --- a/models/vi_proxy_model.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ViProxyModel vi proxy model -// -// swagger:model ViProxyModel -type ViProxyModel struct { - ProxyModel - - // server - // Required: true - Server *ProxyServerSettingsModel `json:"server"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ViProxyModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ProxyModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ProxyModel = aO0 - - // AO1 - var dataAO1 struct { - Server *ProxyServerSettingsModel `json:"server"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Server = dataAO1.Server - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ViProxyModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ProxyModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Server *ProxyServerSettingsModel `json:"server"` - } - - dataAO1.Server = m.Server - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this vi proxy model -func (m *ViProxyModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ProxyModel - if err := m.ProxyModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServer(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViProxyModel) validateServer(formats strfmt.Registry) error { - - if err := validate.Required("server", "body", m.Server); err != nil { - return err - } - - if m.Server != nil { - if err := m.Server.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("server") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vi proxy model based on the context it is used -func (m *ViProxyModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ProxyModel - if err := m.ProxyModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServer(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViProxyModel) contextValidateServer(ctx context.Context, formats strfmt.Registry) error { - - if m.Server != nil { - if err := m.Server.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("server") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ViProxyModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ViProxyModel) UnmarshalBinary(b []byte) error { - var res ViProxyModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vi_proxy_spec.go b/models/vi_proxy_spec.go deleted file mode 100644 index 1a28934..0000000 --- a/models/vi_proxy_spec.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ViProxySpec vi proxy spec -// -// swagger:model ViProxySpec -type ViProxySpec struct { - ProxySpec - - // server - // Required: true - Server *ProxyServerSettingsModel `json:"server"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ViProxySpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ProxySpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ProxySpec = aO0 - - // AO1 - var dataAO1 struct { - Server *ProxyServerSettingsModel `json:"server"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Server = dataAO1.Server - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ViProxySpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ProxySpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Server *ProxyServerSettingsModel `json:"server"` - } - - dataAO1.Server = m.Server - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this vi proxy spec -func (m *ViProxySpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ProxySpec - if err := m.ProxySpec.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServer(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViProxySpec) validateServer(formats strfmt.Registry) error { - - if err := validate.Required("server", "body", m.Server); err != nil { - return err - } - - if m.Server != nil { - if err := m.Server.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("server") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vi proxy spec based on the context it is used -func (m *ViProxySpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ProxySpec - if err := m.ProxySpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServer(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViProxySpec) contextValidateServer(ctx context.Context, formats strfmt.Registry) error { - - if m.Server != nil { - if err := m.Server.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("server") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ViProxySpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ViProxySpec) UnmarshalBinary(b []byte) error { - var res ViProxySpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vi_root_filters.go b/models/vi_root_filters.go deleted file mode 100644 index eed2c85..0000000 --- a/models/vi_root_filters.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ViRootFilters vi root filters -// -// swagger:model ViRootFilters -type ViRootFilters struct { - - // Maximum number of VMware vSphere servers to return. - Limit int32 `json:"limit,omitempty"` - - // Filters VMware vSphere servers by the `nameFilter` pattern. The pattern can match any VMware vSphere server parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end. - NameFilter string `json:"nameFilter,omitempty"` - - // Sorts VMware vSphere servers in the ascending order by the `orderColumn` parameter. - OrderAsc bool `json:"orderAsc,omitempty"` - - // order column - OrderColumn EViRootFiltersOrderColumn `json:"orderColumn,omitempty"` - - // Number of VMware vSphere servers to skip. - Skip int32 `json:"skip,omitempty"` -} - -// Validate validates this vi root filters -func (m *ViRootFilters) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOrderColumn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViRootFilters) validateOrderColumn(formats strfmt.Registry) error { - if swag.IsZero(m.OrderColumn) { // not required - return nil - } - - if err := m.OrderColumn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// ContextValidate validate this vi root filters based on the context it is used -func (m *ViRootFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOrderColumn(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViRootFilters) contextValidateOrderColumn(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OrderColumn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orderColumn") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ViRootFilters) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ViRootFilters) UnmarshalBinary(b []byte) error { - var res ViRootFilters - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vi_roots_result.go b/models/vi_roots_result.go deleted file mode 100644 index 18a3086..0000000 --- a/models/vi_roots_result.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ViRootsResult vi roots result -// -// swagger:model ViRootsResult -type ViRootsResult struct { - - // Array of VMware vSphere servers. - // Required: true - Data []*VmwareObjectSizeModel `json:"data"` - - // pagination - // Required: true - Pagination *PaginationResult `json:"pagination"` -} - -// Validate validates this vi roots result -func (m *ViRootsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViRootsResult) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ViRootsResult) validatePagination(formats strfmt.Registry) error { - - if err := validate.Required("pagination", "body", m.Pagination); err != nil { - return err - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vi roots result based on the context it is used -func (m *ViRootsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ViRootsResult) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ViRootsResult) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ViRootsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ViRootsResult) UnmarshalBinary(b []byte) error { - var res ViRootsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmb_api_filter_model.go b/models/vmb_api_filter_model.go deleted file mode 100644 index 120ad1e..0000000 --- a/models/vmb_api_filter_model.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmbAPIFilterModel vmb Api filter model -// -// swagger:model VmbApiFilterModel -type VmbAPIFilterModel struct { - - // assembly version - // Required: true - AssemblyVersion *string `json:"assemblyVersion"` - - // product Id - // Required: true - // Format: uuid - ProductID *strfmt.UUID `json:"productId"` - - // protocol version - // Required: true - ProtocolVersion *int64 `json:"protocolVersion"` - - // version flags - // Required: true - VersionFlags *int64 `json:"versionFlags"` -} - -// Validate validates this vmb Api filter model -func (m *VmbAPIFilterModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAssemblyVersion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProductID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProtocolVersion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersionFlags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmbAPIFilterModel) validateAssemblyVersion(formats strfmt.Registry) error { - - if err := validate.Required("assemblyVersion", "body", m.AssemblyVersion); err != nil { - return err - } - - return nil -} - -func (m *VmbAPIFilterModel) validateProductID(formats strfmt.Registry) error { - - if err := validate.Required("productId", "body", m.ProductID); err != nil { - return err - } - - if err := validate.FormatOf("productId", "body", "uuid", m.ProductID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VmbAPIFilterModel) validateProtocolVersion(formats strfmt.Registry) error { - - if err := validate.Required("protocolVersion", "body", m.ProtocolVersion); err != nil { - return err - } - - return nil -} - -func (m *VmbAPIFilterModel) validateVersionFlags(formats strfmt.Registry) error { - - if err := validate.Required("versionFlags", "body", m.VersionFlags); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this vmb Api filter model based on context it is used -func (m *VmbAPIFilterModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VmbAPIFilterModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmbAPIFilterModel) UnmarshalBinary(b []byte) error { - var res VmbAPIFilterModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_fcd_instant_recovery_disk_info.go b/models/vmware_fcd_instant_recovery_disk_info.go deleted file mode 100644 index 84fa03c..0000000 --- a/models/vmware_fcd_instant_recovery_disk_info.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmwareFcdInstantRecoveryDiskInfo vmware fcd instant recovery disk info -// -// swagger:model VmwareFcdInstantRecoveryDiskInfo -type VmwareFcdInstantRecoveryDiskInfo struct { - - // Name of the VMDK file that is stored in the datastore. - // Required: true - MountedDiskName *string `json:"mountedDiskName"` - - // Disk name displayed in the backup. - // Required: true - NameInBackup *string `json:"nameInBackup"` - - // FCD ID. - // Required: true - ObjectID *string `json:"objectId"` - - // Name under which the disk is registered as an FCD in the vCenter Managed Object Browser. - // Required: true - RegisteredFcdName *string `json:"registeredFcdName"` -} - -// Validate validates this vmware fcd instant recovery disk info -func (m *VmwareFcdInstantRecoveryDiskInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMountedDiskName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNameInBackup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObjectID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegisteredFcdName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdInstantRecoveryDiskInfo) validateMountedDiskName(formats strfmt.Registry) error { - - if err := validate.Required("mountedDiskName", "body", m.MountedDiskName); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryDiskInfo) validateNameInBackup(formats strfmt.Registry) error { - - if err := validate.Required("nameInBackup", "body", m.NameInBackup); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryDiskInfo) validateObjectID(formats strfmt.Registry) error { - - if err := validate.Required("objectId", "body", m.ObjectID); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryDiskInfo) validateRegisteredFcdName(formats strfmt.Registry) error { - - if err := validate.Required("registeredFcdName", "body", m.RegisteredFcdName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this vmware fcd instant recovery disk info based on context it is used -func (m *VmwareFcdInstantRecoveryDiskInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareFcdInstantRecoveryDiskInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareFcdInstantRecoveryDiskInfo) UnmarshalBinary(b []byte) error { - var res VmwareFcdInstantRecoveryDiskInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_fcd_instant_recovery_disk_spec.go b/models/vmware_fcd_instant_recovery_disk_spec.go deleted file mode 100644 index a9610c5..0000000 --- a/models/vmware_fcd_instant_recovery_disk_spec.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmwareFcdInstantRecoveryDiskSpec vmware fcd instant recovery disk spec -// -// swagger:model VmwareFcdInstantRecoveryDiskSpec -type VmwareFcdInstantRecoveryDiskSpec struct { - - // Name of the VMDK file that will be stored in the datastore. - // Required: true - MountedDiskName *string `json:"mountedDiskName"` - - // Disk name displayed in the backup. - // Required: true - NameInBackup *string `json:"nameInBackup"` - - // Name under which the disk will be registered as an FCD in the vCenter Managed Object Browser. - // Required: true - RegisteredFcdName *string `json:"registeredFcdName"` -} - -// Validate validates this vmware fcd instant recovery disk spec -func (m *VmwareFcdInstantRecoveryDiskSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMountedDiskName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNameInBackup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegisteredFcdName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdInstantRecoveryDiskSpec) validateMountedDiskName(formats strfmt.Registry) error { - - if err := validate.Required("mountedDiskName", "body", m.MountedDiskName); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryDiskSpec) validateNameInBackup(formats strfmt.Registry) error { - - if err := validate.Required("nameInBackup", "body", m.NameInBackup); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryDiskSpec) validateRegisteredFcdName(formats strfmt.Registry) error { - - if err := validate.Required("registeredFcdName", "body", m.RegisteredFcdName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this vmware fcd instant recovery disk spec based on context it is used -func (m *VmwareFcdInstantRecoveryDiskSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareFcdInstantRecoveryDiskSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareFcdInstantRecoveryDiskSpec) UnmarshalBinary(b []byte) error { - var res VmwareFcdInstantRecoveryDiskSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_fcd_instant_recovery_mount.go b/models/vmware_fcd_instant_recovery_mount.go deleted file mode 100644 index 211fe0a..0000000 --- a/models/vmware_fcd_instant_recovery_mount.go +++ /dev/null @@ -1,252 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmwareFcdInstantRecoveryMount vmware fcd instant recovery mount -// -// swagger:model VmwareFcdInstantRecoveryMount -type VmwareFcdInstantRecoveryMount struct { - - // error message - ErrorMessage string `json:"errorMessage,omitempty"` - - // Mount ID. - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Array of mounted disks. - MountedDisks []*VmwareFcdInstantRecoveryDiskInfo `json:"mountedDisks"` - - // ID of the restore session. Use the ID to track the progress. For details, see [Get Session](#operation/GetSession). - // Required: true - // Format: uuid - SessionID *strfmt.UUID `json:"sessionId"` - - // spec - // Required: true - Spec *VmwareFcdInstantRecoverySpec `json:"spec"` - - // state - // Required: true - State *EInstantRecoveryMountState `json:"state"` -} - -// Validate validates this vmware fcd instant recovery mount -func (m *VmwareFcdInstantRecoveryMount) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountedDisks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSessionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpec(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdInstantRecoveryMount) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryMount) validateMountedDisks(formats strfmt.Registry) error { - if swag.IsZero(m.MountedDisks) { // not required - return nil - } - - for i := 0; i < len(m.MountedDisks); i++ { - if swag.IsZero(m.MountedDisks[i]) { // not required - continue - } - - if m.MountedDisks[i] != nil { - if err := m.MountedDisks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountedDisks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryMount) validateSessionID(formats strfmt.Registry) error { - - if err := validate.Required("sessionId", "body", m.SessionID); err != nil { - return err - } - - if err := validate.FormatOf("sessionId", "body", "uuid", m.SessionID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryMount) validateSpec(formats strfmt.Registry) error { - - if err := validate.Required("spec", "body", m.Spec); err != nil { - return err - } - - if m.Spec != nil { - if err := m.Spec.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spec") - } - return err - } - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryMount) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if m.State != nil { - if err := m.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vmware fcd instant recovery mount based on the context it is used -func (m *VmwareFcdInstantRecoveryMount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMountedDisks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSpec(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdInstantRecoveryMount) contextValidateMountedDisks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.MountedDisks); i++ { - - if m.MountedDisks[i] != nil { - if err := m.MountedDisks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountedDisks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryMount) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error { - - if m.Spec != nil { - if err := m.Spec.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("spec") - } - return err - } - } - - return nil -} - -func (m *VmwareFcdInstantRecoveryMount) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if m.State != nil { - if err := m.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareFcdInstantRecoveryMount) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareFcdInstantRecoveryMount) UnmarshalBinary(b []byte) error { - var res VmwareFcdInstantRecoveryMount - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_fcd_instant_recovery_spec.go b/models/vmware_fcd_instant_recovery_spec.go deleted file mode 100644 index 63d40e9..0000000 --- a/models/vmware_fcd_instant_recovery_spec.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmwareFcdInstantRecoverySpec vmware fcd instant recovery spec -// -// swagger:model VmwareFcdInstantRecoverySpec -type VmwareFcdInstantRecoverySpec struct { - - // Destination cluster. - // Required: true - DestinationCluster struct { - VmwareObjectModel - } `json:"destinationCluster"` - - // Array of disks that will be restored. - // Required: true - DisksMapping []*VmwareFcdInstantRecoveryDiskSpec `json:"disksMapping"` - - // ID of the restore point. - // Required: true - // Format: uuid - ObjectRestorePointID *strfmt.UUID `json:"objectRestorePointId"` - - // write cache - WriteCache *VmwareFcdWriteCacheSpec `json:"writeCache,omitempty"` -} - -// Validate validates this vmware fcd instant recovery spec -func (m *VmwareFcdInstantRecoverySpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDestinationCluster(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDisksMapping(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObjectRestorePointID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWriteCache(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdInstantRecoverySpec) validateDestinationCluster(formats strfmt.Registry) error { - - return nil -} - -func (m *VmwareFcdInstantRecoverySpec) validateDisksMapping(formats strfmt.Registry) error { - - if err := validate.Required("disksMapping", "body", m.DisksMapping); err != nil { - return err - } - - for i := 0; i < len(m.DisksMapping); i++ { - if swag.IsZero(m.DisksMapping[i]) { // not required - continue - } - - if m.DisksMapping[i] != nil { - if err := m.DisksMapping[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disksMapping" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *VmwareFcdInstantRecoverySpec) validateObjectRestorePointID(formats strfmt.Registry) error { - - if err := validate.Required("objectRestorePointId", "body", m.ObjectRestorePointID); err != nil { - return err - } - - if err := validate.FormatOf("objectRestorePointId", "body", "uuid", m.ObjectRestorePointID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdInstantRecoverySpec) validateWriteCache(formats strfmt.Registry) error { - if swag.IsZero(m.WriteCache) { // not required - return nil - } - - if m.WriteCache != nil { - if err := m.WriteCache.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("writeCache") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vmware fcd instant recovery spec based on the context it is used -func (m *VmwareFcdInstantRecoverySpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationCluster(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDisksMapping(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWriteCache(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdInstantRecoverySpec) contextValidateDestinationCluster(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *VmwareFcdInstantRecoverySpec) contextValidateDisksMapping(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.DisksMapping); i++ { - - if m.DisksMapping[i] != nil { - if err := m.DisksMapping[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disksMapping" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *VmwareFcdInstantRecoverySpec) contextValidateWriteCache(ctx context.Context, formats strfmt.Registry) error { - - if m.WriteCache != nil { - if err := m.WriteCache.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("writeCache") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareFcdInstantRecoverySpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareFcdInstantRecoverySpec) UnmarshalBinary(b []byte) error { - var res VmwareFcdInstantRecoverySpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_fcd_quick_migration_spec.go b/models/vmware_fcd_quick_migration_spec.go deleted file mode 100644 index a25807c..0000000 --- a/models/vmware_fcd_quick_migration_spec.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VmwareFcdQuickMigrationSpec vmware fcd quick migration spec -// -// swagger:model VmwareFcdQuickMigrationSpec -type VmwareFcdQuickMigrationSpec struct { - - // Array of disks that will be migrated to the `targetDatastore` associated with the `storagePolicy`. - MountedDiskNames []string `json:"mountedDiskNames"` - - // Storage policy that will be applied to the migrated disks. For details on how to get a storage policy model, see [Get VMware vSphere Server Objects](#operation/GetVmwareHostObject). - StoragePolicy struct { - VmwareObjectModel - } `json:"storagePolicy,omitempty"` - - // Target datastore. For details on how to get a datastore model, see [Get VMware vSphere Server Objects](#operation/GetVmwareHostObject). - // Required: true - TargetDatastore struct { - VmwareObjectModel - } `json:"targetDatastore"` -} - -// Validate validates this vmware fcd quick migration spec -func (m *VmwareFcdQuickMigrationSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateStoragePolicy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTargetDatastore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdQuickMigrationSpec) validateStoragePolicy(formats strfmt.Registry) error { - if swag.IsZero(m.StoragePolicy) { // not required - return nil - } - - return nil -} - -func (m *VmwareFcdQuickMigrationSpec) validateTargetDatastore(formats strfmt.Registry) error { - - return nil -} - -// ContextValidate validate this vmware fcd quick migration spec based on the context it is used -func (m *VmwareFcdQuickMigrationSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStoragePolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTargetDatastore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdQuickMigrationSpec) contextValidateStoragePolicy(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *VmwareFcdQuickMigrationSpec) contextValidateTargetDatastore(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareFcdQuickMigrationSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareFcdQuickMigrationSpec) UnmarshalBinary(b []byte) error { - var res VmwareFcdQuickMigrationSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_fcd_write_cache_spec.go b/models/vmware_fcd_write_cache_spec.go deleted file mode 100644 index 5ea6d95..0000000 --- a/models/vmware_fcd_write_cache_spec.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmwareFcdWriteCacheSpec Write cache for recovered disks. -// -// swagger:model VmwareFcdWriteCacheSpec -type VmwareFcdWriteCacheSpec struct { - - // cache datastore - CacheDatastore *VmwareObjectModel `json:"cacheDatastore,omitempty"` - - // If *true*, cache redirection is enabled. In this case, all changes made to the recovered disks while the Instant FCD Recovery is active are redirected to the specified `cacheDatastore` associated with the `storagePolicy`. - // Required: true - RedirectIsEnabled *bool `json:"redirectIsEnabled"` - - // storage policy - StoragePolicy *VmwareObjectModel `json:"storagePolicy,omitempty"` -} - -// Validate validates this vmware fcd write cache spec -func (m *VmwareFcdWriteCacheSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCacheDatastore(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRedirectIsEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStoragePolicy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdWriteCacheSpec) validateCacheDatastore(formats strfmt.Registry) error { - if swag.IsZero(m.CacheDatastore) { // not required - return nil - } - - if m.CacheDatastore != nil { - if err := m.CacheDatastore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cacheDatastore") - } - return err - } - } - - return nil -} - -func (m *VmwareFcdWriteCacheSpec) validateRedirectIsEnabled(formats strfmt.Registry) error { - - if err := validate.Required("redirectIsEnabled", "body", m.RedirectIsEnabled); err != nil { - return err - } - - return nil -} - -func (m *VmwareFcdWriteCacheSpec) validateStoragePolicy(formats strfmt.Registry) error { - if swag.IsZero(m.StoragePolicy) { // not required - return nil - } - - if m.StoragePolicy != nil { - if err := m.StoragePolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storagePolicy") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vmware fcd write cache spec based on the context it is used -func (m *VmwareFcdWriteCacheSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCacheDatastore(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStoragePolicy(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareFcdWriteCacheSpec) contextValidateCacheDatastore(ctx context.Context, formats strfmt.Registry) error { - - if m.CacheDatastore != nil { - if err := m.CacheDatastore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cacheDatastore") - } - return err - } - } - - return nil -} - -func (m *VmwareFcdWriteCacheSpec) contextValidateStoragePolicy(ctx context.Context, formats strfmt.Registry) error { - - if m.StoragePolicy != nil { - if err := m.StoragePolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storagePolicy") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareFcdWriteCacheSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareFcdWriteCacheSpec) UnmarshalBinary(b []byte) error { - var res VmwareFcdWriteCacheSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_object_disk_model.go b/models/vmware_object_disk_model.go deleted file mode 100644 index de463e1..0000000 --- a/models/vmware_object_disk_model.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmwareObjectDiskModel vmware object disk model -// -// swagger:model VmwareObjectDiskModel -type VmwareObjectDiskModel struct { - - // Array of disks. - // Required: true - Disks []string `json:"disks"` - - // disks to process - // Required: true - DisksToProcess *EVmwareDisksTypeToProcess `json:"disksToProcess"` - - // If *true*, the disk is removed from VM configuration. - RemoveFromVMConfiguration bool `json:"removeFromVMConfiguration,omitempty"` - - // vm object - // Required: true - VMObject *VmwareObjectModel `json:"vmObject"` -} - -// Validate validates this vmware object disk model -func (m *VmwareObjectDiskModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDisks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDisksToProcess(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVMObject(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareObjectDiskModel) validateDisks(formats strfmt.Registry) error { - - if err := validate.Required("disks", "body", m.Disks); err != nil { - return err - } - - return nil -} - -func (m *VmwareObjectDiskModel) validateDisksToProcess(formats strfmt.Registry) error { - - if err := validate.Required("disksToProcess", "body", m.DisksToProcess); err != nil { - return err - } - - if err := validate.Required("disksToProcess", "body", m.DisksToProcess); err != nil { - return err - } - - if m.DisksToProcess != nil { - if err := m.DisksToProcess.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disksToProcess") - } - return err - } - } - - return nil -} - -func (m *VmwareObjectDiskModel) validateVMObject(formats strfmt.Registry) error { - - if err := validate.Required("vmObject", "body", m.VMObject); err != nil { - return err - } - - if m.VMObject != nil { - if err := m.VMObject.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vmware object disk model based on the context it is used -func (m *VmwareObjectDiskModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDisksToProcess(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVMObject(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareObjectDiskModel) contextValidateDisksToProcess(ctx context.Context, formats strfmt.Registry) error { - - if m.DisksToProcess != nil { - if err := m.DisksToProcess.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disksToProcess") - } - return err - } - } - - return nil -} - -func (m *VmwareObjectDiskModel) contextValidateVMObject(ctx context.Context, formats strfmt.Registry) error { - - if m.VMObject != nil { - if err := m.VMObject.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vmObject") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareObjectDiskModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareObjectDiskModel) UnmarshalBinary(b []byte) error { - var res VmwareObjectDiskModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_object_model.go b/models/vmware_object_model.go deleted file mode 100644 index bb2b5b7..0000000 --- a/models/vmware_object_model.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmwareObjectModel VMware object. -// -// swagger:model VmwareObjectModel -type VmwareObjectModel struct { - - // Name of the host. - // Required: true - HostName *string `json:"hostName"` - - // Name of the VMware vSphere object. - // Required: true - Name *string `json:"name"` - - // ID of the VMware vSphere object. - ObjectID string `json:"objectId,omitempty"` - - // type - // Required: true - Type *EVmwareInventoryType `json:"type"` -} - -// Validate validates this vmware object model -func (m *VmwareObjectModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHostName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareObjectModel) validateHostName(formats strfmt.Registry) error { - - if err := validate.Required("hostName", "body", m.HostName); err != nil { - return err - } - - return nil -} - -func (m *VmwareObjectModel) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *VmwareObjectModel) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vmware object model based on the context it is used -func (m *VmwareObjectModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareObjectModel) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareObjectModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareObjectModel) UnmarshalBinary(b []byte) error { - var res VmwareObjectModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/vmware_object_size_model.go b/models/vmware_object_size_model.go deleted file mode 100644 index 1202a39..0000000 --- a/models/vmware_object_size_model.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VmwareObjectSizeModel vmware object size model -// -// swagger:model VmwareObjectSizeModel -type VmwareObjectSizeModel struct { - - // inventory object - // Required: true - InventoryObject *VmwareObjectModel `json:"inventoryObject"` - - // Size used by the VMware vSphere object. - Size string `json:"size,omitempty"` -} - -// Validate validates this vmware object size model -func (m *VmwareObjectSizeModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateInventoryObject(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareObjectSizeModel) validateInventoryObject(formats strfmt.Registry) error { - - if err := validate.Required("inventoryObject", "body", m.InventoryObject); err != nil { - return err - } - - if m.InventoryObject != nil { - if err := m.InventoryObject.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("inventoryObject") - } - return err - } - } - - return nil -} - -// ContextValidate validate this vmware object size model based on the context it is used -func (m *VmwareObjectSizeModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateInventoryObject(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VmwareObjectSizeModel) contextValidateInventoryObject(ctx context.Context, formats strfmt.Registry) error { - - if m.InventoryObject != nil { - if err := m.InventoryObject.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("inventoryObject") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VmwareObjectSizeModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VmwareObjectSizeModel) UnmarshalBinary(b []byte) error { - var res VmwareObjectSizeModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_host_component_port_model.go b/models/windows_host_component_port_model.go deleted file mode 100644 index 6cfa77f..0000000 --- a/models/windows_host_component_port_model.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WindowsHostComponentPortModel Ports used by Veeam Backup & Replication components. -// -// swagger:model WindowsHostComponentPortModel -type WindowsHostComponentPortModel struct { - - // component name - // Required: true - ComponentName *EWindowsHostComponentType `json:"componentName"` - - // Port used by the component. - // Required: true - Port *int64 `json:"port"` -} - -// Validate validates this windows host component port model -func (m *WindowsHostComponentPortModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateComponentName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePort(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostComponentPortModel) validateComponentName(formats strfmt.Registry) error { - - if err := validate.Required("componentName", "body", m.ComponentName); err != nil { - return err - } - - if err := validate.Required("componentName", "body", m.ComponentName); err != nil { - return err - } - - if m.ComponentName != nil { - if err := m.ComponentName.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("componentName") - } - return err - } - } - - return nil -} - -func (m *WindowsHostComponentPortModel) validatePort(formats strfmt.Registry) error { - - if err := validate.Required("port", "body", m.Port); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this windows host component port model based on the context it is used -func (m *WindowsHostComponentPortModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateComponentName(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostComponentPortModel) contextValidateComponentName(ctx context.Context, formats strfmt.Registry) error { - - if m.ComponentName != nil { - if err := m.ComponentName.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("componentName") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsHostComponentPortModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsHostComponentPortModel) UnmarshalBinary(b []byte) error { - var res WindowsHostComponentPortModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_host_import_spec.go b/models/windows_host_import_spec.go deleted file mode 100644 index 53c5244..0000000 --- a/models/windows_host_import_spec.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WindowsHostImportSpec windows host import spec -// -// swagger:model WindowsHostImportSpec -type WindowsHostImportSpec struct { - - // credentials - Credentials *CredentialsImportModel `json:"credentials,omitempty"` - - // Description of the server. - // Required: true - Description *string `json:"description"` - - // Full DNS name or IP address of the server. - // Required: true - Name *string `json:"name"` - - // network settings - NetworkSettings *WindowsHostPortsModel `json:"networkSettings,omitempty"` - - // type - // Required: true - Type *EManagedServerType `json:"type"` -} - -// Validate validates this windows host import spec -func (m *WindowsHostImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCredentials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkSettings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostImportSpec) validateCredentials(formats strfmt.Registry) error { - if swag.IsZero(m.Credentials) { // not required - return nil - } - - if m.Credentials != nil { - if err := m.Credentials.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *WindowsHostImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *WindowsHostImportSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *WindowsHostImportSpec) validateNetworkSettings(formats strfmt.Registry) error { - if swag.IsZero(m.NetworkSettings) { // not required - return nil - } - - if m.NetworkSettings != nil { - if err := m.NetworkSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSettings") - } - return err - } - } - - return nil -} - -func (m *WindowsHostImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this windows host import spec based on the context it is used -func (m *WindowsHostImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCredentials(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworkSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostImportSpec) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { - - if m.Credentials != nil { - if err := m.Credentials.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("credentials") - } - return err - } - } - - return nil -} - -func (m *WindowsHostImportSpec) contextValidateNetworkSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.NetworkSettings != nil { - if err := m.NetworkSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSettings") - } - return err - } - } - - return nil -} - -func (m *WindowsHostImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsHostImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsHostImportSpec) UnmarshalBinary(b []byte) error { - var res WindowsHostImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_host_model.go b/models/windows_host_model.go deleted file mode 100644 index f7bad42..0000000 --- a/models/windows_host_model.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// WindowsHostModel windows host model -// -// swagger:model WindowsHostModel -type WindowsHostModel struct { - ManagedServerModel - - // network settings - NetworkSettings *WindowsHostPortsModel `json:"networkSettings,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *WindowsHostModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ManagedServerModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ManagedServerModel = aO0 - - // AO1 - var dataAO1 struct { - NetworkSettings *WindowsHostPortsModel `json:"networkSettings,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.NetworkSettings = dataAO1.NetworkSettings - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m WindowsHostModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ManagedServerModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - NetworkSettings *WindowsHostPortsModel `json:"networkSettings,omitempty"` - } - - dataAO1.NetworkSettings = m.NetworkSettings - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this windows host model -func (m *WindowsHostModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerModel - if err := m.ManagedServerModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostModel) validateNetworkSettings(formats strfmt.Registry) error { - - if swag.IsZero(m.NetworkSettings) { // not required - return nil - } - - if m.NetworkSettings != nil { - if err := m.NetworkSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSettings") - } - return err - } - } - - return nil -} - -// ContextValidate validate this windows host model based on the context it is used -func (m *WindowsHostModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerModel - if err := m.ManagedServerModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworkSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostModel) contextValidateNetworkSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.NetworkSettings != nil { - if err := m.NetworkSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsHostModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsHostModel) UnmarshalBinary(b []byte) error { - var res WindowsHostModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_host_ports_model.go b/models/windows_host_ports_model.go deleted file mode 100644 index 942acd5..0000000 --- a/models/windows_host_ports_model.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// WindowsHostPortsModel Network ports. -// -// swagger:model WindowsHostPortsModel -type WindowsHostPortsModel struct { - - // components - Components []*WindowsHostComponentPortModel `json:"components"` - - // End port used for data transfer. - PortRangeEnd int64 `json:"portRangeEnd,omitempty"` - - // Start port used for data transfer. - PortRangeStart int64 `json:"portRangeStart,omitempty"` - - // If *true*, the server is run on this side. - ServerThisSide bool `json:"serverThisSide,omitempty"` -} - -// Validate validates this windows host ports model -func (m *WindowsHostPortsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateComponents(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostPortsModel) validateComponents(formats strfmt.Registry) error { - if swag.IsZero(m.Components) { // not required - return nil - } - - for i := 0; i < len(m.Components); i++ { - if swag.IsZero(m.Components[i]) { // not required - continue - } - - if m.Components[i] != nil { - if err := m.Components[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("components" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this windows host ports model based on the context it is used -func (m *WindowsHostPortsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateComponents(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostPortsModel) contextValidateComponents(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Components); i++ { - - if m.Components[i] != nil { - if err := m.Components[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("components" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsHostPortsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsHostPortsModel) UnmarshalBinary(b []byte) error { - var res WindowsHostPortsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_host_spec.go b/models/windows_host_spec.go deleted file mode 100644 index ef81c2c..0000000 --- a/models/windows_host_spec.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// WindowsHostSpec windows host spec -// -// swagger:model WindowsHostSpec -type WindowsHostSpec struct { - ManagedServerSpec - - // network settings - NetworkSettings *WindowsHostPortsModel `json:"networkSettings,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *WindowsHostSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ManagedServerSpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ManagedServerSpec = aO0 - - // AO1 - var dataAO1 struct { - NetworkSettings *WindowsHostPortsModel `json:"networkSettings,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.NetworkSettings = dataAO1.NetworkSettings - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m WindowsHostSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ManagedServerSpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - NetworkSettings *WindowsHostPortsModel `json:"networkSettings,omitempty"` - } - - dataAO1.NetworkSettings = m.NetworkSettings - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this windows host spec -func (m *WindowsHostSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerSpec - if err := m.ManagedServerSpec.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostSpec) validateNetworkSettings(formats strfmt.Registry) error { - - if swag.IsZero(m.NetworkSettings) { // not required - return nil - } - - if m.NetworkSettings != nil { - if err := m.NetworkSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSettings") - } - return err - } - } - - return nil -} - -// ContextValidate validate this windows host spec based on the context it is used -func (m *WindowsHostSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ManagedServerSpec - if err := m.ManagedServerSpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetworkSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsHostSpec) contextValidateNetworkSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.NetworkSettings != nil { - if err := m.NetworkSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("networkSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsHostSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsHostSpec) UnmarshalBinary(b []byte) error { - var res WindowsHostSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_local_repository_settings_model.go b/models/windows_local_repository_settings_model.go deleted file mode 100644 index 231d7ed..0000000 --- a/models/windows_local_repository_settings_model.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// WindowsLocalRepositorySettingsModel Repository settings. -// -// swagger:model WindowsLocalRepositorySettingsModel -type WindowsLocalRepositorySettingsModel struct { - - // advanced settings - AdvancedSettings *RepositoryAdvancedSettingsModel `json:"advancedSettings,omitempty"` - - // Maximum number of concurrent tasks. - MaxTaskCount int64 `json:"maxTaskCount,omitempty"` - - // Path to the folder where backup files are stored. - Path string `json:"path,omitempty"` - - // Maximum rate that restricts the total speed of reading and writing data to the backup repository disk. - ReadWriteRate int64 `json:"readWriteRate,omitempty"` -} - -// Validate validates this windows local repository settings model -func (m *WindowsLocalRepositorySettingsModel) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdvancedSettings(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsLocalRepositorySettingsModel) validateAdvancedSettings(formats strfmt.Registry) error { - if swag.IsZero(m.AdvancedSettings) { // not required - return nil - } - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -// ContextValidate validate this windows local repository settings model based on the context it is used -func (m *WindowsLocalRepositorySettingsModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvancedSettings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsLocalRepositorySettingsModel) contextValidateAdvancedSettings(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvancedSettings != nil { - if err := m.AdvancedSettings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advancedSettings") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsLocalRepositorySettingsModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsLocalRepositorySettingsModel) UnmarshalBinary(b []byte) error { - var res WindowsLocalRepositorySettingsModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_local_storage_import_spec.go b/models/windows_local_storage_import_spec.go deleted file mode 100644 index b4017c5..0000000 --- a/models/windows_local_storage_import_spec.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WindowsLocalStorageImportSpec windows local storage import spec -// -// swagger:model WindowsLocalStorageImportSpec -type WindowsLocalStorageImportSpec struct { - - // Description of the backup repository. - // Required: true - Description *string `json:"description"` - - // ID of the server that is used as a backup repository. - // Required: true - HostName *string `json:"hostName"` - - // mount server - // Required: true - MountServer *MountServerSettingsImportSpec `json:"mountServer"` - - // Name of the backup repository. - // Required: true - Name *string `json:"name"` - - // repository - // Required: true - Repository *WindowsLocalRepositorySettingsModel `json:"repository"` - - // VMware vSphere tag assigned to the backup repository. - // Required: true - Tag *string `json:"tag"` - - // type - // Required: true - Type *ERepositoryType `json:"type"` -} - -// Validate validates this windows local storage import spec -func (m *WindowsLocalStorageImportSpec) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsLocalStorageImportSpec) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *WindowsLocalStorageImportSpec) validateHostName(formats strfmt.Registry) error { - - if err := validate.Required("hostName", "body", m.HostName); err != nil { - return err - } - - return nil -} - -func (m *WindowsLocalStorageImportSpec) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *WindowsLocalStorageImportSpec) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *WindowsLocalStorageImportSpec) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *WindowsLocalStorageImportSpec) validateTag(formats strfmt.Registry) error { - - if err := validate.Required("tag", "body", m.Tag); err != nil { - return err - } - - return nil -} - -func (m *WindowsLocalStorageImportSpec) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this windows local storage import spec based on the context it is used -func (m *WindowsLocalStorageImportSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsLocalStorageImportSpec) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *WindowsLocalStorageImportSpec) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -func (m *WindowsLocalStorageImportSpec) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsLocalStorageImportSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsLocalStorageImportSpec) UnmarshalBinary(b []byte) error { - var res WindowsLocalStorageImportSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_local_storage_model.go b/models/windows_local_storage_model.go deleted file mode 100644 index aeca595..0000000 --- a/models/windows_local_storage_model.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WindowsLocalStorageModel Direct attached storage. -// -// swagger:model WindowsLocalStorageModel -type WindowsLocalStorageModel struct { - RepositoryModel - - // ID of the server that is used as a backup repository. - // Required: true - // Format: uuid - HostID *strfmt.UUID `json:"hostId"` - - // mount server - // Required: true - MountServer *MountServerSettingsModel `json:"mountServer"` - - // repository - // Required: true - Repository *WindowsLocalRepositorySettingsModel `json:"repository"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *WindowsLocalStorageModel) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RepositoryModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RepositoryModel = aO0 - - // AO1 - var dataAO1 struct { - HostID *strfmt.UUID `json:"hostId"` - - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *WindowsLocalRepositorySettingsModel `json:"repository"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.HostID = dataAO1.HostID - - m.MountServer = dataAO1.MountServer - - m.Repository = dataAO1.Repository - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m WindowsLocalStorageModel) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.RepositoryModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - HostID *strfmt.UUID `json:"hostId"` - - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *WindowsLocalRepositorySettingsModel `json:"repository"` - } - - dataAO1.HostID = m.HostID - - dataAO1.MountServer = m.MountServer - - dataAO1.Repository = m.Repository - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this windows local storage model -func (m *WindowsLocalStorageModel) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositoryModel - if err := m.RepositoryModel.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsLocalStorageModel) validateHostID(formats strfmt.Registry) error { - - if err := validate.Required("hostId", "body", m.HostID); err != nil { - return err - } - - if err := validate.FormatOf("hostId", "body", "uuid", m.HostID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WindowsLocalStorageModel) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *WindowsLocalStorageModel) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -// ContextValidate validate this windows local storage model based on the context it is used -func (m *WindowsLocalStorageModel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositoryModel - if err := m.RepositoryModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsLocalStorageModel) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *WindowsLocalStorageModel) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsLocalStorageModel) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsLocalStorageModel) UnmarshalBinary(b []byte) error { - var res WindowsLocalStorageModel - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/models/windows_local_storage_spec.go b/models/windows_local_storage_spec.go deleted file mode 100644 index 5bdd5e0..0000000 --- a/models/windows_local_storage_spec.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WindowsLocalStorageSpec windows local storage spec -// -// swagger:model WindowsLocalStorageSpec -type WindowsLocalStorageSpec struct { - RepositorySpec - - // ID of the server that is used as a backup repository. - // Required: true - // Format: uuid - HostID *strfmt.UUID `json:"hostId"` - - // mount server - // Required: true - MountServer *MountServerSettingsModel `json:"mountServer"` - - // repository - // Required: true - Repository *WindowsLocalRepositorySettingsModel `json:"repository"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *WindowsLocalStorageSpec) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 RepositorySpec - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.RepositorySpec = aO0 - - // AO1 - var dataAO1 struct { - HostID *strfmt.UUID `json:"hostId"` - - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *WindowsLocalRepositorySettingsModel `json:"repository"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.HostID = dataAO1.HostID - - m.MountServer = dataAO1.MountServer - - m.Repository = dataAO1.Repository - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m WindowsLocalStorageSpec) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.RepositorySpec) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - HostID *strfmt.UUID `json:"hostId"` - - MountServer *MountServerSettingsModel `json:"mountServer"` - - Repository *WindowsLocalRepositorySettingsModel `json:"repository"` - } - - dataAO1.HostID = m.HostID - - dataAO1.MountServer = m.MountServer - - dataAO1.Repository = m.Repository - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this windows local storage spec -func (m *WindowsLocalStorageSpec) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositorySpec - if err := m.RepositorySpec.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMountServer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepository(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsLocalStorageSpec) validateHostID(formats strfmt.Registry) error { - - if err := validate.Required("hostId", "body", m.HostID); err != nil { - return err - } - - if err := validate.FormatOf("hostId", "body", "uuid", m.HostID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WindowsLocalStorageSpec) validateMountServer(formats strfmt.Registry) error { - - if err := validate.Required("mountServer", "body", m.MountServer); err != nil { - return err - } - - if m.MountServer != nil { - if err := m.MountServer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *WindowsLocalStorageSpec) validateRepository(formats strfmt.Registry) error { - - if err := validate.Required("repository", "body", m.Repository); err != nil { - return err - } - - if m.Repository != nil { - if err := m.Repository.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -// ContextValidate validate this windows local storage spec based on the context it is used -func (m *WindowsLocalStorageSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with RepositorySpec - if err := m.RepositorySpec.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMountServer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRepository(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WindowsLocalStorageSpec) contextValidateMountServer(ctx context.Context, formats strfmt.Registry) error { - - if m.MountServer != nil { - if err := m.MountServer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mountServer") - } - return err - } - } - - return nil -} - -func (m *WindowsLocalStorageSpec) contextValidateRepository(ctx context.Context, formats strfmt.Registry) error { - - if m.Repository != nil { - if err := m.Repository.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("repository") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WindowsLocalStorageSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WindowsLocalStorageSpec) UnmarshalBinary(b []byte) error { - var res WindowsLocalStorageSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/swagger.json b/swagger.json new file mode 100644 index 0000000..5de678c --- /dev/null +++ b/swagger.json @@ -0,0 +1,13690 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Veeam Backup & Replication REST API", + "description": "This document lists paths (endpoints) of the Veeam Backup & Replication REST API and operations that you can perform by sending HTTP requests to the paths.
\nRequests can contain parameters in their path, query and header. POST and PUT requests can include a request body with resource payload. In response, you receive a conventional HTTP response code, HTTP response header and an optional response body schema that contains a result model.
\nParameters, request bodies, and response bodies are defined inline or refer to schemas defined globally. Some schemas are polymorphic.\n", + "contact": { + "email": "support@veeam.com" + }, + "version": "1.0-rev1" + }, + "servers": [ + { + "url": "/" + } + ], + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + { + "name": "Login", + "description": "The authorization process involves obtaining an access token and a refresh token.
For details on the authorization process and security settings, see the [Authorization and Security](https://helpcenter.veeam.com/docs/backup/vbr_rest/authorization_security.html) section of the Veeam Backup & Replication REST API Reference.\n" + }, + { + "name": "Service", + "description": "The Service section defines paths and operations for retrieving current date and time and a certificate of the backup server where the REST API service is running.\n" + }, + { + "name": "Services", + "description": "The Services section defines a path and operation for retrieving information about associated backend services. You may need to connect to these services for integration with Veeam Backup & Replication only.\n" + }, + { + "name": "Traffic Rules", + "description": "The Traffic Rules section defines paths and operations for retrieving and editing information about network traffic rules that are configured on the backup server.\n" + }, + { + "name": "General Options", + "description": "The General Options section defines paths and operations for retrieving and editing general options of Veeam Backup & Replication.\n" + }, + { + "name": "Configuration Backup", + "description": "The Configuration Backup section defines paths and operations for retrieving and editing general options of Veeam Backup & Replication.\n" + }, + { + "name": "Sessions", + "description": "The Sessions section defines paths and operations for managing sessions (except [automation sessions](#operation/GetAllAutomationSessions)) performed on the backup server.\n" + }, + { + "name": "Connection", + "description": "The Connection section defines a path and operation for retrieving a TLS certificate or SSH fingerprint used to establish a secure connection between the backup server and the specified server.\n" + }, + { + "name": "Inventory Browser", + "description": "The Inventory Browser section defines paths and operations for retrieving VMware vSphere servers and their virtual infrastructure objects (datacenters, clusters, hosts, resource pools, VMs).
NOTE
In the current version, you can browse VMware vSphere objects only.
\n" + }, + { + "name": "Managed Servers", + "description": "The Managed Servers section defines paths and operations for managing servers that are added to the backup infrastructure.
NOTE
In the current version, the REST API supports the following server types: VMware vSphere, Linux and Windows.
\n" + }, + { + "name": "Repositories", + "description": "The Repositories section defines paths and operations for managing backup repositories that are added to the backup infrastructure.
NOTE
In the current version, the REST API supports direct attached and network attached storages only.
\n" + }, + { + "name": "Proxies", + "description": "The Proxies section defines paths and operations for managing backup proxies that are added to the backup infrastructure.
NOTE
In the current version, the REST API supports VMware backup proxies only.
\n" + }, + { + "name": "Jobs", + "description": "The Jobs section defines paths and operations for managing jobs that are coordinated by the backup server.
NOTE
In the current version, the REST API supports backup jobs with VMware VMs only.
\n" + }, + { + "name": "Credentials", + "description": "The Credentials section defines paths and operations for managing credentials records that are added to the backup server.\n" + }, + { + "name": "Encryption", + "description": "The Encryption section defines paths and operations for managing passwords that are used for data encryption." + }, + { + "name": "Backups", + "description": "The Backups section defines paths and operations for managing backups that are created on or imported to the backup server." + }, + { + "name": "Backup Objects", + "description": "The Backup Objects section defines paths and operations for managing backup objects — virtual infrastructure objects (VMs and VM containers) that are inсluded in backups created by the backup server.\n" + }, + { + "name": "Object Restore Points", + "description": "The Object Restore Points section defines paths and operations for retrieving restore points created on the backup server and backed up disks from the restore points." + }, + { + "name": "Restore", + "description": "The Restore section defines paths and operations for performing restore.
NOTE
In the current version, you can restore only disks that will be registered as First Class Disks (FCD) — a type of virtual disks that can be managed independent of any VM.
\n" + }, + { + "name": "Automation", + "description": "The Automation section defines paths and operations for granular import and export of objects available in the REST API. It can be useful, for example, if you set up the backup infrastructure using JSON specification or migrate the infrastructure to another backup server. For details, see [Mass Deployment](https://helpcenter.veeam.com/docs/backup/vbr_rest/automation.html).\n" + } + ], + "paths": { + "/api/v1/serverTime": { + "get": { + "tags": [ + "Service" + ], + "summary": "Get Server Time", + "description": "The HTTP GET request to the `/api/v1/serverTime` path allows you to get current date and time on the backup server.", + "operationId": "GetServerTime", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerTimeModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "security": [] + } + }, + "/api/v1/serverCertificate": { + "get": { + "tags": [ + "Service" + ], + "summary": "Get Server Certificate", + "description": "The HTTP GET request to the `/api/v1/serverCertificate` path allows you to get a certificate of the backup server.", + "operationId": "GetServerCertificate", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CertificateModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "security": [] + } + }, + "/api/v1/services": { + "get": { + "tags": [ + "Services" + ], + "x-veeam-authorize": { + "claims": [ + "ViewServices" + ] + }, + "summary": "Get Associated Services", + "description": "The HTTP GET request to the `/api/v1/services` path allows you to get associated services for integration with Veeam Backup & Replication.", + "operationId": "GetAllServices", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of services to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ServicesFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of services to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ServicesFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts services by one of the service parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EServicesFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ServicesFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts services in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ServicesFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters services by the `nameFilter` pattern. The pattern can match any service parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ServicesFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServicesResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/oauth2/token": { + "post": { + "tags": [ + "Login" + ], + "summary": "Get Access Token", + "description": "The HTTP POST request to the `/api/oauth2/token` path allows you to get an access token and a refresh token.", + "operationId": "CreateToken", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/TokenLoginSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + }, + "security": [] + } + }, + "/api/oauth2/authorization_code": { + "post": { + "tags": [ + "Login" + ], + "summary": "Get Authorization Code", + "description": "The HTTP POST request to the `/api/oauth2/authorization_code` path allows you to get an authorization code that is used to obtain an access token. For more information on authorization process, see [Requesting Authorization](https://helpcenter.veeam.com/docs/backup/vbr_rest/requesting_authorization.html).", + "operationId": "CreateAuthorizationCode", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorizationCodeModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/oauth2/logout": { + "post": { + "tags": [ + "Login" + ], + "operationId": "Logout", + "summary": "Log Out", + "description": "The HTTP POST request to the `/api/oauth2/logout` path allows you to perform the logout operation. After you log out, access and refresh tokens are expired.\n", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/trafficRules": { + "get": { + "tags": [ + "Traffic Rules" + ], + "x-veeam-authorize": { + "claims": [ + "ViewTrafficRules" + ] + }, + "summary": "Get Traffic Rules", + "description": "The HTTP GET request to the `/api/v1/trafficRules` path allows you to get network traffic rules that control traffic transferred between backup infrastructure components.", + "operationId": "GetAllTrafficRules", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GlobalNetworkTrafficRulesModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "Traffic Rules" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateTrafficRules" + ] + }, + "summary": "Edit Traffic Rules", + "description": "The HTTP PUT request to the `/api/v1/trafficRules` path allows you to edit network traffic rules that are configured on the backup server.", + "operationId": "UpdateTrafficRules", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GlobalNetworkTrafficRulesModel" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Infrastructure session has been created to edit the traffic rules. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GlobalNetworkTrafficRulesModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/generalOptions": { + "get": { + "tags": [ + "General Options" + ], + "x-veeam-authorize": { + "claims": [ + "ViewGeneralOptions" + ] + }, + "summary": "Get General Options", + "description": "The HTTP GET request to the `/api/v1/generalOptions` path allows you to get general options of Veeam Backup & Replication.", + "operationId": "GetGeneralOptions", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralOptionsModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "General Options" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateGeneralOptions" + ] + }, + "summary": "Edit General Options", + "description": "The HTTP PUT request to the `/api/v1/generalOptions` path allows you to edit general options of Veeam Backup & Replication.", + "operationId": "UpdateGeneralOptions", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralOptionsModel" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "General options have been updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralOptionsModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/configBackup": { + "get": { + "tags": [ + "Configuration Backup" + ], + "x-veeam-authorize": { + "claims": [ + "ViewConfigBackupOptions" + ] + }, + "summary": "Get Configuration Backup", + "description": "The HTTP GET request to the `/api/v1/configBackup` path allows you to get configuration backup of the backup server.", + "operationId": "GetConfigBackupOptions", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigBackupModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "Configuration Backup" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateConfigBackupOptions" + ] + }, + "summary": "Edit Configuration Backup", + "description": "The HTTP PUT request to the `/api/v1/configBackup` path allows you to edit configuration backup of the backup server.", + "operationId": "UpdateConfigBackupOptions", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigBackupModel" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Configuration backup settings have been updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigBackupModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/configBackup/backup": { + "post": { + "tags": [ + "Configuration Backup" + ], + "x-veeam-authorize": { + "claims": [ + "StartConfigBackup" + ] + }, + "summary": "Start Configuration Backup", + "description": "The HTTP POST request to the `/api/v1/configBackup` path allows you to start configuration backup.", + "operationId": "StartConfigBackup", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "Configuration backup has been started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/sessions": { + "get": { + "tags": [ + "Sessions" + ], + "x-veeam-authorize": { + "claims": [ + "ViewSessions" + ] + }, + "summary": "Get All Sessions", + "description": "The HTTP GET request to the `/api/v1/sessions` path allows you to get an array of sessions performed on the backup server.", + "operationId": "GetAllSessions", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of sessions to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of sessions to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts sessions by one of the session parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionsFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts sessions in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters sessions by the `nameFilter` pattern. The pattern can match any session parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "createdAfterFilter", + "description": "Returns sessions that are created after the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "createdBeforeFilter", + "description": "Returns sessions that are created before the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "endedAfterFilter", + "description": "Returns sessions that are finished after the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "endedBeforeFilter", + "description": "Returns sessions that are finished before the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters sessions by session type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "stateFilter", + "description": "Filters sessions by session state.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionState" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "resultFilter", + "description": "Filters sessions by session result.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionResult" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "jobIdFilter", + "description": "Filters sessions by job ID.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/sessions/{id}": { + "get": { + "tags": [ + "Sessions" + ], + "x-veeam-authorize": { + "claims": [ + "ViewSessions" + ] + }, + "summary": "Get Session", + "description": "The HTTP GET request to the `/api/v1/sessions/{id}` path allows you to get a session that has the specified `id`.", + "operationId": "GetSession", + "parameters": [ + { + "name": "id", + "description": "ID of the session.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/sessions/{id}/logs": { + "get": { + "tags": [ + "Sessions" + ], + "x-veeam-authorize": { + "claims": [ + "ViewSessions" + ] + }, + "summary": "Get Session Logs", + "description": "The HTTP GET request to the `/api/v1/sessions/{id}/logs` path allows you to get an array of log records of a session that has the specified `id`.", + "operationId": "GetSessionLogs", + "parameters": [ + { + "name": "id", + "description": "ID of the session.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionLogResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/sessions/{id}/stop": { + "post": { + "tags": [ + "Sessions" + ], + "x-veeam-authorize": { + "claims": [ + "StopSessions" + ] + }, + "summary": "Stop Session", + "description": "The HTTP POST request to the `/api/v1/sessions/{id}/stop` path allows you to stop a session that has the specified `id`.", + "operationId": "StopSession", + "parameters": [ + { + "name": "id", + "description": "ID of the session.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/connectionCertificate": { + "post": { + "tags": [ + "Connection" + ], + "x-veeam-authorize": { + "claims": [ + "CheckCertificate" + ] + }, + "summary": "Request TLS Certificate or SSH Fingerprint", + "description": "The HTTP POST request to the `/api/v1/connectionCertificate` path allows you to get a TLS certificate or SSH fingerprint of the specified host.", + "operationId": "GetConnectionCertificate", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HostConnectionSpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectionCertificateModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/inventory/vmware/hosts": { + "get": { + "tags": [ + "Inventory Browser" + ], + "x-veeam-authorize": { + "claims": [ + "ViewViHierarchy" + ] + }, + "summary": "Get All VMware vSphere Servers", + "description": "The HTTP GET request to the `/api/v1/inventory/vmware/hosts` path allows you to get an array of all VMware vSphere servers added to the backup infrastructure.", + "operationId": "GetAllInventoryVmwareHosts", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of VMware vSphere servers to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ViRootFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of VMware vSphere servers to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ViRootFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts VMware vSphere servers by one of the VMware vSphere server parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EViRootFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ViRootFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts VMware vSphere servers in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ViRootFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters VMware vSphere servers by the `nameFilter` pattern. The pattern can match any VMware vSphere server parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ViRootFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ViRootsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/inventory/vmware/hosts/{name}": { + "get": { + "tags": [ + "Inventory Browser" + ], + "x-veeam-authorize": { + "claims": [ + "ViewViHierarchy" + ] + }, + "summary": "Get VMware vSphere Server Objects", + "description": "The HTTP GET request to the `/api/v1/inventory/vmware/hosts/{name}` path allows you to get an array of virtual infrastructure objects of the VMware vSphere server that has the specified `name`.", + "operationId": "GetVmwareHostObject", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "name", + "description": "Name of the VMware vSphere server.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "skip", + "description": "Number of objects to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of objects to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts objects by one of the object parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EvCentersInventoryFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts objects in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + }, + { + "name": "objectIdFilter", + "description": "Filters objects by object ID.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + }, + { + "name": "hierarchyTypeFilter", + "description": "Filters objects by hierarchy type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EHierarchyType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters objects by the `nameFilter` pattern. The pattern can match any object parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters objects by virtual infrastructure type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EVmwareInventoryType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + }, + { + "name": "parentContainerNameFilter", + "description": "Filters objects by name of the parent container.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/VCenterInventoryFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VCenterInventoryResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/managedServers": { + "get": { + "tags": [ + "Managed Servers" + ], + "x-veeam-authorize": { + "claims": [ + "ViewManagedServers" + ] + }, + "summary": "Get All Servers", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/managedServers` path allows you to get an array of all servers that are added to the backup infrastructure.", + "operationId": "GetAllManagedServers", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of servers to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ManagedServersFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of servers to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ManagedServersFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts servers by one of the server parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EManagedServersFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ManagedServersFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts servers in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ManagedServersFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters servers by the `nameFilter` pattern. The pattern can match any server parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ManagedServersFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters servers by server type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EManagedServerType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ManagedServersFilters" + } + }, + { + "name": "viTypeFilter", + "description": "Filters servers by the type of VMware vSphere server.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EViHostType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ManagedServersFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManagedServersResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "Managed Servers" + ], + "x-veeam-authorize": { + "claims": [ + "CreateManagedServers" + ] + }, + "summary": "Add Server", + "description": "The HTTP POST request to the `/api/v1/backupInfrastructure/managedServers` path allows you to add a server to the backup infrastructure.", + "operationId": "CreateManagedServer", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManagedServerSpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Infrastructure session has been created to add the server. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/managedServers/{id}": { + "get": { + "tags": [ + "Managed Servers" + ], + "x-veeam-authorize": { + "claims": [ + "ViewManagedServers" + ] + }, + "summary": "Get Server", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to get a managed server that has the specified `id`.", + "operationId": "GetManagedServer", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the managed server.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManagedServerModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "Managed Servers" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateManagedServers" + ] + }, + "summary": "Edit Server", + "description": "The HTTP PUT request to the `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to edit a managed server that has the specified `id`.", + "operationId": "UpdateManagedServer", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the managed server.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManagedServerModel" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Infrastructure session has been created to edit the server. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "delete": { + "tags": [ + "Managed Servers" + ], + "x-veeam-authorize": { + "claims": [ + "DeleteManagedServers" + ] + }, + "summary": "Remove Server", + "description": "The HTTP DELETE request to the `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to remove a managed server that has the specified `id` from the backup infrastructure.", + "operationId": "DeleteManagedServer", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the managed server.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "201": { + "description": "Managed server has been removed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/repositories": { + "get": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "ViewRepositories" + ] + }, + "summary": "Get All Repositories", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/repositories` path allows you to get an array of all backup repositories that are added to the backup infrastructure.", + "operationId": "GetAllRepositories", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of repositories to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of repositories to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts repositories by one of the repository parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ERepositoryFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts repositories in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters repositories by the `nameFilter` pattern. The pattern can match any repository parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters repositories by repository type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + }, + { + "name": "hostIdFilter", + "description": "Filters repositories by ID of the backup server.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + }, + { + "name": "pathFilter", + "description": "Filters repositories by path to the folder where backup files are stored.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + }, + { + "name": "vmbApiFilter", + "description": "Filters repositories by VM Backup API parameters converted to the base64 string.
\nTo compose the base64 string:
\n
    \n
  1. Prepare VM Backup API parameters in the JSON format.
  2. \n {
    \n \"protocolVersion\":\"string\",
    \n \"assemblyVersion\":\"string\",
    \n \"productId\":\"string\",
    \n \"versionFlags\":\"string\"
    \n }
    \n
  3. Convert the JSON object into a string.
  4. \n
  5. Encode the string with base64 encoding.
  6. \n
\n", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoriesFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoriesResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "CreateRepositories" + ] + }, + "summary": "Add Repository", + "description": "The HTTP POST request to the `/api/v1/backupInfrastructure/repositories` path allows you to add a repository to the backup infrastructure.", + "operationId": "CreateRepository", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositorySpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Infrastructure session has been created to add the repository. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/repositories/states": { + "get": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "ViewRepositories" + ] + }, + "summary": "Get All Repository States", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/repositories/states` path allows you to get an array of all repository states. The states include repository location and brief statistics, such as repository capacity, free and used space.", + "operationId": "GetAllRepositoriesStates", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of repository states to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of repository states to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts repository states by one of the state parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ERepositoryStatesFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts repository states in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "idFilter", + "description": "Filters repository states by repository ID.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters repository states by the `nameFilter` pattern. The pattern can match any repository state parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters repository states by repository type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "capacityFilter", + "description": "Filters repository states by repository capacity.", + "in": "query", + "schema": { + "type": "number", + "format": "double" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "freeSpaceFilter", + "description": "Filters repository states by repository free space.", + "in": "query", + "schema": { + "type": "number", + "format": "double" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + }, + { + "name": "usedSpaceFilter", + "description": "Filters repository states by repository used space.", + "in": "query", + "schema": { + "type": "number", + "format": "double" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/RepositoryStatesFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryStatesResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/repositories/{id}": { + "get": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "ViewRepositories" + ] + }, + "summary": "Get Repository", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/repositories/{id}` path allows you to get a backup repository that has the specified `id`.", + "operationId": "GetRepository", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup repository.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateRepositories" + ] + }, + "summary": "Edit Repository", + "description": "The HTTP PUT request to the `/api/v1/backupInfrastructure/repositories/{id}` path allows you to edit a backup repository that has the specified `id`.", + "operationId": "UpdateRepository", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup repository.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryModel" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Infrastructure session has been created to edit the repository. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "delete": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "DeleteRepositories" + ] + }, + "summary": "Remove Repository", + "description": "The HTTP DELETE request to the `/api/v1/backupInfrastructure/repositories/{id}` path allows you to remove a backup repository that has the specified `id` from the backup infrastructure.", + "operationId": "DeleteRepository", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup repository.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "deleteBackups", + "description": "If *true*, Veeam Backup & Replication will remove backup files.", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/DeleteRepositoryFilters" + } + } + ], + "responses": { + "204": { + "description": "Removed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/proxies": { + "get": { + "tags": [ + "Proxies" + ], + "x-veeam-authorize": { + "claims": [ + "ViewProxies" + ] + }, + "summary": "Get All Proxies", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/proxies` path allows you to get an array of all backup proxies that are added to the backup infrastructure.", + "operationId": "GetAllProxies", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of proxies to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ProxiesFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of proxies to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ProxiesFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts proxies by one of the proxy parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EProxiesFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ProxiesFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts proxies in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ProxiesFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters proxies by the `nameFilter` pattern. The pattern can match any proxy parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ProxiesFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters proxies by proxy type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EProxyType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ProxiesFilters" + } + }, + { + "name": "hostIdFilter", + "description": "Filters proxies by ID of the backup server.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ProxiesFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProxiesResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "Proxies" + ], + "x-veeam-authorize": { + "claims": [ + "CreateProxies" + ] + }, + "summary": "Add Proxy", + "description": "The HTTP POST request to the `/api/v1/backupInfrastructure/proxies` path allows you to add a proxy to the backup infrastructure.", + "operationId": "CreateProxy", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProxySpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Infrastructure session has been created to add the proxy. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/proxies/{id}": { + "get": { + "tags": [ + "Proxies" + ], + "x-veeam-authorize": { + "claims": [ + "ViewProxies" + ] + }, + "summary": "Get Proxy", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/proxies/{id}` path allows you to get a backup proxy that has the specified `id`.", + "operationId": "GetProxy", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup proxy.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProxyModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "Proxies" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateProxies" + ] + }, + "summary": "Edit Proxy", + "description": "The HTTP PUT request to the `/api/v1/backupInfrastructure/proxies/{id}` path allows you to edit a backup proxy that has the specified `id`.", + "operationId": "UpdateProxy", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup proxy.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProxyModel" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Infrastructure session has been created to edit the proxy. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "delete": { + "tags": [ + "Proxies" + ], + "x-veeam-authorize": { + "claims": [ + "DeleteProxies" + ] + }, + "summary": "Remove Proxy", + "description": "The HTTP DELETE request to the `/api/v1/backupInfrastructure/proxies/{id}` path allows you to remove a backup proxy that has the specified `id` from the backup infrastructure.", + "operationId": "DeleteProxy", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup proxy.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/Deleted" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/scaleOutRepositories": { + "get": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "ViewScaleOutRepositories" + ] + }, + "summary": "Get All Scale-Out Backup Repositories", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/scaleOutRepositories` path allows you to get an array of all scale-out backup repositories that are added to the backup infrastructure.", + "operationId": "GetAllScaleOutRepositories", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of repositories to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ScaleOutRepositoriesFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of repositories to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ScaleOutRepositoriesFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts repositories by one of the repository parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EScaleOutRepositoryFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ScaleOutRepositoriesFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts repositories in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ScaleOutRepositoriesFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters repositories by the `nameFilter` substring. The substring can be part of any repository parameter.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ScaleOutRepositoriesFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScaleOutRepositoriesResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/scaleOutRepositories/{id}": { + "get": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "ViewScaleOutRepositories" + ] + }, + "summary": "Get Scale-Out Backup Repository", + "description": "The HTTP GET request to the `/api/v1/backupInfrastructure/scaleOutRepositories/{id}` path allows you to get a scale-out backup repository that has the specified `id`.", + "operationId": "GetScaleOutRepository", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the scale-out backup repository.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScaleOutRepositoryModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode": { + "post": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "EnableRepositoryMaintenanceMode" + ] + }, + "summary": "Enable Maintenance Mode", + "description": "The HTTP POST request to the `/api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode` path allows you to enable maintenance mode for a scale-out backup repository extent that has the specified `id`.", + "operationId": "EnableScaleOutExtentMaintenanceMode", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the scale-out backup repository extent.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScaleOutExtentMaintenanceSpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "RepositoryMaintenance session has been created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode": { + "post": { + "tags": [ + "Repositories" + ], + "x-veeam-authorize": { + "claims": [ + "DisableRepositoryMaintenanceMode" + ] + }, + "summary": "Disable Maintenance Mode", + "description": "The HTTP POST request to the `/api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode` path allows you to disable maintenance mode for a scale-out backup repository extent that has the specified `id`.", + "operationId": "DisableScaleOutExtentMaintenanceMode", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the scale-out backup repository extent.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScaleOutExtentMaintenanceSpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "RepositoryMaintenance session has been created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/jobs": { + "get": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "ViewJobs" + ] + }, + "summary": "Get All Jobs", + "description": "The HTTP GET request to the `/api/v1/jobs` path allows you to get an array of all jobs coordinated by the backup server.", + "operationId": "GetAllJobs", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of jobs to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobsFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of jobs to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobsFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts jobs by one of the job parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EJobFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobsFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts jobs in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobsFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters jobs by the `nameFilter` pattern. The pattern can match any job parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobsFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters jobs by job type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EJobType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobsFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "CreateJobs" + ] + }, + "summary": "Create Job", + "description": "The HTTP POST request to the `/api/v1/jobs` path allows you to create a new job that has the specified parameters.", + "operationId": "CreateJob", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobSpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Job has been created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/jobs/states": { + "get": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "ViewJobs" + ] + }, + "summary": "Get All Job States", + "description": "The HTTP GET request to the `/api/v1/jobs/states` path allows you to get an array of all job states. The states include brief job information that you can also find under the **Jobs** node in the Veeam Backup & Replication console.", + "operationId": "GetAllJobsStates", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of job states to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of job states to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts job states by one of the state parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EJobStatesFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts job states in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "idFilter", + "description": "Filters job states by job ID.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters job states by the `nameFilter` pattern. The pattern can match any state parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters job states by job type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EJobType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "lastResultFilter", + "description": "Filters job states by status with which jobs must finish.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionResult" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "statusFilter", + "description": "Filters job states by current status of the job.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EJobStatus" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "workloadFilter", + "description": "Filters job states by workloads that jobs must process.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EJobWorkload" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "lastRunAfterFilter", + "description": "Returns job states for jobs that have run after the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "lastRunBeforeFilter", + "description": "Returns job states for jobs that have not run after the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "isHighPriorityJobFilter", + "description": "If *true*, Returns job states for jobs with high priority.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "repositoryIdFilter", + "description": "Filters job states by repository ID.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + }, + { + "name": "objectsCountFilter", + "description": "Filters job states by number of objects processed by the job.", + "in": "query", + "schema": { + "type": "integer" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/JobStatesFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobStatesResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/jobs/{id}": { + "get": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "ViewJobs" + ] + }, + "summary": "Get Job", + "description": "The HTTP GET request to the `/api/v1/jobs/{id}` path allows you to get a job that has the specified `id`.", + "operationId": "GetJob", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateJobs" + ] + }, + "summary": "Edit Job", + "description": "The HTTP PUT request to the `/api/v1/jobs/{id}` path allows you to edit a job that has the specified `id`.", + "operationId": "UpdateJob", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobModel" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Job has been updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "delete": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "DeleteJobs" + ] + }, + "summary": "Delete Job", + "description": "The HTTP DELETE request to the `/api/v1/jobs/{id}` path allows you to delete a job that has the specified `id`.", + "operationId": "DeleteJob", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/Deleted" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/jobs/{id}/start": { + "post": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "StartJobs" + ] + }, + "summary": "Start Job", + "description": "The HTTP POST request to the `/api/v1/jobs/{id}/start` path allows you to start a job that has the specified `id`.", + "operationId": "StartJob", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobStartSpec" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "Job session has been started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/jobs/{id}/stop": { + "post": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "StopJobs" + ] + }, + "summary": "Stop Job", + "description": "The HTTP POST request to the `/api/v1/jobs/{id}/stop` path allows you to stop a job that has the specified `id`.", + "operationId": "StopJob", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobStopSpec" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "Job session has been stopped.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/jobs/{id}/disable": { + "post": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "DisableJobs" + ] + }, + "summary": "Disable Job", + "description": "The HTTP POST request to the `/api/v1/jobs/{id}/disable` path allows you to disable a job that has the specified `id`.", + "operationId": "DisableJob", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Job has been disabled.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/jobs/{id}/enable": { + "post": { + "tags": [ + "Jobs" + ], + "x-veeam-authorize": { + "claims": [ + "EnableJobs" + ] + }, + "summary": "Enable Job", + "description": "The HTTP POST request to the `/api/v1/jobs/{id}/enable` path allows you to enable a job that has the specified `id`.", + "operationId": "EnableJob", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Job has been enabled.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/credentials": { + "get": { + "tags": [ + "Credentials" + ], + "x-veeam-authorize": { + "claims": [ + "ViewCredentials" + ] + }, + "summary": "Get All Credentials", + "description": "The HTTP GET request to the `/api/v1/credentials` path allows you to get an array of credentials records that are added to the backup server.", + "operationId": "GetAllCreds", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of credentials records to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/CredentialsFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of credentials records to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/CredentialsFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts credentials by one of the credentials parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ECredentialsFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/CredentialsFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts credentials in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/CredentialsFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters credentials by the `nameFilter` pattern. The pattern can match any credentials parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/CredentialsFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "Credentials" + ], + "x-veeam-authorize": { + "claims": [ + "CreateCredentials" + ] + }, + "summary": "Add Credentials Record", + "description": "The HTTP POST request to the `/api/v1/credentials` path allows you to add a credentials record.", + "operationId": "CreateCreds", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsSpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Account has been added.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/credentials/{id}": { + "get": { + "tags": [ + "Credentials" + ], + "x-veeam-authorize": { + "claims": [ + "ViewCredentials" + ] + }, + "summary": "Get Credentials Record", + "description": "The HTTP GET request to the `/api/v1/credentials/{id}` path allows you to get a credentials record that has the specified `id`.", + "operationId": "GetCreds", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the credentials record.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "Credentials" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateCredentials" + ] + }, + "summary": "Edit Credentials Record", + "description": "The HTTP PUT request to the `/api/v1/credentials/{id}` path allows you to edit a credentials record that has the specified `id`.", + "operationId": "UpdateCreds", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the credentials record.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsModel" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Credentials record has been updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "delete": { + "tags": [ + "Credentials" + ], + "x-veeam-authorize": { + "claims": [ + "DeleteCredentials" + ] + }, + "summary": "Remove Credentials Record", + "description": "The HTTP DELETE request to the `/api/v1/credentials/{id}` path allows you to remove a credentials record that has the specified `id`.", + "operationId": "DeleteCreds", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the credentials record.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Credentials record has been removed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/credentials/{id}/changepassword": { + "post": { + "tags": [ + "Credentials" + ], + "x-veeam-authorize": { + "claims": [ + "ChangeAccountPassword" + ] + }, + "summary": "Change Password", + "description": "The HTTP POST request to the `/api/v1/credentials/{id}/changepassword` path allows you to change a password of the credentials record that has the specified `id`.", + "operationId": "ChangePasswordForCreds", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the credentials record.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsPasswordChangeSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Password has been changed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/credentials/{id}/changeprivatekey": { + "post": { + "tags": [ + "Credentials" + ], + "x-veeam-authorize": { + "claims": [ + "ChangeLinuxPrivateKey" + ] + }, + "summary": "Change Linux Private Key", + "description": "The HTTP POST request to the `/api/v1/credentials/{id}/changeprivatekey` path allows you to change a Linux private key of the credentials record that has the specified `id`.", + "operationId": "ChangePrivateKeyForCreds", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the credentials record.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateKeyChangeSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Private key has been changed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/credentials/{id}/changerootpassword": { + "post": { + "tags": [ + "Credentials" + ], + "x-veeam-authorize": { + "claims": [ + "ChangeLinuxRootPassword" + ] + }, + "summary": "Change Linux Root Password", + "description": "The HTTP POST request to the `/api/v1/credentials/{id}/changerootpassword` path allows you to change a Linux root password of the credentials record that has the specified `id`.", + "operationId": "ChangeRootPasswordForCreds", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the credentials record.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsPasswordChangeSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Root password has been changed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/encryptionPasswords": { + "get": { + "tags": [ + "Encryption" + ], + "x-veeam-authorize": { + "claims": [ + "ViewEncryptionPasswords" + ] + }, + "summary": "Get All Encryption Passwords", + "description": "The HTTP GET request to the `/api/v1/encryptionPasswords` path allows you to get an array of all passwords that are used for data encryption.", + "operationId": "GetAllEncryptionPasswords", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of passwords to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/EncryptionPasswordsFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of passwords to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/EncryptionPasswordsFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts passwords by one of the password parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EEncryptionPasswordsFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/EncryptionPasswordsFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts passwords in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/EncryptionPasswordsFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "Encryption" + ], + "x-veeam-authorize": { + "claims": [ + "CreateEncryptionPasswords" + ] + }, + "summary": "Add Encryption Password", + "description": "The HTTP POST request to the `/api/v1/encryptionPasswords` path allows you to add an encryption password.", + "operationId": "CreateEncryptionPassword", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordSpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Password has been added.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/encryptionPasswords/{id}": { + "get": { + "tags": [ + "Encryption" + ], + "x-veeam-authorize": { + "claims": [ + "ViewEncryptionPasswords" + ] + }, + "summary": "Get Encryption Password", + "description": "The HTTP GET request to the `/api/v1/encryptionPasswords/{id}` path allows you to get an encryption password that has the specified `id`.", + "operationId": "GetEncryptionPassword", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the encryption password.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "put": { + "tags": [ + "Encryption" + ], + "x-veeam-authorize": { + "claims": [ + "UpdateEncryptionPasswords" + ] + }, + "summary": "Edit Encryption Password", + "description": "The HTTP PUT request to the `/api/v1/encryptionPasswords/{id}` path allows you to edit an encryption password that has the specified `id`.", + "operationId": "UpdateEncryptionPassword", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the encryption password.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordModel" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Password has been updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "delete": { + "tags": [ + "Encryption" + ], + "x-veeam-authorize": { + "claims": [ + "DeleteEncryptionPasswords" + ] + }, + "summary": "Remove Encryption Password", + "description": "The HTTP DELETE request to the `/api/v1/encryptionPasswords/{id}` path allows you to remove an encryption password that has the specified `id`.", + "operationId": "DeleteEncryptionPassword", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the encryption password.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Password has been removed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backups": { + "get": { + "tags": [ + "Backups" + ], + "x-veeam-authorize": { + "claims": [ + "ViewBackups" + ] + }, + "summary": "Get All Backups", + "description": "The HTTP GET request to the `/api/v1/backups` path allows you to get an array of all backups that are created on or imported to the backup server.", + "operationId": "GetAllBackups", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of backups to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of backups to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts backups by one of the backup parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EBackupsFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts backups in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters backups by the `nameFilter` pattern. The pattern can match any backup parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "createdAfterFilter", + "description": "Returns backups that are created after the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "createdBeforeFilter", + "description": "Returns backups that are created before the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "platformIdFilter", + "description": "Filters backups by ID of the backup object platform.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "jobIdFilter", + "description": "Filters backups by ID of the parent job.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + }, + { + "name": "policyTagFilter", + "description": "Filters backups by retention policy tag.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupsFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backups/{id}": { + "get": { + "tags": [ + "Backups" + ], + "x-veeam-authorize": { + "claims": [ + "ViewBackups" + ] + }, + "summary": "Get Backup", + "description": "The HTTP GET request to the `/api/v1/backups/{id}` path allows you to get a backup that has the specified `id`.", + "operationId": "GetBackup", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backups/{id}/objects": { + "get": { + "tags": [ + "Backups" + ], + "x-veeam-authorize": { + "claims": [ + "ViewBackupObjects" + ] + }, + "summary": "Get Backup Objects", + "description": "The HTTP GET request to the `/api/v1/backups/{id}/objects` path allows you to get an array of virtual infrastructure objects (VMs and VM containers) that are inсluded in a backup that has the specified ID.", + "operationId": "GetBackupObjects", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupObjectsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupObjects": { + "get": { + "tags": [ + "Backup Objects" + ], + "x-veeam-authorize": { + "claims": [ + "ViewBackupObjects" + ] + }, + "summary": "Get All Backup Objects", + "description": "The HTTP GET request to the `/api/v1/backupObjects` path allows you to get an array of virtual infrastructure objects (VMs and VM containers) that are inсluded in backups created by the backup server.", + "operationId": "GetAllBackupObjects", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of backup objects to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of backup objects to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts backup objects by one of the backup object parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EBackupObjectsFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts backup objects in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters backup objects by the `nameFilter` pattern. The pattern can match any backup object parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + }, + { + "name": "platformNameFilter", + "description": "Filters backup objects by platform ID.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EPlatformType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + }, + { + "name": "platformIdFilter", + "description": "Filters backup objects by platform ID.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters backup objects by object type.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + }, + { + "name": "viTypeFilter", + "description": "Filters backup objects by the type of VMware vSphere server.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/BackupObjectsFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupObjectsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupObjects/{id}": { + "get": { + "tags": [ + "Backup Objects" + ], + "x-veeam-authorize": { + "claims": [ + "ViewBackupObjects" + ] + }, + "summary": "Get Backup Object", + "description": "The HTTP GET request to the `/api/v1/backupObjects/{id}` path allows you to get a backup object that has the specified `id`.", + "operationId": "GetBackupObject", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup object.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupObjectModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/backupObjects/{id}/restorePoints": { + "get": { + "tags": [ + "Backup Objects" + ], + "x-veeam-authorize": { + "claims": [ + "ViewRestorePoints" + ] + }, + "summary": "Get Restore Points", + "description": "The HTTP GET request to the `/api/v1/backupObjects/{id}/restorePoints` path allows you to get an array of restore points of a backup object that has the specified `id`.", + "operationId": "GetBackupObjectRestorePoints", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the backup object.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObjectRestorePointsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/objectRestorePoints": { + "get": { + "tags": [ + "Object Restore Points" + ], + "x-veeam-authorize": { + "claims": [ + "ViewRestorePoints" + ] + }, + "summary": "Get All Restore Points", + "description": "The HTTP GET request to the `/api/v1/objectRestorePoints` path allows you to get an array of all restore points created on the backup server.", + "operationId": "GetAllObjectRestorePoints", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of restore points to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of restore points to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts restore points by one of the restore point parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EObjectRestorePointsFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts restore points in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "createdAfterFilter", + "description": "Returns restore points that are created after the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "createdBeforeFilter", + "description": "Returns restore points that are created before the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters restore points by the `nameFilter` pattern. The pattern can match any restore point parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "platformNameFilter", + "description": "Filters restore points by name of the backup object platform.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/EPlatformType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "platformIdFilter", + "description": "Filters restore points by ID of the backup object platform.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "backupIdFilter", + "description": "Filters restore points by backup ID.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + }, + { + "name": "backupObjectIdFilter", + "description": "Filters restore points by backup object ID.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/ObjectRestorePointsFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObjectRestorePointsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/objectRestorePoints/{id}": { + "get": { + "tags": [ + "Object Restore Points" + ], + "x-veeam-authorize": { + "claims": [ + "ViewRestorePoints" + ] + }, + "summary": "Get Restore Point", + "description": "The HTTP GET request to the `/api/v1/objectRestorePoints/{id}` path allows you to get a restore point that has the specified `id`.", + "operationId": "GetObjectRestorePoint", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the restore point.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObjectRestorePointModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/objectRestorePoints/{id}/disks": { + "get": { + "tags": [ + "Object Restore Points" + ], + "x-veeam-authorize": { + "claims": [ + "ViewRestorePointDisks" + ] + }, + "summary": "Get Restore Point Disks", + "description": "The HTTP GET request to the `/api/v1/objectRestorePoints/{id}/disks` path allows you to get an array of disks from a restore point that has the specified `id`.", + "operationId": "GetObjectRestorePointDisks", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the restore point.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObjectRestorePointDisksResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/restore/instantRecovery/vmware/fcd/": { + "post": { + "tags": [ + "Restore" + ], + "x-veeam-authorize": { + "claims": [ + "StartFCDInstantRecovery" + ] + }, + "summary": "Start Instant FCD Recovery", + "description": "The HTTP POST request to the `/api/v1/restore/instantRecovery/vmware/fcd/` path allows you to start Instant FCD Recovery from the specified restore point to the specified cluster. For details on how to get a cluster model, see [Get VMware vSphere Server Objects](#operation/GetVmwareHostObject).", + "operationId": "InstantRecoveryVmwareFcdMount", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VmwareFcdInstantRecoverySpec" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Instant FCD Recovery has been started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VmwareFcdInstantRecoveryMount" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/restore/instantRecovery/vmware/fcd/{mountId}": { + "get": { + "tags": [ + "Restore" + ], + "x-veeam-authorize": { + "claims": [ + "ViewIRMountedDisks" + ] + }, + "summary": "Get Mount Information", + "description": "The HTTP GET request to the `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}` path allows you to get information about the mounted vPower NFS datastore, such as restore session ID, mount state, instant recovery settings and disks that will be recovered.", + "operationId": "GetVmwareFcdInstantRecoveryMountModel", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "mountId", + "description": "Mount ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VmwareFcdInstantRecoveryMount" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount": { + "post": { + "tags": [ + "Restore" + ], + "x-veeam-authorize": { + "claims": [ + "DismountIRDisks" + ] + }, + "summary": "Stop FCD Publishing", + "description": "The HTTP POST request to the `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount` path allows you to stop publishing the recovered FCDs and remove the disks from the datastore.", + "operationId": "InstantRecoveryVmwareFcdDismount", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "mountId", + "description": "Mount ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Disks has been unmounted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VmwareFcdInstantRecoveryMount" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate": { + "post": { + "tags": [ + "Restore" + ], + "x-veeam-authorize": { + "claims": [ + "MigrateIRMountedDisks" + ] + }, + "summary": "Start FCD Migration", + "description": "The HTTP POST request to the `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate` path allows you to start migration of FCDs from the specified mount.", + "operationId": "InstantRecoveryVmwareFcdMigrate", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "mountId", + "description": "Mount ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VmwareFcdQuickMigrationSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "FCD Migration has been started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VmwareFcdInstantRecoveryMount" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/jobs/import": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ImportJobs" + ] + }, + "summary": "Import Jobs", + "description": "The HTTP POST request to the `/api/v1/automation/jobs/import` path allows you to import jobs to Veeam Backup & Replication.", + "operationId": "ImportJobs", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobImportSpecCollection" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Automation session has been created to import the jobs. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/jobs/export": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ExportJobs" + ] + }, + "summary": "Export Jobs", + "description": "The HTTP POST request to the `/api/v1/automation/jobs/export` path allows you to export jobs from Veeam Backup & Replication.", + "operationId": "ExportJobs", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobExportSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobImportSpecCollection" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/credentials/import": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ImportCredentials" + ] + }, + "summary": "Import Credentials", + "description": "The HTTP POST request to the `/api/v1/automation/credentials/import` path allows you to import credentials to Veeam Backup & Replication.", + "operationId": "ImportCredentials", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsImportSpecCollection" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Automation session has been created to import the credentials. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/credentials/export": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ExportCredentials" + ] + }, + "summary": "Export Credentials", + "description": "The HTTP POST request to the `/api/v1/automation/credentials/export` path allows you to export credentials from Veeam Backup & Replication.", + "operationId": "ExportCredentials", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsExportSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialsImportSpecCollection" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/proxies/import": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ImportProxies" + ] + }, + "summary": "Import Proxies", + "description": "The HTTP POST request to the `/api/v1/automation/proxies/import` path allows you to import backup proxies to Veeam Backup & Replication.", + "operationId": "ImportProxies", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProxyImportSpecCollection" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Automation session has been created to import the proxies. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/proxies/export": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ExportProxies" + ] + }, + "summary": "Export Proxies", + "description": "The HTTP POST request to the `/api/v1/automation/proxies/export` path allows you to export backup proxies from Veeam Backup & Replication.", + "operationId": "ExportProxies", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProxyExportSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProxyImportSpecCollection" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/managedServers/import": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ImportManagedServers" + ] + }, + "summary": "Import Servers", + "description": "The HTTP POST request to the `/api/v1/automation/managedServers/import` path allows you to import managed servers to Veeam Backup & Replication.", + "operationId": "ImportManagedServers", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManageServerImportSpecCollection" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Automation session has been created to import the servers. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/managedServers/export": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ExportManagedServers" + ] + }, + "summary": "Export Servers", + "description": "The HTTP POST request to the `/api/v1/automation/managedServers/export` path allows you to export managed servers from Veeam Backup & Replication.", + "operationId": "ExportManagedServers", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManageServerExportSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ManageServerImportSpecCollection" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/repositories/import": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ImportRepositories" + ] + }, + "summary": "Import Repositories", + "description": "The HTTP POST request to the `/api/v1/automation/repositories/import` path allows you to import backup repositories to Veeam Backup & Replication.", + "operationId": "ImportRepositories", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryImportSpecCollection" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Automation session has been created to import the repositories. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/repositories/export": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ExportRepositories" + ] + }, + "summary": "Export Repositories", + "description": "The HTTP POST request to the `/api/v1/automation/repositories/export` path allows you to export backup repositories from Veeam Backup & Replication.", + "operationId": "ExportRepositories", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryExportSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryImportSpecCollection" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/encryptionPasswords/import": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ImportEncryptionPasswords" + ] + }, + "summary": "Import Encryption Passwords", + "description": "The HTTP POST request to the `/api/v1/automation/encryptionPasswords/import` path allows you to import encryption passwords to Veeam Backup & Replication.", + "operationId": "ImportEncryptionPasswords", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordImportSpecCollection" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Automation session has been created to import the passwords. To check the progress, track the session `state`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/encryptionPasswords/export": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ExportEncryptionPasswords" + ] + }, + "summary": "Export Encryption Passwords", + "description": "The HTTP POST request to the `/api/v1/automation/encryptionPasswords/export` path allows you to export encryption passwords from Veeam Backup & Replication.", + "operationId": "ExportEncryptionPasswords", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordExportSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EncryptionPasswordImportSpecCollection" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/sessions": { + "get": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ViewSessions" + ] + }, + "summary": "Get All Automation Sessions", + "description": "The HTTP GET request to the `/api/v1/automation/sessions` path allows you to get an array of all automation sessions performed on the backup server.", + "operationId": "GetAllAutomationSessions", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "skip", + "description": "Number of sessions to skip.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "limit", + "description": "Maximum number of sessions to return.", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "orderColumn", + "description": "Sorts sessions by one of the session parameters.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionsFiltersOrderColumn" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "orderAsc", + "description": "Sorts sessions in the ascending order by the `orderColumn` parameter.", + "in": "query", + "schema": { + "type": "boolean" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "nameFilter", + "description": "Filters sessions by the `nameFilter` pattern. The pattern can match any session parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "in": "query", + "schema": { + "type": "string" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "createdAfterFilter", + "description": "Returns sessions that are created after the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "createdBeforeFilter", + "description": "Returns sessions that are created before the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "endedAfterFilter", + "description": "Returns sessions that are finished after the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "endedBeforeFilter", + "description": "Returns sessions that are finished before the specified date and time.", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "typeFilter", + "description": "Filters sessions by session type.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionType" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "stateFilter", + "description": "Filters sessions by session state.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionState" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "resultFilter", + "description": "Filters sessions by session result.", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ESessionResult" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + }, + { + "name": "jobIdFilter", + "description": "Filters sessions by job ID.", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + }, + "x-veeam-spec": { + "$ref": "#/components/schemas/SessionsFilters" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionsResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/sessions/{id}": { + "get": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ViewSessions" + ] + }, + "summary": "Get Automation Session", + "description": "The HTTP GET request to the `/api/v1/automation/sessions/{id}` path allows you to get an automation session that has the specified `id`.", + "operationId": "GetAutomationSession", + "parameters": [ + { + "name": "id", + "description": "ID of the session.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionModel" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/sessions/{id}/logs": { + "get": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "ViewSessions" + ] + }, + "summary": "Get Automation Session Logs", + "description": "The HTTP GET request to the `/api/v1/automation/sessions/{id}/logs` path allows you to get an array of log records of an automation session that has the specified `id`.", + "operationId": "GetAutomationSessionLogs", + "parameters": [ + { + "name": "id", + "description": "ID of the session.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "$ref": "#/components/parameters/apiVersionParam" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionLogResult" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/api/v1/automation/sessions/{id}/stop": { + "post": { + "tags": [ + "Automation" + ], + "x-veeam-authorize": { + "claims": [ + "StopSessions" + ] + }, + "summary": "Stop Automation Session", + "description": "The HTTP POST request to the `/api/v1/automation/sessions/{id}/stop` path allows you to stop an automation session that has the specified `id`.", + "operationId": "StopAutomationSession", + "parameters": [ + { + "$ref": "#/components/parameters/apiVersionParam" + }, + { + "name": "id", + "description": "ID of the session.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + } + }, + "components": { + "responses": { + "Deleted": { + "description": "Removed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptySuccessResponse" + } + } + } + }, + "BadRequest": { + "description": "Bad request. This error is related to POST/PUT requests. The request body is malformed, incomplete or otherwise invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "Unauthorized": { + "description": "Unauthorized. The authorization header has been expected but not found (or found but is expired).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "Forbidden": { + "description": "Forbidden. The user sending the request does not have adequate privileges to access one or more objects specified in the request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "NotFound": { + "description": "Not found. No object was found with the path parameter specified in the request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "InternalServerError": { + "description": "Internal server error. The request has been received but could not be completed because of an internal error at the server side.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + }, + "schemas": { + "ServerTimeModel": { + "required": [ + "serverTime" + ], + "type": "object", + "properties": { + "serverTime": { + "description": "Current date and time on the server.", + "type": "string", + "format": "date-time" + }, + "timeZone": { + "type": "string" + } + } + }, + "Error": { + "required": [ + "errorCode", + "message" + ], + "type": "object", + "properties": { + "errorCode": { + "type": "string", + "description": "The error code is a string that uniquely identifies an error condition and should be understood by programs that detect and handle errors by type", + "enum": [ + "AccessDenied", + "ExpiredToken", + "InvalidToken", + "InvalidURI", + "MethodNotAllowed", + "NotFound", + "NotImplemented", + "ServiceUnavailable", + "UnexpectedContent", + "UnknownError" + ] + }, + "message": { + "type": "string", + "description": "The error message contains a generic description of the error condition in English. It is intended for a human audience" + }, + "resourceId": { + "type": "string", + "description": "ID of the object that is involved in the error (or empty)" + } + }, + "description": "" + }, + "PaginationResult": { + "description": "Pagination settings.", + "required": [ + "total", + "count" + ], + "type": "object", + "properties": { + "total": { + "description": "Total number of results.", + "type": "integer", + "format": "int32" + }, + "count": { + "description": "Number of returned results.", + "type": "integer", + "format": "int32" + }, + "skip": { + "description": "Number of skipped results.", + "type": "integer", + "format": "int32" + }, + "limit": { + "description": "Maximum number of results to return.", + "type": "integer", + "format": "int32" + } + } + }, + "EmptySuccessResponse": { + "type": "object", + "description": "Empty success response (200, 201, 204)." + }, + "SessionsFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/ESessionsFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + }, + "nameFilter": { + "type": "string" + }, + "createdAfterFilter": { + "type": "string", + "format": "date-time" + }, + "createdBeforeFilter": { + "type": "string", + "format": "date-time" + }, + "endedAfterFilter": { + "type": "string", + "format": "date-time" + }, + "endedBeforeFilter": { + "type": "string", + "format": "date-time" + }, + "typeFilter": { + "$ref": "#/components/schemas/ESessionType" + }, + "stateFilter": { + "$ref": "#/components/schemas/ESessionState" + }, + "resultFilter": { + "$ref": "#/components/schemas/ESessionResult" + }, + "jobIdFilter": { + "type": "string", + "format": "uuid" + } + } + }, + "ESessionsFiltersOrderColumn": { + "type": "string", + "enum": [ + "Name", + "SessionType", + "CreationTime", + "EndTime", + "State", + "Result" + ] + }, + "SessionsResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of sessions.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "SessionModel": { + "required": [ + "activityId", + "creationTime", + "id", + "name", + "sessionType", + "state", + "usn" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the session.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the session.", + "type": "string" + }, + "activityId": { + "description": "ID of the activity.", + "type": "string", + "format": "uuid" + }, + "sessionType": { + "$ref": "#/components/schemas/ESessionType" + }, + "creationTime": { + "description": "Date and time the session was created.", + "type": "string", + "format": "date-time" + }, + "endTime": { + "description": "Date and time the session was ended.", + "type": "string", + "format": "date-time" + }, + "state": { + "$ref": "#/components/schemas/ESessionState" + }, + "progressPercent": { + "description": "Progress percentage of the session.", + "type": "integer" + }, + "result": { + "$ref": "#/components/schemas/SessionResultModel" + }, + "resourceId": { + "description": "ID of the resource.", + "type": "string", + "format": "uuid" + }, + "resourceReference": { + "description": "URI of the resource.", + "type": "string" + }, + "parentSessionId": { + "description": "ID of the parent session.", + "type": "string", + "format": "uuid" + }, + "usn": { + "description": "Update sequence number.", + "type": "integer", + "format": "int64" + } + } + }, + "SessionResultModel": { + "required": [ + "result" + ], + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/ESessionResult" + }, + "message": { + "description": "Message that explains the session result.", + "type": "string" + }, + "isCanceled": { + "description": "If *true*, the session has been canceled.", + "type": "boolean" + } + } + }, + "ESessionType": { + "description": "Type of the session.", + "type": "string", + "enum": [ + "Infrastructure", + "Job", + "Automation", + "ConfigurationBackup", + "RepositoryMaintenance", + "RepositoryEvacuate", + "InfrastructureItemDeletion" + ] + }, + "ESessionState": { + "description": "State of the session.", + "type": "string", + "enum": [ + "Stopped", + "Starting", + "Stopping", + "Working", + "Pausing", + "Resuming", + "WaitingTape", + "Idle", + "Postprocessing", + "WaitingRepository", + "WaitingSlot" + ] + }, + "ESessionResult": { + "description": "Result of the session.", + "type": "string", + "enum": [ + "None", + "Success", + "Warning", + "Failed" + ] + }, + "SessionLogResult": { + "description": "Log of the session.", + "type": "object", + "properties": { + "totalRecords": { + "description": "Total number of records.", + "type": "integer" + }, + "records": { + "description": "Array of log records.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionLogRecordModel" + } + } + } + }, + "SessionLogRecordModel": { + "description": "Record of the session log.", + "type": "object", + "properties": { + "id": { + "description": "ID of the log record.", + "type": "integer" + }, + "status": { + "description": "Status of the operation described by the log record.", + "$ref": "#/components/schemas/ETaskLogRecordStatus" + }, + "startTime": { + "description": "Date and time the operation was started.", + "type": "string", + "format": "date-time" + }, + "updateTime": { + "description": "Date and time the log record was updated.", + "type": "string", + "format": "date-time" + }, + "title": { + "description": "Title of the log record.", + "type": "string" + }, + "description": { + "description": "Description of the log record.", + "type": "string" + } + } + }, + "ETaskLogRecordStatus": { + "type": "string", + "enum": [ + "None", + "Succeeded", + "Warning", + "Failed" + ] + }, + "CertificateModel": { + "required": [ + "issuedBy", + "issuedTo", + "keyAlgorithm", + "keySize", + "serialNumber", + "subject", + "thumbprint", + "validBy", + "validFrom" + ], + "type": "object", + "properties": { + "thumbprint": { + "description": "Thumbprint of the certificate.", + "type": "string" + }, + "serialNumber": { + "description": "Serial number of the certificate.", + "type": "string" + }, + "keyAlgorithm": { + "description": "Key algorithm of the certificate.", + "type": "string" + }, + "keySize": { + "description": "Key size of the certificate.", + "type": "string" + }, + "subject": { + "description": "Subject of the certificate.", + "type": "string" + }, + "issuedTo": { + "description": "Acquirer of the certificate.", + "type": "string" + }, + "issuedBy": { + "description": "Issuer of the certificate.", + "type": "string" + }, + "validFrom": { + "description": "Date and time the certificate is valid from.", + "type": "string", + "format": "date-time" + }, + "validBy": { + "description": "Expiration date and time of the certificate.", + "type": "string", + "format": "date-time" + } + } + }, + "AuthorizationCodeModel": { + "required": [ + "code" + ], + "type": "object", + "properties": { + "code": { + "description": "String that is used to obtain an access token. Lifetime of the authorization code is 60 seconds.", + "type": "string" + } + } + }, + "TokenLoginSpec": { + "required": [ + "grant_type" + ], + "type": "object", + "properties": { + "grant_type": { + "$ref": "#/components/schemas/ELoginGrantType" + }, + "username": { + "description": "User name. Required if the `grant_type` value is `password`.", + "type": "string" + }, + "password": { + "description": "Password. Required if the `grant_type` value is `password`.", + "type": "string", + "format": "password" + }, + "refresh_token": { + "description": "Refresh token. Required if the `grant_type` value is `refresh_token`.", + "type": "string" + }, + "code": { + "type": "string", + "description": "Authorization code. Required if the `grant_type` value is `authorization_code`." + }, + "use_short_term_refresh": { + "description": "If *true*, a short-term refresh token is used. Lifetime of the short-term refresh token is the access token lifetime plus 15 minutes.", + "type": "boolean" + } + } + }, + "ELoginGrantType": { + "description": "Authorization grant type.\n\nAvailable values:\n- `password` — used to obtain an access token by providing a user name and password.\n- `refresh_token` — used to refresh an expired or lost access token by providing a refresh token.\n- `authorization_code` — used to obtain an access token by providing an authorization code.\n", + "type": "string", + "enum": [ + "password", + "refresh_token", + "authorization_code" + ], + "default": "password" + }, + "TokenModel": { + "required": [ + ".expires", + ".issued", + "access_token", + "expires_in", + "refresh_token", + "token_type" + ], + "type": "object", + "properties": { + "access_token": { + "description": "String that represents authorization issued to the client. It must be specified in all requests. An access token can be used multiple times, but its lifetime is 15 minutes.", + "type": "string" + }, + "token_type": { + "description": "Type of the access token.", + "type": "string" + }, + "refresh_token": { + "description": "String that is used to obtain a new access token if the current access token expires or becomes lost. A refresh token can be used only once, and its default lifetime is 14 days.", + "type": "string" + }, + "expires_in": { + "description": "Lifetime of the access token, in seconds.", + "type": "integer", + "format": "int32" + }, + ".issued": { + "description": "Date and time the access token is issued.", + "type": "string", + "format": "date-time" + }, + ".expires": { + "description": "Date and time the access token expires.", + "type": "string", + "format": "date-time" + } + } + }, + "HostConnectionSpec": { + "required": [ + "serverName", + "credentialsId", + "type" + ], + "type": "object", + "properties": { + "serverName": { + "description": "Full DNS name or IP address of the server.", + "type": "string" + }, + "credentialsId": { + "description": "ID of a credentials record used to connect to the server.", + "type": "string", + "format": "uuid" + }, + "type": { + "$ref": "#/components/schemas/EManagedServerType" + }, + "port": { + "description": "Port used to communicate with the server.", + "type": "integer" + } + } + }, + "ERepositoryType": { + "description": "Repository type.", + "type": "string", + "enum": [ + "WinLocal", + "LinuxLocal", + "Smb", + "Nfs", + "AzureBlob", + "AzureArchive", + "AmazonS3", + "AmazonS3Glacier", + "S3Compatible", + "GoogleCloud", + "IBMCloud" + ] + }, + "EPlatform": { + "type": "string", + "enum": [ + "Vmware", + "HyperV", + "Test", + "Vcd", + "Tape", + "EndPoint", + "LinuxPhysical", + "CustomPlatform", + "Conf", + "NasBackup", + "EmulatedVmWare", + "Extension0", + "Extension1", + "Extension" + ] + }, + "ManagedServersFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EManagedServersFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + }, + "nameFilter": { + "type": "string" + }, + "typeFilter": { + "$ref": "#/components/schemas/EManagedServerType" + }, + "viTypeFilter": { + "$ref": "#/components/schemas/EViHostType" + } + } + }, + "EManagedServersFiltersOrderColumn": { + "type": "string", + "enum": [ + "Name", + "Type", + "Description" + ] + }, + "ManagedServersResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of managed servers.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ManagedServerModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "ManagedServerModel": { + "required": [ + "credentialsId", + "description", + "id", + "name", + "type" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the server.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Full DNS name or IP address of the server.", + "type": "string" + }, + "description": { + "description": "Description of the server.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EManagedServerType" + }, + "credentialsId": { + "description": "ID of a credentials record used to connect to the server.", + "type": "string", + "format": "uuid" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/WindowsHostModel" + }, + { + "$ref": "#/components/schemas/LinuxHostModel" + }, + { + "$ref": "#/components/schemas/ViHostModel" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "WindowsHost": "#/components/schemas/WindowsHostModel", + "LinuxHost": "#/components/schemas/LinuxHostModel", + "ViHost": "#/components/schemas/ViHostModel" + } + } + }, + "EManagedServerType": { + "description": "Type of the server.", + "type": "string", + "enum": [ + "WindowsHost", + "LinuxHost", + "ViHost" + ] + }, + "ManagedServerSpec": { + "required": [ + "credentialsId", + "description", + "name", + "type" + ], + "type": "object", + "properties": { + "name": { + "description": "Full DNS name or IP address of the server.", + "type": "string" + }, + "description": { + "description": "Description of the server.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EManagedServerType" + }, + "credentialsId": { + "description": "ID of the credentials used to connect to the server.", + "type": "string", + "format": "uuid" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/WindowsHostSpec" + }, + { + "$ref": "#/components/schemas/LinuxHostSpec" + }, + { + "$ref": "#/components/schemas/ViHostSpec" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "WindowsHost": "#/components/schemas/WindowsHostSpec", + "LinuxHost": "#/components/schemas/LinuxHostSpec", + "ViHost": "#/components/schemas/ViHostSpec" + } + } + }, + "WindowsHostSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/ManagedServerSpec" + }, + { + "type": "object", + "properties": { + "networkSettings": { + "$ref": "#/components/schemas/WindowsHostPortsModel" + } + } + } + ] + }, + "WindowsHostModel": { + "allOf": [ + { + "$ref": "#/components/schemas/ManagedServerModel" + }, + { + "type": "object", + "properties": { + "networkSettings": { + "$ref": "#/components/schemas/WindowsHostPortsModel" + } + } + } + ] + }, + "WindowsHostPortsModel": { + "description": "Network ports.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WindowsHostComponentPortModel" + } + }, + "portRangeStart": { + "description": "Start port used for data transfer.", + "type": "integer" + }, + "portRangeEnd": { + "description": "End port used for data transfer.", + "type": "integer" + }, + "serverThisSide": { + "description": "If *true*, the server is run on this side.", + "type": "boolean" + } + } + }, + "WindowsHostComponentPortModel": { + "description": "Ports used by Veeam Backup & Replication components.", + "required": [ + "componentName", + "port" + ], + "type": "object", + "properties": { + "componentName": { + "$ref": "#/components/schemas/EWindowsHostComponentType" + }, + "port": { + "description": "Port used by the component.", + "type": "integer" + } + } + }, + "EWindowsHostComponentType": { + "description": "Veeam Backup & Replication component.", + "type": "string", + "enum": [ + "Transport", + "Nfs", + "HvIntegration", + "DeployerSvc", + "WanAccelerator", + "Tape", + "CloudGate", + "CloudServiceInvoker", + "CloudServiceRemoting", + "RestoreProxy", + "EpAgent", + "EpAgentSqlLocalDB", + "EpAgentSharedManagementObjects", + "EpAgentSqlSysClrTypes", + "AgentConfigureService", + "VawRedist", + "ValRedist", + "GuestControl", + "FileSystemVssIntegration", + "VssHwSnapshotProvider", + "Cdp", + "VamRedist" + ] + }, + "LinuxHostSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/ManagedServerSpec" + } + ], + "type": "object", + "required": [ + "sshFingerprint" + ], + "properties": { + "sshSettings": { + "$ref": "#/components/schemas/LinuxHostSSHSettingsModel" + }, + "sshFingerprint": { + "description": "SSH key fingerprint used to verify the server identity. For details on how to get the fingerprint, see [Get TLS Certificate or SSH Fingerprint](#operation/GetConnectionCertificate).\n", + "type": "string" + } + } + }, + "LinuxHostModel": { + "allOf": [ + { + "$ref": "#/components/schemas/ManagedServerModel" + }, + { + "type": "object", + "properties": { + "sshSettings": { + "$ref": "#/components/schemas/LinuxHostSSHSettingsModel" + } + } + } + ] + }, + "LinuxHostSSHSettingsModel": { + "description": "SSH settings.", + "type": "object", + "properties": { + "sshTimeOutMs": { + "description": "SSH timeout, in ms. If a task targeted at the server is inactive after the timeout, the task is terminated.", + "type": "integer" + }, + "portRangeStart": { + "description": "Start port used for data transfer.", + "type": "integer" + }, + "portRangeEnd": { + "description": "End port used for data transfer.", + "type": "integer" + }, + "serverThisSide": { + "description": "If *true*, the server is run on this side.", + "type": "boolean" + }, + "managementPort": { + "description": "Port used as a control channel from the Veeam Backup & Replication console to the Linux server.", + "type": "integer" + } + } + }, + "ViHostModel": { + "allOf": [ + { + "$ref": "#/components/schemas/ManagedServerModel" + }, + { + "type": "object", + "required": [ + "port" + ], + "properties": { + "viHostType": { + "$ref": "#/components/schemas/EViHostType" + }, + "port": { + "description": "Port used to communicate with the server.", + "type": "integer" + } + } + } + ] + }, + "EViHostType": { + "description": "Type of the VMware vSphere server.", + "type": "string", + "enum": [ + "ESX", + "ESXi", + "VC" + ] + }, + "ViHostSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/ManagedServerSpec" + }, + { + "type": "object", + "properties": { + "port": { + "description": "Port used to communicate with the server.", + "type": "integer" + }, + "certificateThumbprint": { + "description": "[Optional] Certificate thumbprint used to verify the server identity. For details on how to get the thumbprint, see [Get TLS Certificate or SSH Fingerprint](#operation/GetConnectionCertificate).\n", + "type": "string" + } + } + } + ] + }, + "RepositoriesFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/ERepositoryFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + }, + "nameFilter": { + "type": "string" + }, + "typeFilter": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "hostIdFilter": { + "type": "string", + "format": "uuid" + }, + "pathFilter": { + "type": "string" + }, + "vmbApiFilter": { + "description": "VmbApiFilterModel as json serialized in base64 format (see VmbApiFilterModel)", + "type": "string" + } + } + }, + "ERepositoryFiltersOrderColumn": { + "type": "string", + "enum": [ + "Name", + "Description", + "Type", + "Host", + "Path" + ] + }, + "RepositoriesResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of backup repositories.", + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "VmbApiFilterModel": { + "type": "object", + "required": [ + "protocolVersion", + "assemblyVersion", + "productId", + "versionFlags" + ], + "properties": { + "protocolVersion": { + "type": "integer" + }, + "assemblyVersion": { + "type": "string" + }, + "productId": { + "type": "string", + "format": "uuid" + }, + "versionFlags": { + "type": "integer" + } + } + }, + "RepositorySpec": { + "required": [ + "description", + "name", + "type", + "kind" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the backup repository.", + "type": "string" + }, + "description": { + "description": "Description of the backup repository.", + "type": "string" + }, + "tag": { + "description": "VMware vSphere tag assigned to the backup repository.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ERepositoryType" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/WindowsLocalStorageSpec" + }, + { + "$ref": "#/components/schemas/LinuxLocalStorageSpec" + }, + { + "$ref": "#/components/schemas/NfsStorageSpec" + }, + { + "$ref": "#/components/schemas/SmbStorageSpec" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "WinLocal": "#/components/schemas/WindowsLocalStorageSpec", + "LinuxLocal": "#/components/schemas/LinuxLocalStorageSpec", + "Smb": "#/components/schemas/SmbStorageSpec", + "Nfs": "#/components/schemas/NfsStorageSpec" + } + } + }, + "RepositoryModel": { + "required": [ + "description", + "id", + "name", + "type", + "kind" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the backup repository.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the backup repository.", + "type": "string" + }, + "description": { + "description": "Description of the backup repository.", + "type": "string" + }, + "tag": { + "description": "VMware vSphere tag assigned to the backup repository.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ERepositoryType" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/WindowsLocalStorageModel" + }, + { + "$ref": "#/components/schemas/LinuxLocalStorageModel" + }, + { + "$ref": "#/components/schemas/NfsStorageModel" + }, + { + "$ref": "#/components/schemas/SmbStorageModel" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "WinLocal": "#/components/schemas/WindowsLocalStorageModel", + "LinuxLocal": "#/components/schemas/LinuxLocalStorageModel", + "Smb": "#/components/schemas/SmbStorageModel", + "Nfs": "#/components/schemas/NfsStorageModel" + } + } + }, + "SmbRepositoryShareSettingsModel": { + "description": "Share settings.", + "required": [ + "credentialsId", + "sharePath" + ], + "type": "object", + "properties": { + "sharePath": { + "description": "Path to the shared folder that that is used as a backup repository.", + "type": "string" + }, + "credentialsId": { + "description": "ID of the credentials record used to access the shared folder.", + "type": "string", + "format": "uuid" + }, + "gatewayServer": { + "$ref": "#/components/schemas/RepositoryShareGatewayModel" + } + } + }, + "NfsRepositoryShareSettingsModel": { + "description": "Share settings.", + "required": [ + "sharePath" + ], + "type": "object", + "properties": { + "sharePath": { + "description": "Path to the shared folder that that is used as a backup repository.", + "type": "string" + }, + "gatewayServer": { + "$ref": "#/components/schemas/RepositoryShareGatewayModel" + } + } + }, + "RepositoryShareGatewayModel": { + "description": "Settings for the gateway server.", + "type": "object", + "properties": { + "autoSelect": { + "description": "If *true*, Veeam Backup & Replication automatically selects a gateway server.", + "type": "boolean" + }, + "gatewayServerId": { + "description": "ID of the gateway server.", + "type": "string", + "format": "uuid" + } + } + }, + "WindowsLocalRepositorySettingsModel": { + "description": "Repository settings.", + "type": "object", + "properties": { + "path": { + "description": "Path to the folder where backup files are stored.", + "type": "string" + }, + "maxTaskCount": { + "description": "Maximum number of concurrent tasks.", + "type": "integer" + }, + "readWriteRate": { + "description": "Maximum rate that restricts the total speed of reading and writing data to the backup repository disk.", + "type": "integer" + }, + "advancedSettings": { + "$ref": "#/components/schemas/RepositoryAdvancedSettingsModel" + } + } + }, + "LinuxLocalRepositorySettingsModel": { + "description": "Repository settings.", + "type": "object", + "properties": { + "path": { + "description": "Path to the folder where backup files are stored.", + "type": "string" + }, + "maxTaskCount": { + "description": "Maximum number of concurrent tasks.", + "type": "integer" + }, + "readWriteRate": { + "description": "Maximum rate that restricts the total speed of reading and writing data to the backup repository disk.", + "type": "integer" + }, + "useFastCloningOnXFSVolumes": { + "description": "[For Linux repository] If *true*, fast cloning on XFS volumes is used.\n", + "type": "boolean" + }, + "useImmutableBackups": { + "description": "If *true*, the Object Lock feature is used to protect recent backups.", + "type": "boolean" + }, + "makeRecentBackupsImmutableDays": { + "description": "Number of days to keep immutable backups.", + "type": "integer" + }, + "advancedSettings": { + "$ref": "#/components/schemas/RepositoryAdvancedSettingsModel" + } + } + }, + "NetworkRepositorySettingsModel": { + "description": "Repository settings.", + "type": "object", + "properties": { + "maxTaskCount": { + "description": "Maximum number of concurrent tasks.", + "type": "integer" + }, + "readWriteRate": { + "description": "Maximum rate that restricts the total speed of reading and writing data to the backup repository disk.", + "type": "integer" + }, + "advancedSettings": { + "$ref": "#/components/schemas/RepositoryAdvancedSettingsModel" + } + } + }, + "RepositoryAdvancedSettingsModel": { + "description": "Advanced settings for the backup repository.", + "type": "object", + "properties": { + "alignDataBlocks": { + "description": "If *true*, Veeam Backup & Replication aligns VM data saved to a backup file at a 4 KB block boundary.", + "type": "boolean" + }, + "decompressBeforeStoring": { + "description": "If *true*, Veeam Backup & Replication decompresses backup data blocks before storing to improve deduplication ratios.", + "type": "boolean" + }, + "rotatedDrives": { + "description": "If *true*, the repository drive is rotated.", + "type": "boolean" + }, + "perVmBackup": { + "description": "If *true*, Veeam Backup & Replication creates a separate backup file for every VM in the job.", + "type": "boolean" + } + } + }, + "MountServerSettingsModel": { + "description": "Settings for the mount server that is used for file-level and application items restore.", + "required": [ + "mountServerId", + "vPowerNFSEnabled", + "writeCacheFolder" + ], + "type": "object", + "properties": { + "mountServerId": { + "description": "ID of the mount server.", + "type": "string", + "format": "uuid" + }, + "writeCacheFolder": { + "description": "Path to the folder used for writing cache during mount operations.", + "type": "string" + }, + "vPowerNFSEnabled": { + "description": "If *true*, the vPower NFS Service is enabled on the mount server.", + "type": "boolean" + }, + "vPowerNFSPortSettings": { + "$ref": "#/components/schemas/VPowerNFSPortSettingsModel" + } + } + }, + "VPowerNFSPortSettingsModel": { + "description": "Network ports used by the vPower NFS Service.", + "type": "object", + "properties": { + "mountPort": { + "description": "Mount port.", + "type": "integer" + }, + "vPowerNFSPort": { + "description": "vPower NFS port.", + "type": "integer" + } + } + }, + "WindowsLocalStorageSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/RepositorySpec" + }, + { + "type": "object", + "required": [ + "hostId", + "mountServer", + "repository" + ], + "properties": { + "hostId": { + "description": "ID of the server that is used as a backup repository.", + "type": "string", + "format": "uuid" + }, + "repository": { + "$ref": "#/components/schemas/WindowsLocalRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsModel" + } + } + } + ] + }, + "LinuxLocalStorageSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/RepositorySpec" + }, + { + "type": "object", + "required": [ + "hostId", + "mountServer", + "repository" + ], + "properties": { + "hostId": { + "description": "ID of the server that is used as a backup repository.", + "type": "string", + "format": "uuid" + }, + "repository": { + "$ref": "#/components/schemas/LinuxLocalRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsModel" + } + } + } + ] + }, + "WindowsLocalStorageModel": { + "description": "Direct attached storage.", + "allOf": [ + { + "$ref": "#/components/schemas/RepositoryModel" + }, + { + "type": "object", + "required": [ + "hostId", + "mountServer", + "repository" + ], + "properties": { + "hostId": { + "description": "ID of the server that is used as a backup repository.", + "type": "string", + "format": "uuid" + }, + "repository": { + "$ref": "#/components/schemas/WindowsLocalRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsModel" + } + } + } + ] + }, + "LinuxLocalStorageModel": { + "description": "Direct attached storage.", + "allOf": [ + { + "$ref": "#/components/schemas/RepositoryModel" + }, + { + "type": "object", + "required": [ + "hostId", + "mountServer", + "repository" + ], + "properties": { + "hostId": { + "description": "ID of the server that is used as a backup repository.", + "type": "string", + "format": "uuid" + }, + "repository": { + "$ref": "#/components/schemas/LinuxLocalRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsModel" + } + } + } + ] + }, + "NfsStorageSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/RepositorySpec" + }, + { + "type": "object", + "required": [ + "mountServer", + "repository", + "share" + ], + "properties": { + "share": { + "$ref": "#/components/schemas/NfsRepositoryShareSettingsModel" + }, + "repository": { + "$ref": "#/components/schemas/NetworkRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsModel" + } + } + } + ] + }, + "SmbStorageSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/RepositorySpec" + }, + { + "type": "object", + "required": [ + "mountServer", + "repository", + "share" + ], + "properties": { + "share": { + "$ref": "#/components/schemas/SmbRepositoryShareSettingsModel" + }, + "repository": { + "$ref": "#/components/schemas/NetworkRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsModel" + } + } + } + ] + }, + "NfsStorageModel": { + "description": "Network attached storage.", + "allOf": [ + { + "$ref": "#/components/schemas/RepositoryModel" + }, + { + "type": "object", + "required": [ + "mountServer", + "repository", + "share" + ], + "properties": { + "share": { + "$ref": "#/components/schemas/NfsRepositoryShareSettingsModel" + }, + "repository": { + "$ref": "#/components/schemas/NetworkRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsModel" + } + } + } + ] + }, + "SmbStorageModel": { + "description": "Network attached storage.", + "allOf": [ + { + "$ref": "#/components/schemas/RepositoryModel" + }, + { + "type": "object", + "required": [ + "mountServer", + "repository", + "share" + ], + "properties": { + "share": { + "$ref": "#/components/schemas/SmbRepositoryShareSettingsModel" + }, + "repository": { + "$ref": "#/components/schemas/NetworkRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsModel" + } + } + } + ] + }, + "ProxiesFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EProxiesFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + }, + "nameFilter": { + "type": "string" + }, + "typeFilter": { + "$ref": "#/components/schemas/EProxyType" + }, + "hostIdFilter": { + "type": "string", + "format": "uuid" + } + } + }, + "EProxiesFiltersOrderColumn": { + "type": "string", + "enum": [ + "Name", + "Type", + "Description" + ] + }, + "ProxiesResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of backup proxies.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProxyModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "ProxySpec": { + "required": [ + "description", + "type" + ], + "type": "object", + "properties": { + "description": { + "description": "Description of the backup proxy.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EProxyType" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ViProxySpec" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "ViProxy": "#/components/schemas/ViProxySpec" + } + } + }, + "ViProxySpec": { + "allOf": [ + { + "$ref": "#/components/schemas/ProxySpec" + }, + { + "type": "object", + "required": [ + "server" + ], + "properties": { + "server": { + "$ref": "#/components/schemas/ProxyServerSettingsModel" + } + } + } + ] + }, + "EProxyType": { + "description": "Type of the backup proxy.", + "type": "string", + "enum": [ + "ViProxy" + ] + }, + "ProxyModel": { + "required": [ + "id", + "description", + "name", + "type" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the backup proxy.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the backup proxy.", + "type": "string" + }, + "description": { + "description": "Description of the backup proxy.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EProxyType" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ViProxyModel" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "ViProxy": "#/components/schemas/ViProxyModel" + } + } + }, + "ViProxyModel": { + "allOf": [ + { + "$ref": "#/components/schemas/ProxyModel" + }, + { + "type": "object", + "required": [ + "server" + ], + "properties": { + "server": { + "$ref": "#/components/schemas/ProxyServerSettingsModel" + } + } + } + ] + }, + "EBackupProxyTransportMode": { + "description": "Transport mode of the backup proxy.", + "type": "string", + "enum": [ + "auto", + "directAccess", + "virtualAppliance", + "network" + ] + }, + "ProxyServerSettingsModel": { + "description": "Server settings for the backup proxy.", + "required": [ + "hostId" + ], + "type": "object", + "properties": { + "hostId": { + "description": "ID of the server.", + "type": "string", + "format": "uuid" + }, + "transportMode": { + "$ref": "#/components/schemas/EBackupProxyTransportMode" + }, + "failoverToNetwork": { + "description": "[For the Direct storage access and Virtual appliance transport modes] If *true*, Veeam Backup & Replication failovers to the network transport mode in case the primary mode fails or is unavailable.\n", + "type": "boolean" + }, + "hostToProxyEncryption": { + "description": "[For the Network mode] If *true*, VM data is transferred over an encrypted TLS connection.\n", + "type": "boolean" + }, + "connectedDatastores": { + "$ref": "#/components/schemas/ProxyDatastoreSettingsModel" + }, + "maxTaskCount": { + "description": "Maximum number of concurrent tasks.", + "type": "integer" + } + } + }, + "ProxyDatastoreSettingsModel": { + "description": "Datastores to which the backup proxy has a direct SAN or NFS connection.", + "required": [ + "autoSelect" + ], + "type": "object", + "properties": { + "autoSelect": { + "description": "If *true*, all datastores that the backup proxy can access are detected automatically.", + "type": "boolean" + }, + "datastores": { + "description": "Array of datastores to which the backup proxy has a direct SAN or NFS connection.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProxyDatastoreModel" + } + } + } + }, + "ProxyDatastoreModel": { + "type": "object", + "properties": { + "datastore": { + "$ref": "#/components/schemas/VmwareObjectModel" + }, + "vmCount": { + "description": "Number of VMs.", + "type": "integer" + } + } + }, + "GlobalNetworkTrafficRulesModel": { + "type": "object", + "required": [ + "useMultipleStreamsPerJob" + ], + "properties": { + "useMultipleStreamsPerJob": { + "description": "If *true*, Veeam Backup & Replication uses multiple TCP/IP transfer connection for every job session.", + "type": "boolean" + }, + "uploadStreamsCount": { + "description": "Number of TCP/IP connections per job.", + "type": "integer", + "format": "integer" + }, + "trafficRules": { + "description": "Array of traffic rules.", + "type": "array", + "items": { + "$ref": "#/components/schemas/TrafficRuleModel" + } + }, + "preferredNetworks": { + "$ref": "#/components/schemas/PreferredNetworksModel" + } + } + }, + "TrafficRuleModel": { + "type": "object", + "required": [ + "name", + "sourceIPStart", + "sourceIPEnd", + "targetIPStart", + "targetIPEnd" + ], + "properties": { + "id": { + "description": "ID of the rule.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the rule.", + "type": "string" + }, + "sourceIPStart": { + "description": "Start IP address of the range for the backup infrastructure components on the source side.", + "type": "string" + }, + "sourceIPEnd": { + "description": "End IP address of the range for the backup infrastructure components on the source side.", + "type": "string" + }, + "targetIPStart": { + "description": "Start IP address of the range for the backup infrastructure components on the target side.", + "type": "string" + }, + "targetIPEnd": { + "description": "End IP address of the range for the backup infrastructure components on the target side.", + "type": "string" + }, + "encryptionEnabled": { + "description": "If *true*, traffic encryption is enabled.", + "type": "boolean" + }, + "throttlingEnabled": { + "description": "If *true*, traffic throttling is enabled.", + "type": "boolean" + }, + "throttlingUnit": { + "$ref": "#/components/schemas/ESpeedUnit" + }, + "throttlingValue": { + "description": "Maximum speed that must be used to transfer data from source to target.", + "type": "integer", + "format": "int32" + }, + "throttlingWindowEnabled": { + "description": "If *true*, throttling window during which the speed must be limited is enabled.", + "type": "boolean" + }, + "throttlingWindowOptions": { + "$ref": "#/components/schemas/BackupWindowSettingModel" + } + } + }, + "ESpeedUnit": { + "description": "Traffic speed unit.", + "type": "string", + "enum": [ + "KbytePerSec", + "MbitPerSpec", + "MbytePerSec" + ] + }, + "PreferredNetworksModel": { + "description": "Preferred networks used for backup and replication traffic.", + "type": "object", + "required": [ + "isEnabled" + ], + "properties": { + "isEnabled": { + "description": "If *true*, prefered networks are enabled.", + "type": "boolean" + }, + "networks": { + "description": "Array of networks.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PreferredNetworkModel" + } + } + } + }, + "PreferredNetworkModel": { + "type": "object", + "properties": { + "ipAddress": { + "description": "IP address.", + "type": "string" + }, + "subnetMask": { + "description": "Subnet mask.", + "type": "string" + }, + "cidrNotation": { + "description": "CIDR notation.", + "type": "string" + } + } + }, + "JobStatesFilters": { + "description": "Filters jobs by the specified parameters.", + "type": "object", + "properties": { + "skip": { + "description": "Skips the specified number of jobs.", + "type": "integer", + "format": "int32" + }, + "limit": { + "description": "Returns the specified number of jobs.", + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EJobStatesFiltersOrderColumn" + }, + "orderAsc": { + "description": "Sorts jobs in the ascending order by the `orderColumn` parameter.", + "type": "boolean" + }, + "idFilter": { + "type": "string", + "format": "uuid" + }, + "nameFilter": { + "description": "Filters jobs by the `nameFilter` pattern. The pattern can match any job state parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "type": "string" + }, + "typeFilter": { + "$ref": "#/components/schemas/EJobType" + }, + "lastResultFilter": { + "$ref": "#/components/schemas/ESessionResult" + }, + "statusFilter": { + "$ref": "#/components/schemas/EJobStatus" + }, + "workloadFilter": { + "$ref": "#/components/schemas/EJobWorkload" + }, + "lastRunAfterFilter": { + "type": "string", + "format": "date-time" + }, + "lastRunBeforeFilter": { + "type": "string", + "format": "date-time" + }, + "isHighPriorityJobFilter": { + "type": "boolean" + }, + "repositoryIdFilter": { + "type": "string", + "format": "uuid" + }, + "objectsCountFilter": { + "type": "integer" + } + } + }, + "EJobStatesFiltersOrderColumn": { + "description": "Orders job states by the specified column.", + "type": "string", + "enum": [ + "Name", + "Type", + "Status", + "LastRun", + "LastResult", + "NextRun", + "Description", + "RepositoryId", + "ObjectsCount" + ] + }, + "EJobStatus": { + "description": "Current status of the job.", + "type": "string", + "enum": [ + "running", + "inactive", + "disabled" + ] + }, + "EJobWorkload": { + "description": "Workload which the job must process.", + "type": "string", + "enum": [ + "application", + "cloudVm", + "file", + "server", + "workstation", + "vm" + ] + }, + "JobStatesResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of job states.", + "type": "array", + "items": { + "$ref": "#/components/schemas/JobStateModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "JobStateModel": { + "required": [ + "id", + "name", + "type", + "description", + "status", + "lastResult", + "workload", + "objectsCount" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the job.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the job.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EJobType" + }, + "description": { + "description": "Description of the job.", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/EJobStatus" + }, + "lastRun": { + "description": "Last run of the job.", + "type": "string", + "format": "date-time" + }, + "lastResult": { + "$ref": "#/components/schemas/ESessionResult" + }, + "nextRun": { + "description": "Next run of the job.", + "type": "string", + "format": "date-time" + }, + "workload": { + "$ref": "#/components/schemas/EJobWorkload" + }, + "repositoryId": { + "description": "ID of the backup repository.", + "type": "string", + "format": "uuid" + }, + "repositoryName": { + "description": "Name of the backup repository.", + "type": "string" + }, + "objectsCount": { + "description": "Number of objects processed by the job.", + "type": "integer" + }, + "sessionId": { + "description": "ID of the last job session.", + "type": "string", + "format": "uuid" + } + } + }, + "JobsFilters": { + "description": "Filters jobs by the specified parameters.", + "type": "object", + "properties": { + "skip": { + "description": "Skips the specified number of jobs.", + "type": "integer", + "format": "int32" + }, + "limit": { + "description": "Returns the specified number of jobs.", + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EJobFiltersOrderColumn" + }, + "orderAsc": { + "description": "Sorts jobs in the ascending order by the `orderColumn` parameter.", + "type": "boolean" + }, + "nameFilter": { + "description": "Filters jobs by the `nameFilter` pattern. The pattern can match any job parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "type": "string" + }, + "typeFilter": { + "$ref": "#/components/schemas/EJobType" + } + } + }, + "EJobFiltersOrderColumn": { + "description": "Orders jobs by the specified column.", + "type": "string", + "enum": [ + "Name", + "Type", + "Description" + ] + }, + "JobsResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of jobs.", + "type": "array", + "items": { + "$ref": "#/components/schemas/JobModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "JobModel": { + "required": [ + "id", + "name", + "description", + "type", + "isDisabled" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the job.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the job.", + "type": "string" + }, + "description": { + "description": "Description of the job.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EJobType" + }, + "isDisabled": { + "description": "If *true*, the job is disabled.", + "type": "boolean" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/BackupJobModel" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "Backup": "#/components/schemas/BackupJobModel" + } + } + }, + "EJobType": { + "description": "Type of the job.", + "type": "string", + "enum": [ + "Backup" + ] + }, + "JobStartSpec": { + "required": [ + "performActiveFull" + ], + "type": "object", + "properties": { + "performActiveFull": { + "type": "boolean", + "default": false + }, + "startChainedJobs": { + "type": "boolean", + "default": false + } + } + }, + "JobStopSpec": { + "required": [ + "gracefullStop" + ], + "type": "object", + "properties": { + "gracefullStop": { + "type": "boolean", + "default": true + } + } + }, + "JobSpec": { + "type": "object", + "required": [ + "name", + "description", + "type" + ], + "properties": { + "name": { + "description": "Name of the job.", + "type": "string" + }, + "description": { + "description": "Job description specified at the time of the job creation.", + "type": "string" + }, + "type": { + "description": "Job type.", + "$ref": "#/components/schemas/EJobType" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/BackupJobSpec" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "Backup": "#/components/schemas/BackupJobSpec" + } + } + }, + "BackupJobSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/JobSpec" + }, + { + "required": [ + "guestProcessing", + "isHighPriority", + "schedule", + "storage", + "virtualMachines" + ], + "type": "object", + "properties": { + "isHighPriority": { + "description": "If *true*, the job has a high priority in getting backup infrastructure resources.", + "type": "boolean", + "default": false + }, + "virtualMachines": { + "$ref": "#/components/schemas/BackupJobVirtualMachinesSpec" + }, + "storage": { + "$ref": "#/components/schemas/BackupJobStorageModel" + }, + "guestProcessing": { + "$ref": "#/components/schemas/BackupJobGuestProcessingModel" + }, + "schedule": { + "$ref": "#/components/schemas/BackupScheduleModel" + } + } + } + ] + }, + "BackupJobVirtualMachinesSpec": { + "required": [ + "includes" + ], + "type": "object", + "properties": { + "includes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareObjectModel" + } + }, + "excludes": { + "$ref": "#/components/schemas/BackupJobExclusionsSpec" + } + } + }, + "BackupJobExclusionsSpec": { + "type": "object", + "properties": { + "vms": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareObjectModel" + } + }, + "disks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareObjectDiskModel" + } + }, + "templates": { + "$ref": "#/components/schemas/BackupJobExclusionsTemplates" + } + } + }, + "EVmwareInventoryType": { + "description": "Type of the VMware vSphere object.", + "type": "string", + "enum": [ + "Unknown", + "VirtualMachine", + "vCenterServer", + "Datacenter", + "Cluster", + "Host", + "ResourcePool", + "Folder", + "Datastore", + "DatastoreCluster", + "StoragePolicy", + "Template", + "ComputeResource", + "VirtualApp", + "Tag", + "Category", + "Multitag" + ] + }, + "BackupJobStorageModel": { + "description": "Backup storage settings.", + "required": [ + "backupProxies", + "backupRepositoryId", + "retentionPolicy" + ], + "type": "object", + "properties": { + "backupRepositoryId": { + "description": "ID of the backup repository.", + "type": "string", + "format": "uuid" + }, + "backupProxies": { + "$ref": "#/components/schemas/BackupProxiesSettingsModel" + }, + "retentionPolicy": { + "$ref": "#/components/schemas/BackupJobRetentionPolicySettingsModel" + }, + "gfsPolicy": { + "$ref": "#/components/schemas/GFSPolicySettingsModel" + }, + "advancedSettings": { + "$ref": "#/components/schemas/BackupJobAdvancedSettingsModel" + } + } + }, + "BackupProxiesSettingsModel": { + "description": "Backup proxy settings.", + "required": [ + "autoSelection" + ], + "type": "object", + "properties": { + "autoSelection": { + "description": "If *true*, backup proxies are detected and assigned automatically.", + "type": "boolean", + "default": true + }, + "proxyIds": { + "description": "Array of proxy IDs.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + }, + "BackupJobRetentionPolicySettingsModel": { + "description": "Retention policy settings.", + "required": [ + "quantity", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/ERetentionPolicyType" + }, + "quantity": { + "description": "Number of restore points or days to keep.", + "type": "integer" + } + } + }, + "ERetentionPolicyType": { + "description": "Type of the retention policy.", + "type": "string", + "enum": [ + "RestorePoints", + "Days" + ] + }, + "GFSPolicySettingsModel": { + "description": "GFS retention policy settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the long-term (GFS) retention policy is enabled.", + "type": "boolean" + }, + "weekly": { + "$ref": "#/components/schemas/GFSPolicySettingsWeeklyModel" + }, + "monthly": { + "$ref": "#/components/schemas/GFSPolicySettingsMonthlyModel" + }, + "yearly": { + "$ref": "#/components/schemas/GFSPolicySettingsYearlyModel" + } + } + }, + "GFSPolicySettingsWeeklyModel": { + "description": "Weekly GFS retention policy.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the weekly GFS retention policy is enabled.", + "type": "boolean" + }, + "keepForNumberOfWeeks": { + "description": "Number of weeks to keep full backups for archival purposes.", + "type": "integer" + }, + "desiredTime": { + "description": "Day of the week when the full backup that will be kept for archival purposes is created.", + "$ref": "#/components/schemas/EDayOfWeek" + } + } + }, + "GFSPolicySettingsMonthlyModel": { + "description": "Monthly GFS retention policy.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the monthly GFS retention policy is enabled.", + "type": "boolean" + }, + "keepForNumberOfMonths": { + "description": "Number of months to keep full backups for archival purposes.", + "type": "integer" + }, + "desiredTime": { + "description": "Week of the month when the full backup that will be kept for archival purposes is created (the first week is the first 7 days of the month).", + "$ref": "#/components/schemas/ESennightOfMonth" + } + } + }, + "GFSPolicySettingsYearlyModel": { + "description": "Yearly GFS retention policy.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the yearly GFS retention policy is enabled.", + "type": "boolean" + }, + "keepForNumberOfYears": { + "description": "Number of years to keep full backups for archival purposes.", + "type": "integer" + }, + "desiredTime": { + "description": "Month when the full backup that will be kept for archival purposes is created.", + "$ref": "#/components/schemas/EMonth" + } + } + }, + "BackupJobAdvancedSettingsModel": { + "description": "Advanced settings of the backup job.", + "required": [ + "backupModeType" + ], + "type": "object", + "properties": { + "backupModeType": { + "$ref": "#/components/schemas/EBackupModeType" + }, + "synthenticFulls": { + "$ref": "#/components/schemas/SyntheticFullSettingsModel" + }, + "activeFulls": { + "$ref": "#/components/schemas/ActiveFullSettingsModel" + }, + "backupHealth": { + "$ref": "#/components/schemas/BackupHealthCheckSettingsModels" + }, + "fullBackupMaintenance": { + "$ref": "#/components/schemas/FullBackupMaintenanceModel" + }, + "storageData": { + "$ref": "#/components/schemas/BackupStorageSettingModel" + }, + "notifications": { + "$ref": "#/components/schemas/NotificationSettingsModel" + }, + "vSphere": { + "$ref": "#/components/schemas/BackupJobAdvancedSettingsVSphereModel" + }, + "storageIntegration": { + "$ref": "#/components/schemas/PrimaryStorageIntegrationSettingsModel" + }, + "scripts": { + "$ref": "#/components/schemas/JobScriptsSettingsModel" + } + } + }, + "JobScriptsSettingsModel": { + "description": "Script settings.", + "type": "object", + "properties": { + "preCommand": { + "description": "Script executed before the backup job.", + "$ref": "#/components/schemas/ScriptCommand" + }, + "postCommand": { + "description": "Script executed after the backup job.", + "$ref": "#/components/schemas/ScriptCommand" + }, + "periodicityType": { + "$ref": "#/components/schemas/EScriptPeriodicityType" + }, + "runScriptEvery": { + "description": "Number of the backup job session after which the scripts must be executed.", + "type": "integer" + }, + "dayOfWeek": { + "description": "Days of the week when the scripts must be executed.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EDayOfWeek" + } + } + } + }, + "ScriptCommand": { + "description": "Script settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, script execution is enabled.", + "type": "boolean" + }, + "command": { + "description": "Path to the script.", + "type": "string" + } + } + }, + "EScriptPeriodicityType": { + "description": "Type of script periodicity.", + "type": "string", + "enum": [ + "Days", + "BackupSessions" + ] + }, + "PrimaryStorageIntegrationSettingsModel": { + "description": "Primary storage integration settings for the backup job.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the primary storage integration is enabled. In this case, storage snapshots (instead of VM snapshots) are used for VM data processing.", + "type": "boolean" + }, + "limitProcessedVm": { + "description": "If *true*, the number of processed VMs per storage snapshot is limited.", + "type": "boolean" + }, + "limitProcessedVmCount": { + "description": "Number of processed VMs per storage snapshot.", + "type": "integer" + }, + "failoverToStandardBackup": { + "description": "If *true*, failover to the regular VM processing mode is enabled. In this case, if backup from storage snapshot fails, VM snapshots are used.", + "type": "boolean" + } + } + }, + "BackupJobAdvancedSettingsVSphereModel": { + "description": "VMware vSphere settings for the backup job.", + "type": "object", + "properties": { + "enableVMWareToolsQuiescence": { + "description": "If *true*, VMware Tools quiescence is enabled for freezing the VM file system and application data.", + "type": "boolean" + }, + "changedBlockTracking": { + "$ref": "#/components/schemas/VSphereChangedBlockTrackingSettingsModel" + } + } + }, + "VSphereChangedBlockTrackingSettingsModel": { + "description": "CBT settings for the backup job.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, CBT data is used.", + "type": "boolean" + }, + "enableCBTautomatically": { + "description": "If *true*, CBT is enabled for all processed VMs even if CBT is disabled in VM configuration. CBT is used for VMs with virtual hardware version 7 or later. These VMs must not have existing snapshots.", + "type": "boolean" + }, + "resetCBTonActiveFull": { + "description": "If *true*, CBT is reset before creating active full backups.", + "type": "boolean" + } + } + }, + "NotificationSettingsModel": { + "description": "Notification settings for the backup job.", + "type": "object", + "properties": { + "sendSNMPNotifications": { + "description": "If *true*, SNMP notifications are enabled for this job.", + "type": "boolean" + }, + "emailNotifications": { + "$ref": "#/components/schemas/EmailNotificationSettingsModel" + }, + "vmAttribute": { + "$ref": "#/components/schemas/NotificationVmAttributeSettingsModel" + } + } + }, + "EmailNotificationSettingsModel": { + "description": "Email notification settings for the backup job.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, email notifications are enabled for this job.", + "type": "boolean" + }, + "recipients": { + "description": "Array of recipient’s email addresses.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "notificationType": { + "$ref": "#/components/schemas/EEmailNotificationType" + }, + "customNotificationSettings": { + "$ref": "#/components/schemas/EmailCustomNotificationType" + } + } + }, + "EEmailNotificationType": { + "description": "Type of email notification settings: global notification settings specified for the backup server, or custom notification settings specified for this job.\n", + "type": "string", + "enum": [ + "UseGlobalNotificationSettings", + "UseCustomNotificationSettings" + ] + }, + "EmailCustomNotificationType": { + "type": "object", + "properties": { + "subject": { + "description": "Notification subject. Use the following variables in the subject: *%Time%* (completion time), *%JobName%*, *%JobResult%*, *%ObjectCount%* (number of VMs in the job) and *%Issues%* (number of VMs in the job that have finished with the Warning or Failed status).\n", + "type": "string" + }, + "notifyOnSuccess": { + "description": "If *true*, email notifications are sent when the job completes successfully.", + "type": "boolean" + }, + "notifyOnWarning": { + "description": "If *true*, email notifications are sent when the job completes with a warning.", + "type": "boolean" + }, + "notifyOnError": { + "description": "If *true*, email notifications are sent when the job fails.", + "type": "boolean" + }, + "SuppressNotificationUntilLastRetry": { + "description": "If *true*, email notifications are sent about the final job status only (not per every job retry).", + "type": "boolean" + } + } + }, + "NotificationVmAttributeSettingsModel": { + "description": "VM attribute settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, information about successfully performed backup is written to a VM attribute.", + "type": "boolean" + }, + "notes": { + "description": "Name of the VM attribute.", + "type": "string" + }, + "appendToExisitingValue": { + "description": "If *true*, information about successfully performed backup is appended to the existing value of the attribute added by the user.", + "type": "boolean" + } + } + }, + "EBackupModeType": { + "description": "Type of the backup method used to create a restore point.", + "type": "string", + "enum": [ + "Full", + "Incremental", + "ReverseIncremental", + "Transofrm", + "TransformForeverIncremental" + ] + }, + "SyntheticFullSettingsModel": { + "description": "Synthetic full backup settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, synthetic full backups are enabled.", + "type": "boolean" + }, + "days": { + "description": "Days of the week when Veeam Backup & Replication creates a synthetic full backup.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EDayOfWeek" + } + } + } + }, + "ActiveFullSettingsModel": { + "description": "Active full backup settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, active full backups are enabled.", + "type": "boolean" + }, + "weekly": { + "$ref": "#/components/schemas/AdvancedStorageScheduleWeeklyModel" + }, + "monthly": { + "$ref": "#/components/schemas/AdvancedStorageScheduleMonthlyModel" + } + } + }, + "AdvancedStorageScheduleWeeklyModel": { + "description": "Weekly schedule settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the weekly schedule is enabled.", + "type": "boolean", + "default": false + }, + "days": { + "description": "Days of the week when the operation is performed.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EDayOfWeek" + } + } + } + }, + "AdvancedStorageScheduleMonthlyModel": { + "description": "Monthly schedule settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the monthly schedule is enabled.", + "type": "boolean" + }, + "dayOfWeek": { + "$ref": "#/components/schemas/EDayOfWeek" + }, + "dayNumberInMonth": { + "$ref": "#/components/schemas/EDayNumberInMonth" + }, + "dayOfMonths": { + "description": "Day of the month when the operation is performed.", + "type": "integer" + }, + "months": { + "description": "Months when the operation is performed.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EMonth" + } + } + } + }, + "BackupHealthCheckSettingsModels": { + "description": "Health check settings for the for the latest restore point in the backup chain.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the health check is enabled.", + "type": "boolean" + }, + "weekly": { + "$ref": "#/components/schemas/AdvancedStorageScheduleWeeklyModel" + }, + "monthly": { + "$ref": "#/components/schemas/AdvancedStorageScheduleMonthlyModel" + } + } + }, + "FullBackupMaintenanceModel": { + "description": "Maintenance settings for full backup files.", + "type": "object", + "properties": { + "RemoveData": { + "$ref": "#/components/schemas/FullBackupMaintenanceRemoveDataModel" + }, + "defragmentAndCompact": { + "$ref": "#/components/schemas/FullBackupMaintenanceDefragmentAndCompactModel" + } + } + }, + "FullBackupMaintenanceRemoveDataModel": { + "description": "Backup data setting for deleted VMs.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, Veeam Backup & Replication keeps the backup data of deleted VMs for the `afterDays` number of days.", + "type": "boolean" + }, + "afterDays": { + "description": "Number of days.", + "type": "integer" + } + } + }, + "FullBackupMaintenanceDefragmentAndCompactModel": { + "description": "Compact operation settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, Veeam Backup & Replication compacts full backup files.", + "type": "boolean" + }, + "weekly": { + "$ref": "#/components/schemas/AdvancedStorageScheduleWeeklyModel" + }, + "monthly": { + "$ref": "#/components/schemas/AdvancedStorageScheduleMonthlyModel" + } + } + }, + "BackupStorageSettingModel": { + "description": "Storage settings.", + "type": "object", + "properties": { + "enableInlineDataDedup": { + "description": "If *true*, Veeam Backup & Replication deduplicates VM data before storing it in the backup repository.", + "type": "boolean" + }, + "excludeSwapFileBlocks": { + "description": "If *true*, Veeam Backup & Replication excludes swap file blocks from processing.", + "type": "boolean" + }, + "excludeDeletedFileBlocks": { + "description": "If *true*, Veeam Backup & Replication does not copy deleted file blocks.", + "type": "boolean" + }, + "compressionLevel": { + "$ref": "#/components/schemas/ECompressionLevel" + }, + "storageOptimization": { + "$ref": "#/components/schemas/EStorageOptimization" + }, + "encryption": { + "$ref": "#/components/schemas/BackupStorageSettingsEncryptionModel" + } + } + }, + "EStorageOptimization": { + "description": "Storage optimization that depends on the target type.", + "type": "string", + "enum": [ + "Auto", + "LocalTargetLarge", + "LocalTarget", + "LANTarget", + "WANTarget" + ] + }, + "ECompressionLevel": { + "description": "Compression level.", + "type": "string", + "enum": [ + "Auto", + "None", + "DedupFriendly", + "Optimal", + "High", + "Extreme" + ] + }, + "BackupStorageSettingsEncryptionModel": { + "description": "Encription of backup files.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the content of backup files is encrypted.", + "type": "boolean" + }, + "encryptionPasswordIdOrNull": { + "description": "ID of the password used for encryption. The value is *null* for exported objects.", + "type": "string", + "format": "uuid" + }, + "encryptionPasswordTag": { + "type": "string", + "description": "Tag used to identify the password." + } + } + }, + "BackupJobGuestProcessingModel": { + "description": "Guest processing settings.", + "required": [ + "appAwareProcessing", + "guestFSIndexing" + ], + "type": "object", + "properties": { + "appAwareProcessing": { + "$ref": "#/components/schemas/BackupApplicationAwareProcessingModel" + }, + "guestFSIndexing": { + "$ref": "#/components/schemas/GuestFileSystemIndexingModel" + }, + "guestInteractionProxies": { + "$ref": "#/components/schemas/GuestInteractionProxiesSettingsModel" + }, + "guestCredentials": { + "$ref": "#/components/schemas/GuestOsCredentialsModel" + } + } + }, + "BackupApplicationAwareProcessingModel": { + "description": "Application-aware processing settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, application-aware processing is enabled.", + "type": "boolean" + }, + "appSettings": { + "description": "Array of VMware objects and their application settings.", + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupApplicationSettingsModel" + } + } + } + }, + "BackupApplicationSettingsModel": { + "required": [ + "vmObject", + "vss" + ], + "type": "object", + "properties": { + "vmObject": { + "$ref": "#/components/schemas/VmwareObjectModel" + }, + "vss": { + "$ref": "#/components/schemas/EApplicationSettingsVSS" + }, + "usePersistentGuestAgent": { + "description": "If *true*, persistent guest agent is used.", + "type": "boolean" + }, + "transactionLogs": { + "$ref": "#/components/schemas/ETransactionLogsSettings" + }, + "sql": { + "$ref": "#/components/schemas/BackupSQLSettingsModel" + }, + "oracle": { + "$ref": "#/components/schemas/BackupOracleSettingsModel" + }, + "exclusions": { + "$ref": "#/components/schemas/BackupFSExclusionsModel" + }, + "scripts": { + "$ref": "#/components/schemas/BackupScriptSettingsModel" + } + } + }, + "EApplicationSettingsVSS": { + "description": "Behavior scenario for application-aware processing.", + "type": "string", + "enum": [ + "requireSuccess", + "ignoreFailures", + "disabled" + ] + }, + "ETransactionLogsSettings": { + "description": "Transaction logs settings that define whether copy-only backups must be created or transaction logs for Microsoft Exchange, Microsoft SQL and Oracle VMs must be processed.
\nIf transaction log processing is selected, specify the following parameters:
\n
    \n
  • [For Microsoft SQL Server VMs] Microsoft SQL Server transaction log settings
  • \n
  • [For Oracle VMs] Oracle archived log settings
  • \n
\n", + "type": "string", + "enum": [ + "process", + "copyOnly" + ] + }, + "BackupSQLSettingsModel": { + "description": "Microsoft SQL Server transaction log settings.", + "required": [ + "logsProcessing" + ], + "type": "object", + "properties": { + "logsProcessing": { + "$ref": "#/components/schemas/ESQLLogsProcessing" + }, + "backupMinsCount": { + "description": "Frequency of transaction log backup, in minutes.", + "type": "integer" + }, + "retainLogBackups": { + "$ref": "#/components/schemas/ERetainLogBackupsType" + }, + "keepDaysCount": { + "description": "Number of days to keep transaction logs in the backup repository.", + "type": "integer" + }, + "logShippingServers": { + "$ref": "#/components/schemas/BackupLogShippingServersModel" + } + } + }, + "ESQLLogsProcessing": { + "description": "Type of transaction logs processing.", + "type": "string", + "enum": [ + "truncate", + "preserve", + "backup", + "neverTruncate" + ] + }, + "ERetainLogBackupsType": { + "description": "Retention policy for the logs stored in the backup repository.", + "type": "string", + "enum": [ + "untilBackupDeleted", + "KeepOnlyDays" + ] + }, + "BackupLogShippingServersModel": { + "description": "Log shipping server used to transport logs.", + "required": [ + "autoSelection" + ], + "type": "object", + "properties": { + "autoSelection": { + "description": "If *true*, Veeam Backup & Replication chooses an optimal log shipping server automatically.", + "type": "boolean" + }, + "shippingServerIds": { + "description": "Array of servers that are explicitly selected for log shipping.", + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + }, + "BackupOracleSettingsModel": { + "description": "Oracle archived log settings.", + "required": [ + "archiveLogs", + "useGuestCredentials" + ], + "type": "object", + "properties": { + "useGuestCredentials": { + "description": "If *true*, Veeam Backup & Replication uses credentials specified in the guest processing settings.", + "type": "boolean" + }, + "credentialsId": { + "description": "ID of the credentials record that is used if `useGuestCredentials` is *false*.", + "type": "string", + "format": "uuid" + }, + "archiveLogs": { + "$ref": "#/components/schemas/EBackupOracleLogsSettings" + }, + "deleteHoursCount": { + "description": "Time period in hours to keep archived logs. This parameter should be specified if the `EBackupOracleLogsSettings` value is *deleteExpiredHours*.", + "type": "integer" + }, + "deleteGBsCount": { + "description": "Maximum size for archived logs in GB. This parameter should be specified if the `EBackupOracleLogsSettings` value is *deleteExpiredGBs*.", + "type": "integer" + }, + "backupLogs": { + "description": "If *true*, archived logs are backed up.", + "type": "boolean" + }, + "backupMinsCount": { + "description": "Frequency of archived log backup, in minutes.", + "type": "integer" + }, + "retainLogBackups": { + "$ref": "#/components/schemas/ERetainLogBackupsType" + }, + "keepDaysCount": { + "description": "Number of days to keep archived logs.", + "type": "integer" + }, + "logShippingServers": { + "$ref": "#/components/schemas/BackupLogShippingServersModel" + } + } + }, + "EBackupOracleLogsSettings": { + "description": "Type of archived logs processing.", + "type": "string", + "enum": [ + "preserve", + "deleteExpiredHours", + "deleteExpiredGBs" + ] + }, + "BackupFSExclusionsModel": { + "description": "VM guest OS file exclusion.", + "required": [ + "exclusionPolicy" + ], + "type": "object", + "properties": { + "exclusionPolicy": { + "$ref": "#/components/schemas/EBackupExclusionPolicy" + }, + "itemsList": { + "description": "Array of files and folders. Full paths to files and folders, environmental variables and file masks with the asterisk (*) and question mark (?) characters can be used.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "EBackupExclusionPolicy": { + "description": "Exclusion policy.", + "type": "string", + "enum": [ + "disabled", + "excludeOnly", + "includeOnly" + ] + }, + "BackupScriptSettingsModel": { + "description": "Pre-freeze and post-thaw scripts.", + "required": [ + "scriptProcessingMode" + ], + "type": "object", + "properties": { + "scriptProcessingMode": { + "$ref": "#/components/schemas/EBackupScriptProcessingMode" + }, + "windowsScripts": { + "$ref": "#/components/schemas/BackupWindowsScriptModel" + }, + "linuxScripts": { + "$ref": "#/components/schemas/BackupLinuxScriptModel" + } + } + }, + "EBackupScriptProcessingMode": { + "description": "Scenario for scripts execution.", + "type": "string", + "enum": [ + "disableExec", + "ignoreExecFailures", + "requireSuccess" + ] + }, + "BackupWindowsScriptModel": { + "description": "Paths to pre-freeze and post-thaw scripts for Microsoft Windows VMs.", + "type": "object", + "properties": { + "preFreezeScript": { + "description": "Path to a pre-freeze script.", + "type": "string" + }, + "postThawScript": { + "description": "Path to a post-thaw script.", + "type": "string" + } + } + }, + "BackupLinuxScriptModel": { + "description": "Paths to pre-freeze and post-thaw scripts for Linux VMs.", + "type": "object", + "properties": { + "preFreezeScript": { + "description": "Path to a pre-freeze script.", + "type": "string" + }, + "postThawScript": { + "description": "Path to a post-thaw script.", + "type": "string" + } + } + }, + "GuestFileSystemIndexingModel": { + "description": "VM guest OS file indexing.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "type": "boolean" + }, + "indexingSettings": { + "description": "Array of VMs with guest OS file indexing options.", + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupIndexingSettingsModel" + } + } + } + }, + "BackupIndexingSettingsModel": { + "required": [ + "vmObject" + ], + "type": "object", + "properties": { + "vmObject": { + "$ref": "#/components/schemas/VmwareObjectModel" + }, + "WindowsIndexing": { + "$ref": "#/components/schemas/BackupObjectIndexingModel" + }, + "LinuxIndexing": { + "$ref": "#/components/schemas/BackupObjectIndexingModel" + } + } + }, + "BackupObjectIndexingModel": { + "description": "Guest OS indexing options for the VM.", + "required": [ + "guestFSIndexingMode" + ], + "type": "object", + "properties": { + "guestFSIndexingMode": { + "$ref": "#/components/schemas/EGuestFSIndexingMode" + }, + "indexingList": { + "description": "Array of folders. Environmental variables and full paths to folders can be used.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "EGuestFSIndexingMode": { + "description": "Indexing mode.", + "type": "string", + "enum": [ + "disable", + "indexAll", + "indexAllExcept", + "indexOnly" + ] + }, + "EGuestOSType": { + "description": "Type of the guest OS.", + "type": "string", + "enum": [ + "Windows", + "Linux" + ] + }, + "GuestInteractionProxiesSettingsModel": { + "description": "Guest interaction proxy used to deploy the runtime process on the VM guest OS.", + "required": [ + "autoSelection" + ], + "type": "object", + "properties": { + "autoSelection": { + "description": "If *true*, Veeam Backup & Replication automatically selects the guest interaction proxy.", + "type": "boolean", + "default": true + }, + "proxyIds": { + "description": "Array of proxies specified explicitly. The array must contain Microsoft Windows servers added to the backup infrastructure only.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + }, + "GuestOsCredentialsModel": { + "description": "VM custom credentials.", + "type": "object", + "required": [ + "credsId", + "credsType" + ], + "properties": { + "credsId": { + "description": "Credentials ID for Microsoft Windows VMs.", + "type": "string", + "format": "uuid" + }, + "credsType": { + "$ref": "#/components/schemas/ECredentialsType" + }, + "credentialsPerMachine": { + "description": "Individual credentials for VMs.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/GuestOsCredentialsPerMachineModel" + } + } + } + }, + "GuestOsCredentialsPerMachineModel": { + "required": [ + "vmObject" + ], + "type": "object", + "properties": { + "windowsCredsId": { + "description": "Credentials ID for a Microsoft Windows VM.", + "type": "string", + "format": "uuid" + }, + "linuxCredsId": { + "description": "Credentials ID for a Linux VM.", + "type": "string", + "format": "uuid" + }, + "vmObject": { + "$ref": "#/components/schemas/VmwareObjectModel" + } + } + }, + "ECredentialsType": { + "description": "Credentials type.", + "type": "string", + "enum": [ + "Standard", + "Linux" + ] + }, + "BackupScheduleModel": { + "description": "Job scheduling options.", + "required": [ + "runAutomatically" + ], + "type": "object", + "properties": { + "runAutomatically": { + "description": "If *true*, job scheduling is enabled.", + "type": "boolean", + "default": false + }, + "daily": { + "$ref": "#/components/schemas/ScheduleDailyModel" + }, + "monthly": { + "$ref": "#/components/schemas/ScheduleMonthlyModel" + }, + "periodically": { + "$ref": "#/components/schemas/SchedulePeriodicallyModel" + }, + "continuously": { + "$ref": "#/components/schemas/ScheduleBackupWindowModel" + }, + "afterThisJob": { + "$ref": "#/components/schemas/ScheduleAfterThisJobModel" + }, + "retry": { + "$ref": "#/components/schemas/ScheduleRetryModel" + }, + "backupWindow": { + "$ref": "#/components/schemas/ScheduleBackupWindowModel" + } + } + }, + "ScheduleAfterThisJobModel": { + "description": "Job chaining options.", + "type": "object", + "required": [ + "isEnabled" + ], + "properties": { + "isEnabled": { + "description": "If *true*, job chaining is enabled.", + "type": "boolean" + }, + "jobName": { + "description": "Name of the preceding job.", + "type": "string" + } + } + }, + "ScheduleDailyModel": { + "description": "Daily scheduling options.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, daily schedule is enabled.", + "type": "boolean", + "default": true + }, + "localTime": { + "description": "Local time when the job must start.", + "type": "string", + "format": "time" + }, + "dailyKind": { + "$ref": "#/components/schemas/EDailyKinds" + }, + "days": { + "description": "Days of the week when the job must start.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EDayOfWeek" + } + } + } + }, + "EDailyKinds": { + "description": "Kind of daily scheduling scheme.", + "type": "string", + "enum": [ + "Everyday", + "WeekDays", + "SelectedDays" + ] + }, + "EDayOfWeek": { + "type": "string", + "enum": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday" + ] + }, + "ScheduleMonthlyModel": { + "description": "Monthly scheduling options.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, monthly schedule is enabled.", + "type": "boolean", + "default": false + }, + "localTime": { + "description": "Local time when the job must start.", + "type": "string", + "format": "time" + }, + "dayOfWeek": { + "$ref": "#/components/schemas/EDayOfWeek" + }, + "dayNumberInMonth": { + "$ref": "#/components/schemas/EDayNumberInMonth" + }, + "dayOfMonth": { + "description": "Day of the month when the job must start.", + "type": "integer" + }, + "months": { + "description": "Months when the job must start.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EMonth" + } + } + } + }, + "EDayNumberInMonth": { + "type": "string", + "enum": [ + "First", + "Second", + "Third", + "Fourth", + "Last", + "OnDay" + ] + }, + "EMonth": { + "type": "string", + "enum": [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ] + }, + "SchedulePeriodicallyModel": { + "description": "Periodic scheduling options.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, periodic schedule is enabled.", + "type": "boolean", + "default": false + }, + "periodicallyKind": { + "$ref": "#/components/schemas/EPeriodicallyKinds" + }, + "frequency": { + "description": "Number of time units that defines the time interval.", + "type": "integer" + }, + "backupWindow": { + "$ref": "#/components/schemas/BackupWindowSettingModel" + } + } + }, + "EPeriodicallyKinds": { + "description": "Time unit for periodic job scheduling.", + "type": "string", + "enum": [ + "Hours", + "Minutes", + "Seconds", + "Days" + ] + }, + "ScheduleBackupWindowModel": { + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, periodic schedule is enabled.", + "type": "boolean", + "default": false + }, + "WindowSetting": { + "$ref": "#/components/schemas/BackupWindowSettingModel" + } + } + }, + "BackupWindowDayHoursModel": { + "description": "Hourly scheme for a day.", + "required": [ + "day", + "hours" + ], + "type": "object", + "properties": { + "day": { + "$ref": "#/components/schemas/EDayOfWeek" + }, + "hours": { + "description": "String of hours in the following format:\n*1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1*\nwhere *1* means enabled, *0* means disabled.\n", + "type": "string" + } + } + }, + "BackupWindowSettingModel": { + "description": "Time scheme.", + "required": [ + "days" + ], + "type": "object", + "properties": { + "days": { + "description": "Array of per-day schemes.", + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupWindowDayHoursModel" + } + } + } + }, + "ScheduleRetryModel": { + "description": "Retry options.", + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, retry options are enabled.", + "type": "boolean", + "default": false + }, + "retryCount": { + "description": "Number of retries set for the job.", + "type": "integer" + }, + "awaitMinutes": { + "description": "Time interval between job retries in minutes.", + "type": "integer" + } + } + }, + "ESennightOfMonth": { + "description": "Sennight of the month.", + "type": "string", + "enum": [ + "First", + "Second", + "Third", + "Fourth", + "Fifth", + "Last" + ] + }, + "BackupJobModel": { + "allOf": [ + { + "$ref": "#/components/schemas/JobModel" + }, + { + "type": "object", + "required": [ + "guestProcessing", + "isHighPriority", + "schedule", + "storage", + "virtualMachines" + ], + "properties": { + "isHighPriority": { + "description": "If *true*, the job has a high priority in getting backup infrastructure resources.", + "type": "boolean" + }, + "virtualMachines": { + "$ref": "#/components/schemas/BackupJobVirtualMachinesModel" + }, + "storage": { + "$ref": "#/components/schemas/BackupJobStorageModel" + }, + "guestProcessing": { + "$ref": "#/components/schemas/BackupJobGuestProcessingModel" + }, + "schedule": { + "$ref": "#/components/schemas/BackupScheduleModel" + } + } + } + ] + }, + "BackupJobVirtualMachinesModel": { + "required": [ + "includes" + ], + "type": "object", + "properties": { + "includes": { + "description": "Array of VM and VM containers processed by the job.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareObjectSizeModel" + } + }, + "excludes": { + "$ref": "#/components/schemas/BackupJobExclusions" + } + } + }, + "BackupJobExclusions": { + "type": "object", + "properties": { + "vms": { + "description": "Array of VMs excluded from the backup.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareObjectSizeModel" + } + }, + "disks": { + "description": "Array of VM disks excluded from the backup.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareObjectDiskModel" + } + }, + "templates": { + "description": "Array of VM templates excluded from the backup. OUTSIDE", + "$ref": "#/components/schemas/BackupJobExclusionsTemplates" + } + } + }, + "BackupJobExclusionsTemplates": { + "description": "Array of VM templates excluded from the backup.", + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, the template is included into the backup.", + "type": "boolean" + }, + "excludeFromIncremental": { + "description": "If *true*, the template is excluded from the incremental backup.", + "type": "boolean" + } + } + }, + "VmwareObjectDiskModel": { + "required": [ + "disks", + "disksToProcess", + "vmObject" + ], + "type": "object", + "properties": { + "vmObject": { + "$ref": "#/components/schemas/VmwareObjectModel" + }, + "disksToProcess": { + "$ref": "#/components/schemas/EVmwareDisksTypeToProcess" + }, + "disks": { + "description": "Array of disks.", + "type": "array", + "items": { + "description": "ID of the disk.", + "type": "string" + } + }, + "removeFromVMConfiguration": { + "description": "If *true*, the disk is removed from VM configuration.", + "type": "boolean" + } + } + }, + "EVmwareDisksTypeToProcess": { + "description": "Type of disk selection.", + "type": "string", + "enum": [ + "AllDisks", + "SystemOnly", + "SelectedDisks" + ] + }, + "VmwareObjectSizeModel": { + "required": [ + "inventoryObject" + ], + "type": "object", + "properties": { + "inventoryObject": { + "$ref": "#/components/schemas/VmwareObjectModel" + }, + "size": { + "description": "Size used by the VMware vSphere object.", + "type": "string" + } + } + }, + "VmwareObjectModel": { + "description": "VMware object.", + "required": [ + "name", + "type", + "hostName" + ], + "type": "object", + "properties": { + "hostName": { + "description": "Name of the host.", + "type": "string" + }, + "name": { + "description": "Name of the VMware vSphere object.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EVmwareInventoryType" + }, + "objectId": { + "description": "ID of the VMware vSphere object.", + "type": "string" + } + } + }, + "CredentialsFilters": { + "type": "object", + "properties": { + "skip": { + "description": "Number of credentials records to skip.", + "type": "integer", + "format": "int32" + }, + "limit": { + "description": "Maximum number of credentials records to return.", + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/ECredentialsFiltersOrderColumn" + }, + "orderAsc": { + "description": "Sorts credentials in the ascending order by the `orderColumn` parameter.", + "type": "boolean" + }, + "nameFilter": { + "description": "Filters credentials by the `nameFilter` pattern. The pattern can match any credentials parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "type": "string" + } + } + }, + "ECredentialsFiltersOrderColumn": { + "type": "string", + "enum": [ + "Username", + "Description" + ] + }, + "CredentialsResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of credentials.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CredentialsModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "CredentialsSpec": { + "required": [ + "username", + "type" + ], + "type": "object", + "properties": { + "username": { + "description": "User name.", + "type": "string" + }, + "password": { + "description": "Password.", + "type": "string" + }, + "description": { + "description": "Description of the credentials record.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ECredentialsType" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/StandardCredentialsSpec" + }, + { + "$ref": "#/components/schemas/LinuxCredentialsSpec" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "Standard": "#/components/schemas/StandardCredentialsSpec", + "Linux": "#/components/schemas/LinuxCredentialsSpec" + } + } + }, + "StandardCredentialsSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/CredentialsSpec" + }, + { + "type": "object", + "properties": { + "tag": { + "description": "Tag used to identify the credentials record.", + "type": "string" + } + } + } + ] + }, + "LinuxCredentialsSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/CredentialsSpec" + }, + { + "type": "object", + "properties": { + "tag": { + "description": "Tag used to identify the credentials record.", + "type": "string" + }, + "SSHPort": { + "description": "SSH port used to connect to a Linux server.", + "type": "integer" + }, + "autoElevated": { + "description": "If *true*, the permissions of the account are automatically elevated to the root user.", + "type": "boolean" + }, + "addToSudoers": { + "description": "If *true*, the account is automatically added to the sudoers file.", + "type": "boolean" + }, + "useSu": { + "description": "If *true*, the `su` command is used for Linux distributions where the `sudo` command is not available.", + "type": "boolean" + }, + "privateKey": { + "description": "Private key.", + "type": "string" + }, + "passphrase": { + "description": "Passphrase that protects the private key.", + "type": "string" + }, + "rootPassword": { + "description": "Password for the root account.", + "type": "string" + } + } + } + ] + }, + "CredentialsModel": { + "required": [ + "id", + "username", + "description", + "type", + "creationTime" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the credentials record.", + "type": "string", + "format": "uuid" + }, + "username": { + "description": "User name.", + "type": "string" + }, + "description": { + "description": "Description of the credentials record.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ECredentialsType" + }, + "creationTime": { + "description": "Date and time when the credentials were created.", + "type": "string", + "format": "date-time" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/StandardCredentialsModel" + }, + { + "$ref": "#/components/schemas/LinuxCredentialsModel" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "Standard": "#/components/schemas/StandardCredentialsModel", + "Linux": "#/components/schemas/LinuxCredentialsModel" + } + } + }, + "StandardCredentialsModel": { + "allOf": [ + { + "$ref": "#/components/schemas/CredentialsModel" + }, + { + "type": "object", + "properties": { + "tag": { + "description": "Tag used to identify the credentials record.", + "type": "string" + } + } + } + ] + }, + "CredentialsPasswordChangeSpec": { + "required": [ + "password" + ], + "type": "object", + "properties": { + "password": { + "description": "New password.", + "type": "string" + } + } + }, + "LinuxCredentialsModel": { + "allOf": [ + { + "$ref": "#/components/schemas/CredentialsModel" + }, + { + "type": "object", + "properties": { + "tag": { + "description": "Tag used to identify the credentials record.", + "type": "string" + }, + "SSHPort": { + "description": "SSH port used to connect to a Linux server.", + "type": "integer" + }, + "autoElevated": { + "description": "If *true*, the permissions of the account are automatically elevated to the root user.", + "type": "boolean" + }, + "addToSudoers": { + "description": "If *true*, the account is automatically added to the sudoers file.", + "type": "boolean" + }, + "useSu": { + "description": "If *true*, the `su` command is used for Linux distributions where the `sudo` command is not available.", + "type": "boolean" + }, + "privateKey": { + "description": "Private key.", + "type": "string" + }, + "passphrase": { + "description": "Passphrase that protects the private key.", + "type": "string" + } + } + } + ] + }, + "PrivateKeyChangeSpec": { + "required": [ + "privateKey" + ], + "type": "object", + "properties": { + "privateKey": { + "description": "Private key.", + "type": "string" + }, + "passphrase": { + "description": "Passphrase that protects the private key.", + "type": "string" + } + } + }, + "JobImportSpecCollection": { + "required": [ + "jobs" + ], + "type": "object", + "properties": { + "jobs": { + "description": "Array of jobs.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/JobImportSpec" + } + } + } + }, + "JobImportSpec": { + "required": [ + "description", + "guestProcessing", + "isHighPriority", + "name", + "schedule", + "storage", + "type", + "virtualMachines" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the job.", + "type": "string" + }, + "description": { + "description": "Description of the job.", + "type": "string" + }, + "isHighPriority": { + "description": "If *true*, the job has a high priority in getting backup infrastructure resources.", + "type": "boolean" + }, + "type": { + "$ref": "#/components/schemas/EJobType" + }, + "virtualMachines": { + "$ref": "#/components/schemas/BackupJobVirtualMachinesSpec" + }, + "storage": { + "$ref": "#/components/schemas/BackupJobStorageImportModel" + }, + "guestProcessing": { + "$ref": "#/components/schemas/BackupJobGuestProcessingImportModel" + }, + "schedule": { + "$ref": "#/components/schemas/BackupScheduleModel" + } + } + }, + "BackupJobStorageImportModel": { + "description": "Backup storage settings.", + "required": [ + "backupProxies", + "backupRepository", + "retentionPolicy" + ], + "type": "object", + "properties": { + "backupRepository": { + "$ref": "#/components/schemas/BackupRepositoryImportModel" + }, + "backupProxies": { + "$ref": "#/components/schemas/BackupJobImportProxiesModel" + }, + "retentionPolicy": { + "$ref": "#/components/schemas/BackupJobRetentionPolicySettingsModel" + }, + "gfsPolicy": { + "$ref": "#/components/schemas/GFSPolicySettingsModel" + }, + "advancedSettings": { + "$ref": "#/components/schemas/BackupJobAdvancedSettingsModel" + } + } + }, + "BackupRepositoryImportModel": { + "description": "Backup repository.", + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the backup repository.", + "type": "string" + }, + "tag": { + "description": "Tag assigned to the backup repository.", + "type": "string" + } + } + }, + "BackupJobImportProxiesModel": { + "description": "Backup proxies.", + "required": [ + "automaticSelection" + ], + "type": "object", + "properties": { + "automaticSelection": { + "description": "If *true*, backup proxies are detected and assigned automatically.", + "type": "boolean", + "default": true + }, + "proxies": { + "description": "Array of backup proxies.", + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupProxyImportModel" + } + } + } + }, + "BackupProxyImportModel": { + "required": [ + "name", + "type" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the backup proxy.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EBackupProxyImportType" + }, + "tag": { + "description": "Tag assigned to the backup proxy.", + "type": "string" + } + } + }, + "EBackupProxyImportType": { + "type": "string", + "enum": [ + "vmware" + ] + }, + "BackupJobGuestProcessingImportModel": { + "description": "Guest processing settings.", + "required": [ + "applicationAwareProcessing", + "guestFileSystemIndexing" + ], + "type": "object", + "properties": { + "applicationAwareProcessing": { + "$ref": "#/components/schemas/BackupApplicationAwareProcessingImportModel" + }, + "guestFileSystemIndexing": { + "$ref": "#/components/schemas/GuestFileSystemIndexingModel" + }, + "guestInteractionProxies": { + "$ref": "#/components/schemas/GuestInteractionProxiesSettingsImportModel" + }, + "guestCredentials": { + "$ref": "#/components/schemas/GuestOsCredentialsImportModel" + } + } + }, + "BackupApplicationAwareProcessingImportModel": { + "description": "Application-aware processing settings.", + "required": [ + "isEnabled" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, application-aware processing is enabled.", + "type": "boolean" + }, + "appSettings": { + "description": "Array of VMware objects and their application settings.", + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupApplicationSettingsImportModel" + } + } + } + }, + "BackupApplicationSettingsImportModel": { + "required": [ + "vmObject", + "vss" + ], + "type": "object", + "properties": { + "vmObject": { + "$ref": "#/components/schemas/VmwareObjectModel" + }, + "vss": { + "$ref": "#/components/schemas/EApplicationSettingsVSS" + }, + "usePersistentGuestAgent": { + "description": "If *true*, persistent guest agent is used.", + "type": "boolean" + }, + "transactionLogs": { + "$ref": "#/components/schemas/ETransactionLogsSettings" + }, + "sql": { + "$ref": "#/components/schemas/BackupSQLSettingsImportModel" + }, + "oracle": { + "$ref": "#/components/schemas/BackupOracleSettingsImportModel" + }, + "exclusions": { + "$ref": "#/components/schemas/BackupFSExclusionsModel" + }, + "scripts": { + "$ref": "#/components/schemas/BackupScriptSettingsModel" + } + } + }, + "BackupSQLSettingsImportModel": { + "description": "Microsoft SQL Server transaction log settings.", + "required": [ + "logsProcessing" + ], + "type": "object", + "properties": { + "logsProcessing": { + "$ref": "#/components/schemas/ESQLLogsProcessing" + }, + "backupMinsCount": { + "description": "Frequency of transaction log backup, in minutes.", + "type": "integer" + }, + "retainLogBackups": { + "$ref": "#/components/schemas/ERetainLogBackupsType" + }, + "keepDaysCount": { + "description": "Number of days to keep transaction logs in the backup repository.", + "type": "integer" + }, + "logShippingServers": { + "$ref": "#/components/schemas/BackupLogShippingServersImportModel" + } + } + }, + "BackupLogShippingServersImportModel": { + "description": "Log shipping server used to transport logs.", + "required": [ + "autoSelection" + ], + "type": "object", + "properties": { + "autoSelection": { + "description": "If *true*, Veeam Backup & Replication chooses an optimal log shipping server automatically.", + "type": "boolean" + }, + "shippingServerNames": { + "description": "Array of servers that are explicitly selected for log shipping.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BackupOracleSettingsImportModel": { + "description": "Oracle archived log settings.", + "required": [ + "archiveLogs", + "useGuestCredentials" + ], + "type": "object", + "properties": { + "useGuestCredentials": { + "description": "If *true*, Veeam Backup & Replication uses credentials specified in the guest processing settings.", + "type": "boolean" + }, + "credentials": { + "$ref": "#/components/schemas/CredentialsImportModel" + }, + "archiveLogs": { + "$ref": "#/components/schemas/EBackupOracleLogsSettings" + }, + "deleteHoursCount": { + "description": "Time period in hours to keep archived logs. This parameter should be specified if the `EBackupOracleLogsSettings` value is *deleteExpiredHours*.", + "type": "integer" + }, + "deleteGBsCount": { + "description": "Maximum size for archived logs in GB. This parameter should be specified if the `EBackupOracleLogsSettings` value is *deleteExpiredGBs*.", + "type": "integer" + }, + "backupLogs": { + "description": "If *true*, archived logs are backed up.", + "type": "boolean" + }, + "backupMinsCount": { + "description": "Frequency of archived log backup, in minutes.", + "type": "integer" + }, + "retainLogBackups": { + "$ref": "#/components/schemas/ERetainLogBackupsType" + }, + "keepDaysCount": { + "description": "Number of days to keep archived logs.", + "type": "integer" + }, + "logShippingServers": { + "$ref": "#/components/schemas/BackupLogShippingServersImportModel" + } + } + }, + "GuestOsCredentialsImportModel": { + "description": "VM custom credentials.", + "type": "object", + "properties": { + "creds": { + "$ref": "#/components/schemas/CredentialsImportModel" + }, + "credentialsPerMachine": { + "description": "Individual credentials for VMs.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/GuestOsCredentialsPerMachineImportModel" + } + } + } + }, + "GuestOsCredentialsPerMachineImportModel": { + "required": [ + "vmObject" + ], + "type": "object", + "properties": { + "windowsCreds": { + "$ref": "#/components/schemas/CredentialsImportModel" + }, + "linuxCreds": { + "$ref": "#/components/schemas/CredentialsImportModel" + }, + "vmObject": { + "$ref": "#/components/schemas/VmwareObjectModel" + } + } + }, + "CredentialsImportModel": { + "required": [ + "credentialsName" + ], + "type": "object", + "properties": { + "credentialsName": { + "description": "User name, account name or access key.", + "type": "string" + }, + "credentialsTag": { + "description": "Tag used to identify the credentials record.", + "type": "string" + } + } + }, + "GuestInteractionProxiesSettingsImportModel": { + "description": "Guest interaction proxy used to deploy the runtime process on the VM guest OS.", + "required": [ + "automaticSelection" + ], + "type": "object", + "properties": { + "automaticSelection": { + "description": "If *true*, Veeam Backup & Replication automatically selects the guest interaction proxy.", + "type": "boolean", + "default": true + }, + "proxies": { + "description": "Array of proxies specified explicitly. The array must contain Microsoft Windows servers added to the backup infrastructure only.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JobExportSpec": { + "type": "object", + "properties": { + "ids": { + "description": "Array of job IDs.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "types": { + "description": "Array of job types.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "names": { + "description": "Array of job names. Wildcard characters are supported.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ViRootFilters": { + "type": "object", + "properties": { + "skip": { + "description": "Number of VMware vSphere servers to skip.", + "type": "integer", + "format": "int32" + }, + "limit": { + "description": "Maximum number of VMware vSphere servers to return.", + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EViRootFiltersOrderColumn" + }, + "orderAsc": { + "description": "Sorts VMware vSphere servers in the ascending order by the `orderColumn` parameter.", + "type": "boolean" + }, + "nameFilter": { + "description": "Filters VMware vSphere servers by the `nameFilter` pattern. The pattern can match any VMware vSphere server parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "type": "string" + } + } + }, + "EViRootFiltersOrderColumn": { + "description": "Sorts VMware vSphere servers by one of the VMware vSphere server parameters.", + "type": "string", + "enum": [ + "Name", + "Type" + ] + }, + "ViRootsResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of VMware vSphere servers.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareObjectSizeModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "VCenterInventoryFilters": { + "type": "object", + "properties": { + "skip": { + "description": "Number of objects to skip.", + "type": "integer", + "format": "int32" + }, + "limit": { + "description": "Maximum number of objects to return.", + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EvCentersInventoryFiltersOrderColumn" + }, + "orderAsc": { + "description": "Sorts objects in the ascending order by the `orderColumn` parameter.", + "type": "boolean" + }, + "objectIdFilter": { + "description": "Filters objects by object ID.", + "type": "string" + }, + "hierarchyTypeFilter": { + "$ref": "#/components/schemas/EHierarchyType" + }, + "nameFilter": { + "description": "Filters objects by the `nameFilter` pattern. The pattern can match any object parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "type": "string" + }, + "typeFilter": { + "$ref": "#/components/schemas/EVmwareInventoryType" + }, + "parentContainerNameFilter": { + "description": "Filters objects by name of the parent container.", + "type": "string" + } + } + }, + "EHierarchyType": { + "description": "Hierarchy type.", + "type": "string", + "enum": [ + "HostsAndClusters", + "DatastoresAndVms", + "HostsAndDatastores", + "VmsAndTemplates", + "VmsAndTags" + ] + }, + "EvCentersInventoryFiltersOrderColumn": { + "description": "Sorts vCenter Servers by one of the job parameters.", + "type": "string", + "enum": [ + "Name", + "ObjectId", + "Type" + ] + }, + "VCenterInventoryResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of vCenter Servers.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareObjectSizeModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "CredentialsImportSpecCollection": { + "required": [ + "credentials" + ], + "type": "object", + "properties": { + "credentials": { + "description": "Array of credentials.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/CredentialsImportSpec" + } + } + } + }, + "CredentialsImportSpec": { + "required": [ + "tag", + "type", + "username" + ], + "type": "object", + "properties": { + "username": { + "description": "User name.", + "type": "string" + }, + "password": { + "description": "Password.", + "type": "string" + }, + "description": { + "description": "Description of the credentials record.", + "type": "string" + }, + "tag": { + "description": "Tag used to identify the credentials record.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ECredentialsType" + }, + "linuxAdditionalSettings": { + "$ref": "#/components/schemas/CredentialsLinuxSettingsImportModel" + } + } + }, + "CredentialsLinuxSettingsImportModel": { + "type": "object", + "properties": { + "SSHPort": { + "description": "SSH port used to connect to a Linux server.", + "type": "integer" + }, + "autoElevated": { + "description": "If *true*, the permissions of the account are automatically elevated to the root user.", + "type": "boolean" + }, + "addToSudoers": { + "description": "If *true*, the account is automatically added to the sudoers file.", + "type": "boolean" + }, + "useSu": { + "description": "If *true*, the `su` command is used for Linux distributions where the `sudo` command is not available.", + "type": "boolean" + }, + "privateKey": { + "description": "Private key.", + "type": "string" + }, + "passphrase": { + "description": "Passphrase that protects the private key.", + "type": "string" + }, + "rootPassword": { + "description": "Password for the root account.", + "type": "string" + } + } + }, + "CredentialsExportSpec": { + "type": "object", + "properties": { + "showHiddenCreds": { + "description": "If *true*, service credentials are exported.", + "type": "boolean" + }, + "ids": { + "description": "Array of credentials IDs.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "types": { + "description": "Array of credentials types.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/ECredentialsType" + } + }, + "names": { + "uniqueItems": true, + "type": "array", + "description": "Array of credentials user names. Wildcard characters are supported.", + "items": { + "type": "string" + } + } + } + }, + "ProxyExportSpec": { + "type": "object", + "properties": { + "ids": { + "description": "Array of backup proxy IDs.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "types": { + "description": "Array of backup proxy types.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EProxyType" + } + }, + "names": { + "uniqueItems": true, + "type": "array", + "description": "Array of backup proxy names. Wildcard characters are supported.", + "items": { + "type": "string" + } + } + } + }, + "ProxyImportSpecCollection": { + "required": [ + "proxies" + ], + "type": "object", + "properties": { + "proxies": { + "description": "Array of backup proxies.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/ProxyImportSpec" + } + } + } + }, + "ProxyImportSpec": { + "required": [ + "description", + "server", + "type" + ], + "type": "object", + "properties": { + "description": { + "description": "Description of the backup proxy.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EProxyType" + }, + "server": { + "$ref": "#/components/schemas/ProxyServerSettingsImportSpec" + } + } + }, + "ProxyServerSettingsImportSpec": { + "description": "Settings of the server that is used as a backup proxy.", + "required": [ + "hostName" + ], + "type": "object", + "properties": { + "hostName": { + "description": "Name of the server.", + "type": "string" + }, + "hostTag": { + "description": "Tag assigned to the server.", + "type": "string" + }, + "transportMode": { + "$ref": "#/components/schemas/EBackupProxyTransportMode" + }, + "failoverToNetwork": { + "type": "boolean" + }, + "hostToProxyEncryption": { + "description": "[For the Network mode] If *true*, VM data is transferred over an encrypted TLS connection.\n", + "type": "boolean" + }, + "connectedDatastores": { + "$ref": "#/components/schemas/ProxyDatastoreSettingsModel" + }, + "maxTaskCount": { + "description": "Maximum number of concurrent tasks.", + "type": "integer" + } + } + }, + "ManageServerExportSpec": { + "type": "object", + "properties": { + "ids": { + "description": "Array of server IDs.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "types": { + "description": "Array of server types.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EManagedServerType" + } + }, + "names": { + "description": "Array of server names. Wildcard characters are supported.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ManageServerImportSpecCollection": { + "type": "object", + "properties": { + "windowsHosts": { + "description": "Array of managed Microsoft Windows servers.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/WindowsHostImportSpec" + } + }, + "linuxHosts": { + "description": "Array of managed Linux servers.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/LinuxHostImportSpec" + } + }, + "viHosts": { + "description": "Array of VMware vSphere servers.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/ViHostImportSpec" + } + } + } + }, + "WindowsHostImportSpec": { + "required": [ + "description", + "name", + "type" + ], + "type": "object", + "properties": { + "name": { + "description": "Full DNS name or IP address of the server.", + "type": "string" + }, + "description": { + "description": "Description of the server.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EManagedServerType" + }, + "credentials": { + "$ref": "#/components/schemas/CredentialsImportModel" + }, + "networkSettings": { + "$ref": "#/components/schemas/WindowsHostPortsModel" + } + } + }, + "LinuxHostImportSpec": { + "required": [ + "credentials", + "description", + "name", + "type", + "sshFingerprint" + ], + "type": "object", + "properties": { + "name": { + "description": "Full DNS name or IP address of the server.", + "type": "string" + }, + "description": { + "description": "Description of the server.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EManagedServerType" + }, + "credentials": { + "$ref": "#/components/schemas/CredentialsImportModel" + }, + "sshSettings": { + "$ref": "#/components/schemas/LinuxHostSSHSettingsModel" + }, + "sshFingerprint": { + "type": "string", + "description": "SSH key fingerprint used to verify the server identity." + } + } + }, + "ViHostImportSpec": { + "required": [ + "credentials", + "description", + "name", + "type", + "viHostType" + ], + "type": "object", + "properties": { + "name": { + "description": "Full DNS name or IP address of the server.", + "type": "string" + }, + "description": { + "description": "Description of the server.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EManagedServerType" + }, + "viHostType": { + "$ref": "#/components/schemas/EViHostType" + }, + "credentials": { + "$ref": "#/components/schemas/CredentialsImportModel" + }, + "port": { + "description": "Port used to communicate with the server.", + "type": "integer" + }, + "certificateThumbprint": { + "type": "string", + "description": "[Optional] Certificate thumbprint used to verify the server identity.\n" + } + } + }, + "RepositoryExportSpec": { + "type": "object", + "properties": { + "ids": { + "description": "Array of backup repository IDs.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "types": { + "description": "Array of backup repository types.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/ERepositoryType" + } + }, + "names": { + "description": "Array of repository names. Wildcard characters are supported.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "RepositoryImportSpecCollection": { + "type": "object", + "properties": { + "WindowsLocalRepositories": { + "description": "Array of windows local storages.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/WindowsLocalStorageImportSpec" + } + }, + "LinuxLocalRepositories": { + "description": "Array of linux local storages.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/LinuxLocalStorageImportSpec" + } + }, + "SmbRepositories": { + "description": "Array of network attached storages.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/SmbStorageImportSpec" + } + }, + "NfsRepositories": { + "description": "Array of network attached storages.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/NfsStorageImportSpec" + } + } + } + }, + "WindowsLocalStorageImportSpec": { + "required": [ + "description", + "hostName", + "kind", + "mountServer", + "name", + "repository", + "tag", + "type" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the backup repository.", + "type": "string" + }, + "description": { + "description": "Description of the backup repository.", + "type": "string" + }, + "tag": { + "description": "VMware vSphere tag assigned to the backup repository.", + "type": "string" + }, + "hostName": { + "description": "ID of the server that is used as a backup repository.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "repository": { + "$ref": "#/components/schemas/WindowsLocalRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsImportSpec" + } + } + }, + "LinuxLocalStorageImportSpec": { + "required": [ + "description", + "hostName", + "kind", + "mountServer", + "name", + "repository", + "tag", + "type" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the backup repository.", + "type": "string" + }, + "description": { + "description": "Description of the backup repository.", + "type": "string" + }, + "tag": { + "description": "VMware vSphere tag assigned to the backup repository.", + "type": "string" + }, + "hostName": { + "description": "ID of the server that is used as a backup repository.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "repository": { + "$ref": "#/components/schemas/LinuxLocalRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsImportSpec" + } + } + }, + "MountServerSettingsImportSpec": { + "required": [ + "mountServerName", + "vPowerNFSEnabled", + "writeCacheFolder" + ], + "type": "object", + "properties": { + "mountServerName": { + "description": "Name of the mount server.", + "type": "string" + }, + "writeCacheFolder": { + "description": "Path to the folder used for writing cache during mount operations.", + "type": "string" + }, + "vPowerNFSEnabled": { + "description": "If *true*, the vPower NFS Service is enabled on the mount server.", + "type": "boolean" + }, + "vPowerNFSPortSettings": { + "$ref": "#/components/schemas/VPowerNFSPortSettingsModel" + } + } + }, + "SmbStorageImportSpec": { + "required": [ + "description", + "kind", + "mountServer", + "name", + "repository", + "share", + "tag", + "type" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the backup repository.", + "type": "string" + }, + "description": { + "description": "Description of the backup repository.", + "type": "string" + }, + "tag": { + "description": "VMware vSphere tag assigned to the backup repository.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "share": { + "$ref": "#/components/schemas/SmbRepositoryShareSettingsSpec" + }, + "repository": { + "$ref": "#/components/schemas/NetworkRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsImportSpec" + } + } + }, + "NfsStorageImportSpec": { + "required": [ + "description", + "kind", + "mountServer", + "name", + "repository", + "share", + "tag", + "type" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the backup repository.", + "type": "string" + }, + "description": { + "description": "Description of the backup repository.", + "type": "string" + }, + "tag": { + "description": "VMware vSphere tag assigned to the backup repository.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "share": { + "$ref": "#/components/schemas/NfsRepositoryShareSettingsSpec" + }, + "repository": { + "$ref": "#/components/schemas/NetworkRepositorySettingsModel" + }, + "mountServer": { + "$ref": "#/components/schemas/MountServerSettingsImportSpec" + } + } + }, + "SmbRepositoryShareSettingsSpec": { + "required": [ + "credentials", + "sharePath" + ], + "type": "object", + "properties": { + "sharePath": { + "description": "Path to the shared folder that that is used as a backup repository.", + "type": "string" + }, + "credentials": { + "$ref": "#/components/schemas/CredentialsImportModel" + }, + "gatewayServer": { + "$ref": "#/components/schemas/RepositoryShareGatewayImportSpec" + } + } + }, + "NfsRepositoryShareSettingsSpec": { + "required": [ + "sharePath" + ], + "type": "object", + "properties": { + "sharePath": { + "description": "Path to the shared folder that that is used as a backup repository.", + "type": "string" + }, + "gatewayServer": { + "$ref": "#/components/schemas/RepositoryShareGatewayImportSpec" + } + } + }, + "RepositoryShareGatewayImportSpec": { + "description": "Settings for the gateway server.", + "type": "object", + "properties": { + "autoSelect": { + "description": "If *true*, Veeam Backup & Replication automatically selects a gateway server.", + "type": "boolean" + }, + "gatewayServerName": { + "description": "Name of the gateway server.", + "type": "string" + } + } + }, + "EncryptionPasswordsFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EEncryptionPasswordsFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + } + } + }, + "EEncryptionPasswordsFiltersOrderColumn": { + "type": "string", + "enum": [ + "Hint", + "ModificationTime" + ] + }, + "EncryptionPasswordSpec": { + "required": [ + "hint", + "password" + ], + "type": "object", + "properties": { + "password": { + "description": "Password for data encryption. If you lose the password, you will not be able to restore it.", + "type": "string" + }, + "hint": { + "description": "Hint for the encryption password. Provide a meaningful hint that will help you recall the password.", + "type": "string" + }, + "tag": { + "description": "Tag for the encryption password.", + "type": "string" + } + } + }, + "EncryptionPasswordsResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of encryption passwords.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EncryptionPasswordModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "EncryptionPasswordModel": { + "required": [ + "hint", + "id" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the encryption password.", + "type": "string", + "format": "uuid" + }, + "hint": { + "description": "Hint for the encryption password.", + "type": "string" + }, + "modificationTime": { + "description": "Date and time the password was last modified.", + "type": "string", + "format": "date-time" + }, + "tag": { + "description": "Tag for the encryption password.", + "type": "string" + } + } + }, + "EncryptionPasswordImportSpecCollection": { + "type": "object", + "properties": { + "encryptionPasswords": { + "description": "Array of encryption passwords.", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/EncryptionPasswordImportSpec" + } + } + } + }, + "EncryptionPasswordImportSpec": { + "required": [ + "hint", + "password" + ], + "type": "object", + "properties": { + "password": { + "description": "Password.", + "type": "string" + }, + "hint": { + "description": "Hint for the encryption password.", + "type": "string" + }, + "tag": { + "description": "Tag for the encryption password.", + "type": "string" + } + } + }, + "EncryptionPasswordExportSpec": { + "type": "object", + "properties": { + "modificationTimeFrom": { + "description": "Date and time the password was last modified.", + "type": "string", + "format": "date-time" + }, + "ids": { + "description": "Array of password IDs.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "hints": { + "description": "Array of password hints.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "description": "Array of password tags.", + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BackupsFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EBackupsFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + }, + "nameFilter": { + "type": "string" + }, + "createdAfterFilter": { + "type": "string", + "format": "date-time" + }, + "createdBeforeFilter": { + "type": "string", + "format": "date-time" + }, + "platformIdFilter": { + "type": "string", + "format": "uuid" + }, + "jobIdFilter": { + "type": "string", + "format": "uuid" + }, + "policyTagFilter": { + "type": "string" + } + } + }, + "EBackupsFiltersOrderColumn": { + "type": "string", + "enum": [ + "Name", + "CreationTime", + "PlatformId", + "JobId", + "PolicyTag" + ] + }, + "BackupsResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of backups.", + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "BackupModel": { + "type": "object", + "required": [ + "id", + "name", + "type", + "platformName", + "platformId", + "creationTime", + "repositoryId" + ], + "properties": { + "id": { + "description": "ID of the backup.", + "type": "string", + "format": "uuid" + }, + "jobId": { + "description": "ID of the job that created the backup.", + "type": "string", + "format": "uuid" + }, + "policyTag": { + "description": "Tag that identifies retention policy.", + "type": "string" + }, + "name": { + "description": "Name of the job that created the backup.", + "type": "string" + }, + "platformName": { + "$ref": "#/components/schemas/EPlatformType" + }, + "platformId": { + "description": "ID of the platform of the backup resource.", + "type": "string", + "format": "uuid" + }, + "creationTime": { + "description": "Date and time when the backup was created.", + "type": "string", + "format": "date-time" + }, + "repositoryId": { + "description": "ID of the backup repository where the backup is stored.", + "type": "string", + "format": "uuid" + } + } + }, + "EPlatformType": { + "type": "string", + "enum": [ + "VmWare", + "HyperV", + "Vcd", + "WindowsPhysical", + "LinuxPhysical", + "Tape", + "NasBackup", + "CustomPlatform" + ] + }, + "BackupObjectsFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EBackupObjectsFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + }, + "nameFilter": { + "type": "string" + }, + "platformNameFilter": { + "$ref": "#/components/schemas/EPlatformType" + }, + "platformIdFilter": { + "type": "string", + "format": "uuid" + }, + "typeFilter": { + "type": "string" + }, + "viTypeFilter": { + "type": "string" + } + } + }, + "EBackupObjectsFiltersOrderColumn": { + "type": "string", + "enum": [ + "Name", + "ObjectId", + "PlatformId", + "Type" + ] + }, + "BackupObjectsResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of backup objects.", + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupObjectModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "BackupObjectModel": { + "type": "object", + "required": [ + "id", + "platformName" + ], + "properties": { + "id": { + "description": "ID of the object.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the object.", + "type": "string" + }, + "type": { + "description": "Type of the object.", + "type": "string" + }, + "platformName": { + "$ref": "#/components/schemas/EPlatformType" + }, + "platformId": { + "description": "Id of the platform where the object was created.", + "type": "string", + "format": "uuid" + }, + "restorePointsCount": { + "description": "Number of restore points.", + "type": "integer" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ViBackupObjectModel" + } + ], + "discriminator": { + "propertyName": "platformName", + "mapping": { + "VmWare": "#/components/schemas/ViBackupObjectModel" + } + } + }, + "ViBackupObjectModel": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupObjectModel" + }, + { + "type": "object", + "required": [ + "server" + ], + "properties": { + "objectId": { + "description": "ID of the virtual infrastructure object: mo-ref or ID, depending on the virtualization platform.\n", + "type": "string" + }, + "viType": { + "$ref": "#/components/schemas/EVmwareInventoryType" + }, + "path": { + "description": "Path to the object.", + "type": "string" + } + } + } + ] + }, + "ObjectRestorePointsFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EObjectRestorePointsFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + }, + "createdAfterFilter": { + "type": "string", + "format": "date-time" + }, + "createdBeforeFilter": { + "type": "string", + "format": "date-time" + }, + "nameFilter": { + "type": "string" + }, + "platformNameFilter": { + "$ref": "#/components/schemas/EPlatformType" + }, + "platformIdFilter": { + "type": "string", + "format": "uuid" + }, + "backupIdFilter": { + "type": "string", + "format": "uuid" + }, + "backupObjectIdFilter": { + "type": "string", + "format": "uuid" + } + } + }, + "EObjectRestorePointsFiltersOrderColumn": { + "type": "string", + "enum": [ + "CreationTime", + "PlatformId", + "BackupId" + ] + }, + "ObjectRestorePointsResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of restore points.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ObjectRestorePointModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "ObjectRestorePointModel": { + "type": "object", + "required": [ + "id", + "name", + "paltformName", + "platformId", + "creationTime", + "backupId", + "allowedOperations" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "platformName": { + "$ref": "#/components/schemas/EPlatformType" + }, + "platformId": { + "description": "ID of a platform on which the object was created.", + "type": "string", + "format": "uuid" + }, + "creationTime": { + "description": "Date and time when the restore point was created.", + "type": "string", + "format": "date-time" + }, + "backupId": { + "description": "ID of a backup that contains the restore point.", + "type": "string", + "format": "uuid" + }, + "allowedOperations": { + "description": "Array of operations allowed for the restore point.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EObjectRestorePointOperation" + } + } + } + }, + "EObjectRestorePointOperation": { + "type": "string", + "enum": [ + "VmwareInstantRecoveryFcd" + ] + }, + "ObjectRestorePointDisksResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of disks.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ObjectRestorePointDiskModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "ObjectRestorePointDiskModel": { + "type": "object", + "required": [ + "uid", + "type", + "name", + "capacity", + "state" + ], + "properties": { + "uid": { + "description": "ID of the disk.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/EDiskInfoType" + }, + "name": { + "description": "Name of the disk.", + "type": "string" + }, + "capacity": { + "description": "Capacity of the disk.", + "type": "integer", + "format": "int64" + }, + "state": { + "$ref": "#/components/schemas/EDiskInfoProcessState" + } + } + }, + "EDiskInfoProcessState": { + "description": "Process state of the disk.", + "type": "string", + "enum": [ + "NotProcessed", + "InProcessing", + "PartiallyProcessed", + "Processed" + ] + }, + "EDiskInfoType": { + "description": "Type of the disk.", + "type": "string", + "enum": [ + "Unknown", + "Simple", + "Vi", + "Hv", + "HvRawDiskFile", + "EndPoint" + ] + }, + "VmwareFcdInstantRecoverySpec": { + "type": "object", + "required": [ + "objectRestorePointId", + "destinationCluster", + "disksMapping" + ], + "properties": { + "objectRestorePointId": { + "description": "ID of the restore point.", + "type": "string", + "format": "uuid" + }, + "destinationCluster": { + "description": "Destination cluster.", + "allOf": [ + { + "$ref": "#/components/schemas/VmwareObjectModel" + } + ] + }, + "disksMapping": { + "description": "Array of disks that will be restored.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareFcdInstantRecoveryDiskSpec" + } + }, + "writeCache": { + "$ref": "#/components/schemas/VmwareFcdWriteCacheSpec" + } + } + }, + "VmwareFcdInstantRecoveryMount": { + "type": "object", + "required": [ + "id", + "sessionId", + "state", + "spec" + ], + "properties": { + "id": { + "description": "Mount ID.", + "type": "string", + "format": "uuid" + }, + "sessionId": { + "description": "ID of the restore session. Use the ID to track the progress. For details, see [Get Session](#operation/GetSession).", + "type": "string", + "format": "uuid" + }, + "state": { + "$ref": "#/components/schemas/EInstantRecoveryMountState" + }, + "spec": { + "$ref": "#/components/schemas/VmwareFcdInstantRecoverySpec" + }, + "errorMessage": { + "type": "string" + }, + "mountedDisks": { + "description": "Array of mounted disks.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VmwareFcdInstantRecoveryDiskInfo" + } + } + } + }, + "VmwareFcdInstantRecoveryDiskSpec": { + "type": "object", + "required": [ + "nameInBackup", + "mountedDiskName", + "registeredFcdName" + ], + "properties": { + "nameInBackup": { + "description": "Disk name displayed in the backup.", + "type": "string" + }, + "mountedDiskName": { + "description": "Name of the VMDK file that will be stored in the datastore.", + "type": "string" + }, + "registeredFcdName": { + "description": "Name under which the disk will be registered as an FCD in the vCenter Managed Object Browser.", + "type": "string" + } + } + }, + "VmwareFcdInstantRecoveryDiskInfo": { + "type": "object", + "required": [ + "nameInBackup", + "mountedDiskName", + "registeredFcdName", + "objectId" + ], + "properties": { + "nameInBackup": { + "description": "Disk name displayed in the backup.", + "type": "string" + }, + "mountedDiskName": { + "description": "Name of the VMDK file that is stored in the datastore.", + "type": "string" + }, + "registeredFcdName": { + "description": "Name under which the disk is registered as an FCD in the vCenter Managed Object Browser.", + "type": "string" + }, + "objectId": { + "description": "FCD ID.", + "type": "string" + } + } + }, + "VmwareFcdWriteCacheSpec": { + "description": "Write cache for recovered disks.", + "type": "object", + "required": [ + "redirectIsEnabled" + ], + "properties": { + "redirectIsEnabled": { + "description": "If *true*, cache redirection is enabled. In this case, all changes made to the recovered disks while the Instant FCD Recovery is active are redirected to the specified `cacheDatastore` associated with the `storagePolicy`.", + "type": "boolean" + }, + "cacheDatastore": { + "$ref": "#/components/schemas/VmwareObjectModel" + }, + "storagePolicy": { + "$ref": "#/components/schemas/VmwareObjectModel" + } + } + }, + "EInstantRecoveryMountState": { + "description": "Mount state.", + "type": "string", + "enum": [ + "Failed", + "Mounting", + "Mounted", + "Dismounting" + ] + }, + "ScaleOutRepositoriesResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of scale-out backup repositories.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ScaleOutRepositoryModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "ScaleOutRepositoryModel": { + "type": "object", + "required": [ + "id", + "name", + "description", + "tag", + "performanceTier" + ], + "properties": { + "id": { + "description": "ID of the scale-out backup repository.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the scale-out backup repository.", + "type": "string" + }, + "description": { + "description": "Description of the scale-out backup repository.", + "type": "string" + }, + "tag": { + "description": "Tag assigned to of the scale-out backup repository.", + "type": "string" + }, + "performanceTier": { + "$ref": "#/components/schemas/PerformanceTierModel" + }, + "placementPolicy": { + "$ref": "#/components/schemas/PlacementPolicyModel" + }, + "capacityTier": { + "$ref": "#/components/schemas/CapacityTierModel" + }, + "archiveTier": { + "$ref": "#/components/schemas/ArchiveTierModel" + } + } + }, + "PerformanceTierModel": { + "description": "Performance tier.", + "type": "object", + "properties": { + "performanceExtents": { + "description": "Array of performance extents.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PerformanceExtentModel" + } + }, + "advancedSettings": { + "$ref": "#/components/schemas/PerformanceTierAdvancedSettingsModel" + } + } + }, + "PerformanceExtentModel": { + "type": "object", + "required": [ + "id", + "name", + "status" + ], + "properties": { + "id": { + "description": "ID of the backup repository added as a performance extent.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the backup repository added as a performance extent.", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/ERepositoryExtentStatusType" + } + } + }, + "PerformanceTierAdvancedSettingsModel": { + "description": "Advanced settings of the performance tier.", + "type": "object", + "properties": { + "perVmBackup": { + "description": "If *true*, Veeam Backup & Replication creates a separate backup file for every VM in the job.", + "type": "boolean" + }, + "fullWhenExtentOffline": { + "description": "If *true*, Veeam Backup & Replication creates a full backup file instead of an incremental backup file in case the required extent is offline.", + "type": "boolean" + } + } + }, + "PlacementPolicyModel": { + "description": "Backup file placement policy.", + "type": "object", + "required": [ + "type", + "settings" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/EPlacementPolicyType" + }, + "settings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupPlacementSettingsModel" + } + } + } + }, + "EPlacementPolicyType": { + "description": "Type of placement policy.", + "enum": [ + "DataLocality", + "Performance" + ], + "type": "string" + }, + "ERepositoryExtentStatusType": { + "enum": [ + "Normal", + "Evacuate", + "Pending", + "Sealed", + "Maintenance" + ], + "type": "string" + }, + "BackupPlacementSettingsModel": { + "description": "Settings of the performance placement policy.", + "type": "object", + "required": [ + "extentName", + "allowedBackups" + ], + "properties": { + "extentName": { + "description": "Name of a performance extent.", + "type": "string" + }, + "allowedBackups": { + "$ref": "#/components/schemas/EAllowedBackupsType" + } + } + }, + "EAllowedBackupsType": { + "description": "Type of backup files that can be stored on the extent.", + "enum": [ + "All", + "FullsOnly", + "IncrementsOnly" + ], + "type": "string" + }, + "CapacityTierModel": { + "description": "Capacity tier.", + "type": "object", + "properties": { + "enabled": { + "description": "If *true*, the capacity tier is enabled.", + "type": "boolean" + }, + "extentId": { + "description": "ID of an object storage repository added as a capacity extent.", + "type": "string", + "format": "uuid" + }, + "offloadWindow": { + "$ref": "#/components/schemas/BackupWindowSettingModel" + }, + "copyPolicyEnabled": { + "description": "If *true*, Veeam Backup & Replication copies backups from the performance extents to the capacity extent as soon as the backups are created.", + "type": "boolean" + }, + "movePolicyEnabled": { + "description": "If *true*, Veeam Backup & Replication moves backup files that belong to inactive backup chains from the performance extents to the capacity extent.", + "type": "boolean" + }, + "operationalRestorePeriodDays": { + "description": "Number of days after which inactive backup chains on the performance extents are moved to the capacity extent. Specify *0* to offload inactive backup chains on the same day they are created.", + "type": "integer" + }, + "overridePolicy": { + "$ref": "#/components/schemas/CapacityTierOverridePolicyModel" + }, + "encryption": { + "$ref": "#/components/schemas/BackupStorageSettingsEncryptionModel" + } + } + }, + "CapacityTierOverridePolicyModel": { + "description": "Override policy.", + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, Veeam Backup & Replication moves oldest backup files sooner if scale-out backup repository is reaching the threshold.", + "type": "boolean" + }, + "overrideSpaceThresholdPercents": { + "description": "Space threshold of the scale-out backup repository, in percent.", + "type": "integer" + } + } + }, + "ArchiveTierModel": { + "description": "Archive tier.", + "type": "object", + "required": [ + "isEnabled" + ], + "properties": { + "isEnabled": { + "description": "If *true*, the archive tier is enabled.", + "type": "boolean" + }, + "extentId": { + "description": "ID of an object storage repository added as an archive extent.", + "type": "string", + "format": "uuid" + }, + "archivePeriodDays": { + "description": "Number of days after which backup chains on the capacity extent are moved to the archive extent. Specify *0* to offload inactive backup chains on the same day they are created.", + "type": "integer" + }, + "advancedSettings": { + "$ref": "#/components/schemas/ArchiveTierAdvancedSettingsModel" + } + } + }, + "ArchiveTierAdvancedSettingsModel": { + "description": "Advanced settings of the archive tier.", + "type": "object", + "properties": { + "costOptimizedArchiveEnabled": { + "description": "If *true*, backups are archived if the remaining retention time is above minimum storage period for the repository.", + "type": "boolean" + }, + "archiveDeduplicationEnabled": { + "description": "If *true*, each backup is stored as a delta to the previous one.", + "type": "boolean" + } + } + }, + "ScaleOutRepositoriesFilters": { + "type": "object", + "properties": { + "skip": { + "description": "Number of repositories to skip.", + "type": "integer", + "format": "int32" + }, + "limit": { + "description": "Maximum number of repositories to return.", + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EScaleOutRepositoryFiltersOrderColumn" + }, + "orderAsc": { + "description": "Sorts repositories in the ascending order by the `orderColumn` parameter.", + "type": "boolean" + }, + "nameFilter": { + "description": "Filters repositories by the `nameFilter` substring. The substring can be part of any repository parameter.", + "type": "string" + } + } + }, + "EScaleOutRepositoryFiltersOrderColumn": { + "type": "string", + "enum": [ + "Name", + "Description", + "Type", + "Host", + "Path" + ] + }, + "VmwareFcdQuickMigrationSpec": { + "required": [ + "targetDatastore" + ], + "type": "object", + "properties": { + "mountedDiskNames": { + "description": "Array of disks that will be migrated to the `targetDatastore` associated with the `storagePolicy`.", + "type": "array", + "items": { + "type": "string" + } + }, + "targetDatastore": { + "description": "Target datastore. For details on how to get a datastore model, see [Get VMware vSphere Server Objects](#operation/GetVmwareHostObject).", + "allOf": [ + { + "$ref": "#/components/schemas/VmwareObjectModel" + } + ] + }, + "storagePolicy": { + "description": "Storage policy that will be applied to the migrated disks. For details on how to get a storage policy model, see [Get VMware vSphere Server Objects](#operation/GetVmwareHostObject).", + "allOf": [ + { + "$ref": "#/components/schemas/VmwareObjectModel" + } + ] + } + } + }, + "RepositoryStatesResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of repository states.", + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryStateModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "RepositoryStateModel": { + "required": [ + "id", + "name", + "type", + "description", + "capacityGB", + "freeGB", + "usedSpaceGB" + ], + "type": "object", + "properties": { + "id": { + "description": "ID of the backup repository.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "Name of the backup repository.", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "description": { + "type": "string" + }, + "hostId": { + "description": "ID of the server that is used as a backup repository.", + "type": "string", + "format": "uuid" + }, + "hostName": { + "description": "Name of the server that is used as a backup repository.", + "type": "string" + }, + "path": { + "description": "Path to the folder where backup files are stored.", + "type": "string" + }, + "capacityGB": { + "description": "Repository capacity in GB.", + "type": "number", + "format": "double" + }, + "freeGB": { + "description": "Repository free space in GB.", + "type": "number", + "format": "double" + }, + "usedSpaceGB": { + "description": "Repository used space in GB.", + "type": "number", + "format": "double" + } + } + }, + "RepositoryStatesFilters": { + "description": "Filters repositories by the specified parameters.", + "type": "object", + "properties": { + "skip": { + "description": "Skips the specified number of repositories.", + "type": "integer", + "format": "int32" + }, + "limit": { + "description": "Returns the specified number of repositories.", + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/ERepositoryStatesFiltersOrderColumn" + }, + "orderAsc": { + "description": "Sorts repositories in the ascending order by the `orderColumn` parameter.", + "type": "boolean" + }, + "idFilter": { + "type": "string", + "format": "uuid" + }, + "nameFilter": { + "description": "Filters repositories by the `nameFilter` pattern. The pattern can match any repository parameter. To substitute one or more characters, use the asterisk (*) character at the beginning and/or at the end.", + "type": "string" + }, + "typeFilter": { + "$ref": "#/components/schemas/ERepositoryType" + }, + "capacityFilter": { + "description": "Filters repositories by repository capacity.", + "type": "number", + "format": "double" + }, + "freeSpaceFilter": { + "description": "Filters repositories by repository free space.", + "type": "number", + "format": "double" + }, + "usedSpaceFilter": { + "description": "Filters repositories by repository used space.", + "type": "number", + "format": "double" + } + } + }, + "ERepositoryStatesFiltersOrderColumn": { + "description": "Orders repositories by the specified column.", + "type": "string", + "enum": [ + "Name", + "Type", + "Host", + "Path", + "CapacityGB", + "FreeGB", + "UsedSpaceGB", + "Description" + ] + }, + "ServicesResult": { + "required": [ + "data", + "pagination" + ], + "type": "object", + "properties": { + "data": { + "description": "Array of services.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServicesModel" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResult" + } + } + }, + "ServicesModel": { + "required": [ + "name", + "port" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the service.", + "type": "string" + }, + "port": { + "description": "Port used to communicate with the service.", + "type": "integer" + } + } + }, + "ServicesFilters": { + "type": "object", + "properties": { + "skip": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "orderColumn": { + "$ref": "#/components/schemas/EServicesFiltersOrderColumn" + }, + "orderAsc": { + "type": "boolean" + }, + "nameFilter": { + "type": "string" + } + } + }, + "EServicesFiltersOrderColumn": { + "type": "string", + "enum": [ + "Name", + "Port" + ] + }, + "DeleteRepositoryFilters": { + "type": "object", + "properties": { + "deleteBackups": { + "type": "boolean" + } + } + }, + "GeneralOptionsModel": { + "type": "object", + "properties": { + "emailSettings": { + "$ref": "#/components/schemas/GeneralOptionsEmailNotificationsModel" + }, + "notifications": { + "$ref": "#/components/schemas/GeneralOptionsNotificationsModel" + } + } + }, + "GeneralOptionsEmailNotificationsModel": { + "description": "Global email notification settings.", + "type": "object", + "required": [ + "isEnabled", + "smtpServerName", + "advancedSmtpOptions", + "from", + "to", + "subject", + "sendDailyReportsAt", + "notifyOnSuccess", + "notifyOnWarning", + "notifyOnFailure", + "notifyOnLastRetry" + ], + "properties": { + "isEnabled": { + "description": "If *true*, global email notification settings are enabled.", + "type": "boolean" + }, + "smtpServerName": { + "description": "Full DNS name or IP address of the SMTP server.", + "type": "string" + }, + "advancedSmtpOptions": { + "$ref": "#/components/schemas/AdvancedSmtpOptionsModel" + }, + "from": { + "description": "Email address from which email notifications must be sent.", + "type": "string" + }, + "to": { + "description": "Recipient email addresses. Use a semicolon to separate multiple addresses.", + "type": "string" + }, + "subject": { + "description": "Notification subject. Use the following variables in the subject:
    \n
  1. %Time% — completion time
  2. \n
  3. %JobName%
  4. \n
  5. %JobResult%
  6. \n
  7. %ObjectCount% — number of VMs in the job
  8. \n
  9. %Issues% — number of VMs in the job that have been processed with the Warning or Failed status
  10. \n
\n", + "type": "string" + }, + "sendDailyReportsAt": { + "description": "Time when Veeam Backup & Replication sends daily email reports.", + "type": "string", + "format": "date-time" + }, + "notifyOnSuccess": { + "description": "If *true*, email notifications are sent when the job completes successfully.", + "type": "boolean" + }, + "notifyOnWarning": { + "description": "If *true*, email notifications are sent when the job completes with a warning.", + "type": "boolean" + }, + "notifyOnFailure": { + "description": "If *true*, email notifications are sent when the job fails.", + "type": "boolean" + }, + "notifyOnLastRetry": { + "description": "If *true*, email notifications are sent about the final job status only (not per every job retry).", + "type": "boolean" + } + } + }, + "AdvancedSmtpOptionsModel": { + "description": "advanced global email notification settings.", + "type": "object", + "required": [ + "port", + "timeoutMs", + "SSLEnabled", + "authRequred" + ], + "properties": { + "port": { + "description": "Port number for the SMTP server.", + "type": "integer", + "format": "int32" + }, + "timeoutMs": { + "description": "Connection timeout for the SMTP server.", + "type": "integer", + "format": "int32" + }, + "SSLEnabled": { + "description": "If *true*, secure connection for email operations is used.", + "type": "boolean" + }, + "authRequred": { + "description": "If *true*, the `credentialsId` credentials are used to connect to the SMTP server.", + "type": "boolean" + }, + "credentialsId": { + "description": "ID of the credentials used to connect to the server.", + "type": "string", + "format": "uuid" + } + } + }, + "GeneralOptionsNotificationsModel": { + "type": "object", + "required": [ + "storageSpaceThresholdEnabled", + "storageSpaceThreshold", + "datastoreSpaceThresholdEnabled", + "datastoreSpaceThreshold", + "skipVMSpaceThresholdEnabled", + "skipVMSpaceThreshold", + "notifyOnSupportExpiration", + "notifyOnUpdates" + ], + "properties": { + "storageSpaceThresholdEnabled": { + "description": "If *true*, notifications about critical amount of free space in backup storage are enabled.", + "type": "boolean" + }, + "storageSpaceThreshold": { + "description": "Space threshold of backup storage, in percent.", + "type": "integer", + "format": "int32" + }, + "datastoreSpaceThresholdEnabled": { + "description": "If *true*, notifications about critical amount of free space in production datastore are enabled.", + "type": "boolean" + }, + "datastoreSpaceThreshold": { + "description": "Space threshold of production datastore, in percent.", + "type": "integer", + "format": "int32" + }, + "skipVMSpaceThresholdEnabled": { + "description": "If *true* and the `skipVMSpaceThreshold` threshold is reached, Veeam Backup & Replication terminates backup and replication jobs working with production datastores before VM snapshots are taken.", + "type": "boolean" + }, + "skipVMSpaceThreshold": { + "description": "Space threshold of production datastore, in percent.", + "type": "integer", + "format": "int32" + }, + "notifyOnSupportExpiration": { + "description": "If *true*, notifications about support contract expiration are enabled.", + "type": "boolean" + }, + "notifyOnUpdates": { + "description": "If *true*, notifications about updates are enabled.", + "type": "boolean" + } + } + }, + "ConfigBackupModel": { + "required": [ + "isEnabled", + "backupRepositoryId", + "restorePointsToKeep", + "notifications", + "schedule", + "lastSuccessfulBackup", + "encryption" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, configuration backup is enabled.", + "type": "boolean" + }, + "backupRepositoryId": { + "description": "ID of the backup repository on which the configuration backup is stored.", + "type": "string", + "format": "uuid" + }, + "restorePointsToKeep": { + "description": "Number of restore points to keep in the backup repository.", + "type": "integer", + "format": "int32" + }, + "notifications": { + "$ref": "#/components/schemas/ConfigBackupNotificationsModel" + }, + "schedule": { + "$ref": "#/components/schemas/ConfigBackupScheduleModel" + }, + "lastSuccessfulBackup": { + "$ref": "#/components/schemas/ConfigBackupLastSuccessfulModel" + }, + "encryption": { + "$ref": "#/components/schemas/ConfigBackupEncryptionModel" + } + } + }, + "ConfigBackupNotificationsModel": { + "description": "Notification settings.", + "required": [ + "SNMPEnabled" + ], + "type": "object", + "properties": { + "SNMPEnabled": { + "description": "If *true*, SNMP traps are enabled for this job.", + "type": "boolean" + }, + "SMTPSettings": { + "$ref": "#/components/schemas/ConfigBackupSMTPSettigsModel" + } + } + }, + "ConfigBackupSMTPSettigsModel": { + "description": "Email notification settings.", + "required": [ + "isEnabled", + "recipients", + "settingsType", + "subject", + "notifyOnSuccess", + "notifyOnWarning", + "notifyOnError" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, email notifications are enabled for this job.", + "type": "boolean" + }, + "recipients": { + "description": "Array of recipients' email addresses.", + "type": "array", + "items": { + "type": "string" + } + }, + "settingsType": { + "$ref": "#/components/schemas/EConfigBackupSMTPSettingsType" + }, + "subject": { + "description": "Notification subject. Use the following variables in the subject: *%JobResult%*, *%JobName%*, *%Time%* (completion time).\n", + "type": "string" + }, + "notifyOnSuccess": { + "description": "If *true*, email notifications are sent when the job completes successfully.", + "type": "boolean" + }, + "notifyOnWarning": { + "description": "If *true*, email notifications are sent when the job completes with a warning.", + "type": "boolean" + }, + "notifyOnError": { + "description": "If *true*, email notifications are sent when the job fails.", + "type": "boolean" + } + } + }, + "EConfigBackupSMTPSettingsType": { + "description": "Type of notification settings.", + "type": "string", + "enum": [ + "Global", + "Custom" + ] + }, + "ConfigBackupLastSuccessfulModel": { + "description": "Last successful backup.", + "type": "object", + "properties": { + "lastSuccessfulTime": { + "description": "Date and time when the last successful backup was created.", + "type": "string", + "format": "date-time" + }, + "sessionId": { + "description": "ID of the job session.", + "type": "string", + "format": "uuid" + } + } + }, + "ConfigBackupScheduleModel": { + "description": "Scheduling settings.", + "type": "object", + "required": [ + "isEnabled" + ], + "properties": { + "isEnabled": { + "description": "If *true*, backup scheduling is enabled.", + "type": "boolean" + }, + "daily": { + "$ref": "#/components/schemas/ScheduleDailyModel" + }, + "monthly": { + "$ref": "#/components/schemas/ScheduleMonthlyModel" + } + } + }, + "ConfigBackupEncryptionModel": { + "description": "Encryption settings.", + "required": [ + "isEnabled", + "passwordId" + ], + "type": "object", + "properties": { + "isEnabled": { + "description": "If *true*, backup encryption is enabled.", + "type": "boolean" + }, + "passwordId": { + "description": "ID of the password used for encryption.", + "type": "string", + "format": "uuid" + } + } + }, + "ScaleOutExtentMaintenanceSpec": { + "type": "object", + "required": [ + "repositoryIds" + ], + "properties": { + "repositoryIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + }, + "ConnectionCertificateModel": { + "type": "object", + "properties": { + "fingerprint": { + "description": "SSH key fingerprint used to verify the server identity.", + "type": "string" + }, + "certificate": { + "$ref": "#/components/schemas/CertificateModel" + } + } + } + }, + "parameters": { + "apiVersionParam": { + "name": "x-api-version", + "description": "Version and revision of the client REST API. Must be in the following\nformat: *\\-\\*.\n", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "1.0-rev1" + } + } + }, + "securitySchemes": { + "Bearer": { + "type": "apiKey", + "description": "Access token in the *Bearer \\* format.", + "name": "Authorization", + "in": "header" + } + } + } +} \ No newline at end of file diff --git a/swagger.yml b/swagger.yml deleted file mode 100644 index 04eea34..0000000 --- a/swagger.yml +++ /dev/null @@ -1,12313 +0,0 @@ -swagger: '2.0' -info: - contact: - email: support@veeam.com - description: > - This document lists paths (endpoints) of the Veeam Backup & Replication REST - API and operations that you can perform by sending HTTP requests to the - paths.
- - Requests can contain parameters in their path, query and header. POST and - PUT requests can include a request body with resource payload. In response, - you receive a conventional HTTP response code, HTTP response header and an - optional response body schema that contains a result model.
- - Parameters, request bodies, and response bodies are defined inline or refer - to schemas defined globally. Some schemas are polymorphic. - title: Veeam Backup & Replication REST API - version: 1.0-rev1 -basePath: / -paths: - /api/oauth2/authorization_code: - post: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/AuthorizationCodeModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Login - description: >- - The HTTP POST request to the `/api/oauth2/authorization_code` path - allows you to get an authorization code that is used to obtain an access - token. For more information on authorization process, see [Requesting - Authorization](https://helpcenter.veeam.com/docs/backup/vbr_rest/requesting_authorization.html). - operationId: CreateAuthorizationCode - summary: Get Authorization Code - /api/oauth2/logout: - post: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/EmptySuccessResponse' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Login - description: > - The HTTP POST request to the `/api/oauth2/logout` path allows you to - perform the logout operation. After you log out, access and refresh - tokens are expired. - operationId: Logout - summary: Log Out - /api/oauth2/token: - post: - consumes: - - application/x-www-form-urlencoded - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - default: password - description: > - Authorization grant type. - - - Available values: - - - `password` — used to obtain an access token by providing a user - name and password. - - - `refresh_token` — used to refresh an expired or lost access token - by providing a refresh token. - - - `authorization_code` — used to obtain an access token by providing - an authorization code. - enum: - - password - - refresh_token - - authorization_code - in: formData - name: grant_type - required: true - type: string - - description: User name. Required if the `grant_type` value is `password`. - in: formData - name: username - type: string - - description: Password. Required if the `grant_type` value is `password`. - format: password - in: formData - name: password - type: string - - description: >- - Refresh token. Required if the `grant_type` value is - `refresh_token`. - in: formData - name: refresh_token - type: string - - description: >- - Authorization code. Required if the `grant_type` value is - `authorization_code`. - in: formData - name: code - type: string - - description: >- - If *true*, a short-term refresh token is used. Lifetime of the - short-term refresh token is the access token lifetime plus 15 - minutes. - in: formData - name: use_short_term_refresh - type: boolean - responses: - '200': - description: OK - schema: - $ref: '#/definitions/TokenModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - security: [] - tags: - - Login - description: >- - The HTTP POST request to the `/api/oauth2/token` path allows you to get - an access token and a refresh token. - operationId: CreateToken - summary: Get Access Token - /api/v1/automation/credentials/export: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: false - schema: - $ref: '#/definitions/CredentialsExportSpec' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/CredentialsImportSpecCollection' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/credentials/export` - path allows you to export credentials from Veeam Backup & Replication. - operationId: ExportCredentials - summary: Export Credentials - x-veeam-authorize: - claims: - - ExportCredentials - /api/v1/automation/credentials/import: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/CredentialsImportSpecCollection' - responses: - '201': - description: >- - Automation session has been created to import the credentials. To - check the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/credentials/import` - path allows you to import credentials to Veeam Backup & Replication. - operationId: ImportCredentials - summary: Import Credentials - x-veeam-authorize: - claims: - - ImportCredentials - /api/v1/automation/encryptionPasswords/export: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: false - schema: - $ref: '#/definitions/EncryptionPasswordExportSpec' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/EncryptionPasswordImportSpecCollection' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the - `/api/v1/automation/encryptionPasswords/export` path allows you to - export encryption passwords from Veeam Backup & Replication. - operationId: ExportEncryptionPasswords - summary: Export Encryption Passwords - x-veeam-authorize: - claims: - - ExportEncryptionPasswords - /api/v1/automation/encryptionPasswords/import: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/EncryptionPasswordImportSpecCollection' - responses: - '201': - description: >- - Automation session has been created to import the passwords. To - check the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the - `/api/v1/automation/encryptionPasswords/import` path allows you to - import encryption passwords to Veeam Backup & Replication. - operationId: ImportEncryptionPasswords - summary: Import Encryption Passwords - x-veeam-authorize: - claims: - - ImportEncryptionPasswords - /api/v1/automation/jobs/export: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: false - schema: - $ref: '#/definitions/JobExportSpec' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/JobImportSpecCollection' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/jobs/export` path - allows you to export jobs from Veeam Backup & Replication. - operationId: ExportJobs - summary: Export Jobs - x-veeam-authorize: - claims: - - ExportJobs - /api/v1/automation/jobs/import: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/JobImportSpecCollection' - responses: - '201': - description: >- - Automation session has been created to import the jobs. To check the - progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/jobs/import` path - allows you to import jobs to Veeam Backup & Replication. - operationId: ImportJobs - summary: Import Jobs - x-veeam-authorize: - claims: - - ImportJobs - /api/v1/automation/managedServers/export: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: false - schema: - $ref: '#/definitions/ManageServerExportSpec' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ManageServerImportSpecCollection' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/managedServers/export` - path allows you to export managed servers from Veeam Backup & - Replication. - operationId: ExportManagedServers - summary: Export Servers - x-veeam-authorize: - claims: - - ExportManagedServers - /api/v1/automation/managedServers/import: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ManageServerImportSpecCollection' - responses: - '201': - description: >- - Automation session has been created to import the servers. To check - the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/managedServers/import` - path allows you to import managed servers to Veeam Backup & Replication. - operationId: ImportManagedServers - summary: Import Servers - x-veeam-authorize: - claims: - - ImportManagedServers - /api/v1/automation/proxies/export: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: false - schema: - $ref: '#/definitions/ProxyExportSpec' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ProxyImportSpecCollection' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/proxies/export` path - allows you to export backup proxies from Veeam Backup & Replication. - operationId: ExportProxies - summary: Export Proxies - x-veeam-authorize: - claims: - - ExportProxies - /api/v1/automation/proxies/import: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ProxyImportSpecCollection' - responses: - '201': - description: >- - Automation session has been created to import the proxies. To check - the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/proxies/import` path - allows you to import backup proxies to Veeam Backup & Replication. - operationId: ImportProxies - summary: Import Proxies - x-veeam-authorize: - claims: - - ImportProxies - /api/v1/automation/repositories/export: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: false - schema: - $ref: '#/definitions/RepositoryExportSpec' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/RepositoryImportSpecCollection' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/repositories/export` - path allows you to export backup repositories from Veeam Backup & - Replication. - operationId: ExportRepositories - summary: Export Repositories - x-veeam-authorize: - claims: - - ExportRepositories - /api/v1/automation/repositories/import: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/RepositoryImportSpecCollection' - responses: - '201': - description: >- - Automation session has been created to import the repositories. To - check the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/repositories/import` - path allows you to import backup repositories to Veeam Backup & - Replication. - operationId: ImportRepositories - summary: Import Repositories - x-veeam-authorize: - claims: - - ImportRepositories - /api/v1/automation/sessions: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of sessions to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Maximum number of sessions to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Sorts sessions by one of the session parameters. - enum: - - Name - - SessionType - - CreationTime - - EndTime - - State - - Result - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Sorts sessions in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Filters sessions by the `nameFilter` pattern. The pattern can match - any session parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Returns sessions that are created after the specified date and time. - format: date-time - in: query - name: createdAfterFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Returns sessions that are created before the specified date and - time. - format: date-time - in: query - name: createdBeforeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Returns sessions that are finished after the specified date and - time. - format: date-time - in: query - name: endedAfterFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Returns sessions that are finished before the specified date and - time. - format: date-time - in: query - name: endedBeforeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Filters sessions by session type. - enum: - - Infrastructure - - Job - - Automation - - ConfigurationBackup - - RepositoryMaintenance - - RepositoryEvacuate - - InfrastructureItemDeletion - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Filters sessions by session state. - enum: - - Stopped - - Starting - - Stopping - - Working - - Pausing - - Resuming - - WaitingTape - - Idle - - Postprocessing - - WaitingRepository - - WaitingSlot - in: query - name: stateFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Filters sessions by session result. - enum: - - None - - Success - - Warning - - Failed - in: query - name: resultFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Filters sessions by job ID. - format: uuid - in: query - name: jobIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/SessionsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP GET request to the `/api/v1/automation/sessions` path allows - you to get an array of all automation sessions performed on the backup - server. - operationId: GetAllAutomationSessions - summary: Get All Automation Sessions - x-veeam-authorize: - claims: - - ViewSessions - '/api/v1/automation/sessions/{id}': - get: - produces: - - application/json - parameters: - - description: ID of the session. - format: uuid - in: path - name: id - required: true - type: string - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/SessionModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP GET request to the `/api/v1/automation/sessions/{id}` path - allows you to get an automation session that has the specified `id`. - operationId: GetAutomationSession - summary: Get Automation Session - x-veeam-authorize: - claims: - - ViewSessions - '/api/v1/automation/sessions/{id}/logs': - get: - produces: - - application/json - parameters: - - description: ID of the session. - format: uuid - in: path - name: id - required: true - type: string - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/SessionLogResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP GET request to the `/api/v1/automation/sessions/{id}/logs` path - allows you to get an array of log records of an automation session that - has the specified `id`. - operationId: GetAutomationSessionLogs - summary: Get Automation Session Logs - x-veeam-authorize: - claims: - - ViewSessions - '/api/v1/automation/sessions/{id}/stop': - post: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the session. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/EmptySuccessResponse' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Automation - description: >- - The HTTP POST request to the `/api/v1/automation/sessions/{id}/stop` - path allows you to stop an automation session that has the specified - `id`. - operationId: StopAutomationSession - summary: Stop Automation Session - x-veeam-authorize: - claims: - - StopSessions - /api/v1/backupInfrastructure/managedServers: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of servers to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/ManagedServersFilters' - - description: Maximum number of servers to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/ManagedServersFilters' - - description: Sorts servers by one of the server parameters. - enum: - - Name - - Type - - Description - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/ManagedServersFilters' - - description: Sorts servers in the ascending order by the `orderColumn` parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/ManagedServersFilters' - - description: >- - Filters servers by the `nameFilter` pattern. The pattern can match - any server parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ManagedServersFilters' - - description: Filters servers by server type. - enum: - - WindowsHost - - LinuxHost - - ViHost - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ManagedServersFilters' - - description: Filters servers by the type of VMware vSphere server. - enum: - - ESX - - ESXi - - VC - in: query - name: viTypeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ManagedServersFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ManagedServersResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Managed Servers - description: >- - The HTTP GET request to the - `/api/v1/backupInfrastructure/managedServers` path allows you to get an - array of all servers that are added to the backup infrastructure. - operationId: GetAllManagedServers - summary: Get All Servers - x-veeam-authorize: - claims: - - ViewManagedServers - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ManagedServerSpec' - responses: - '201': - description: >- - Infrastructure session has been created to add the server. To check - the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Managed Servers - description: >- - The HTTP POST request to the - `/api/v1/backupInfrastructure/managedServers` path allows you to add a - server to the backup infrastructure. - operationId: CreateManagedServer - summary: Add Server - x-veeam-authorize: - claims: - - CreateManagedServers - '/api/v1/backupInfrastructure/managedServers/{id}': - delete: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the managed server. - format: uuid - in: path - name: id - required: true - type: string - responses: - '201': - description: Managed server has been removed. - schema: - $ref: '#/definitions/SessionModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Managed Servers - description: >- - The HTTP DELETE request to the - `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to - remove a managed server that has the specified `id` from the backup - infrastructure. - operationId: DeleteManagedServer - summary: Remove Server - x-veeam-authorize: - claims: - - DeleteManagedServers - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the managed server. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ManagedServerModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Managed Servers - description: >- - The HTTP GET request to the - `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to - get a managed server that has the specified `id`. - operationId: GetManagedServer - summary: Get Server - x-veeam-authorize: - claims: - - ViewManagedServers - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the managed server. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ManagedServerModel' - responses: - '201': - description: >- - Infrastructure session has been created to edit the server. To check - the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Managed Servers - description: >- - The HTTP PUT request to the - `/api/v1/backupInfrastructure/managedServers/{id}` path allows you to - edit a managed server that has the specified `id`. - operationId: UpdateManagedServer - summary: Edit Server - x-veeam-authorize: - claims: - - UpdateManagedServers - /api/v1/backupInfrastructure/proxies: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of proxies to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/ProxiesFilters' - - description: Maximum number of proxies to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/ProxiesFilters' - - description: Sorts proxies by one of the proxy parameters. - enum: - - Name - - Type - - Description - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/ProxiesFilters' - - description: Sorts proxies in the ascending order by the `orderColumn` parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/ProxiesFilters' - - description: >- - Filters proxies by the `nameFilter` pattern. The pattern can match - any proxy parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ProxiesFilters' - - description: Filters proxies by proxy type. - enum: - - ViProxy - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ProxiesFilters' - - description: Filters proxies by ID of the backup server. - format: uuid - in: query - name: hostIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ProxiesFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ProxiesResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Proxies - description: >- - The HTTP GET request to the `/api/v1/backupInfrastructure/proxies` path - allows you to get an array of all backup proxies that are added to the - backup infrastructure. - operationId: GetAllProxies - summary: Get All Proxies - x-veeam-authorize: - claims: - - ViewProxies - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ProxySpec' - responses: - '201': - description: >- - Infrastructure session has been created to add the proxy. To check - the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Proxies - description: >- - The HTTP POST request to the `/api/v1/backupInfrastructure/proxies` path - allows you to add a proxy to the backup infrastructure. - operationId: CreateProxy - summary: Add Proxy - x-veeam-authorize: - claims: - - CreateProxies - '/api/v1/backupInfrastructure/proxies/{id}': - delete: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup proxy. - format: uuid - in: path - name: id - required: true - type: string - responses: - '204': - description: Removed. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Proxies - description: >- - The HTTP DELETE request to the - `/api/v1/backupInfrastructure/proxies/{id}` path allows you to remove a - backup proxy that has the specified `id` from the backup infrastructure. - operationId: DeleteProxy - summary: Remove Proxy - x-veeam-authorize: - claims: - - DeleteProxies - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup proxy. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ProxyModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Proxies - description: >- - The HTTP GET request to the `/api/v1/backupInfrastructure/proxies/{id}` - path allows you to get a backup proxy that has the specified `id`. - operationId: GetProxy - summary: Get Proxy - x-veeam-authorize: - claims: - - ViewProxies - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup proxy. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ProxyModel' - responses: - '201': - description: >- - Infrastructure session has been created to edit the proxy. To check - the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Proxies - description: >- - The HTTP PUT request to the `/api/v1/backupInfrastructure/proxies/{id}` - path allows you to edit a backup proxy that has the specified `id`. - operationId: UpdateProxy - summary: Edit Proxy - x-veeam-authorize: - claims: - - UpdateProxies - /api/v1/backupInfrastructure/repositories: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of repositories to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - - description: Maximum number of repositories to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - - description: Sorts repositories by one of the repository parameters. - enum: - - Name - - Description - - Type - - Host - - Path - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - - description: >- - Sorts repositories in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - - description: >- - Filters repositories by the `nameFilter` pattern. The pattern can - match any repository parameter. To substitute one or more - characters, use the asterisk (*) character at the beginning and/or - at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - - description: Filters repositories by repository type. - enum: - - WinLocal - - LinuxLocal - - Smb - - Nfs - - AzureBlob - - AzureArchive - - AmazonS3 - - AmazonS3Glacier - - S3Compatible - - GoogleCloud - - IBMCloud - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - - description: Filters repositories by ID of the backup server. - format: uuid - in: query - name: hostIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - - description: >- - Filters repositories by path to the folder where backup files are - stored. - in: query - name: pathFilter - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - - description: > - Filters repositories by VM Backup API parameters converted to the - base64 string.
- - To compose the base64 string:
- -
    -
  1. Prepare VM Backup API parameters in the JSON format.
  2. - {
    - "protocolVersion":"string",
    - "assemblyVersion":"string",
    - "productId":"string",
    - "versionFlags":"string"
    - }
    -
  3. Convert the JSON object into a string.
  4. -
  5. Encode the string with base64 encoding.
  6. -
- in: query - name: vmbApiFilter - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoriesFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/RepositoriesResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP GET request to the `/api/v1/backupInfrastructure/repositories` - path allows you to get an array of all backup repositories that are - added to the backup infrastructure. - operationId: GetAllRepositories - summary: Get All Repositories - x-veeam-authorize: - claims: - - ViewRepositories - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/RepositorySpec' - responses: - '201': - description: >- - Infrastructure session has been created to add the repository. To - check the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP POST request to the `/api/v1/backupInfrastructure/repositories` - path allows you to add a repository to the backup infrastructure. - operationId: CreateRepository - summary: Add Repository - x-veeam-authorize: - claims: - - CreateRepositories - /api/v1/backupInfrastructure/repositories/states: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of repository states to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: Maximum number of repository states to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: Sorts repository states by one of the state parameters. - enum: - - Name - - Type - - Host - - Path - - CapacityGB - - FreeGB - - UsedSpaceGB - - Description - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: >- - Sorts repository states in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: Filters repository states by repository ID. - format: uuid - in: query - name: idFilter - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: >- - Filters repository states by the `nameFilter` pattern. The pattern - can match any repository state parameter. To substitute one or more - characters, use the asterisk (*) character at the beginning and/or - at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: Filters repository states by repository type. - enum: - - WinLocal - - LinuxLocal - - Smb - - Nfs - - AzureBlob - - AzureArchive - - AmazonS3 - - AmazonS3Glacier - - S3Compatible - - GoogleCloud - - IBMCloud - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: Filters repository states by repository capacity. - format: double - in: query - name: capacityFilter - type: number - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: Filters repository states by repository free space. - format: double - in: query - name: freeSpaceFilter - type: number - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - - description: Filters repository states by repository used space. - format: double - in: query - name: usedSpaceFilter - type: number - x-veeam-spec: - $ref: '#/definitions/RepositoryStatesFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/RepositoryStatesResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP GET request to the - `/api/v1/backupInfrastructure/repositories/states` path allows you to - get an array of all repository states. The states include repository - location and brief statistics, such as repository capacity, free and - used space. - operationId: GetAllRepositoriesStates - summary: Get All Repository States - x-veeam-authorize: - claims: - - ViewRepositories - '/api/v1/backupInfrastructure/repositories/{id}': - delete: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup repository. - format: uuid - in: path - name: id - required: true - type: string - - description: 'If *true*, Veeam Backup & Replication will remove backup files.' - in: query - name: deleteBackups - required: false - type: boolean - x-veeam-spec: - $ref: '#/definitions/DeleteRepositoryFilters' - responses: - '204': - description: Removed - schema: - $ref: '#/definitions/EmptySuccessResponse' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP DELETE request to the - `/api/v1/backupInfrastructure/repositories/{id}` path allows you to - remove a backup repository that has the specified `id` from the backup - infrastructure. - operationId: DeleteRepository - summary: Remove Repository - x-veeam-authorize: - claims: - - DeleteRepositories - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup repository. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/RepositoryModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP GET request to the - `/api/v1/backupInfrastructure/repositories/{id}` path allows you to get - a backup repository that has the specified `id`. - operationId: GetRepository - summary: Get Repository - x-veeam-authorize: - claims: - - ViewRepositories - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup repository. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/RepositoryModel' - responses: - '201': - description: >- - Infrastructure session has been created to edit the repository. To - check the progress, track the session `state`. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP PUT request to the - `/api/v1/backupInfrastructure/repositories/{id}` path allows you to edit - a backup repository that has the specified `id`. - operationId: UpdateRepository - summary: Edit Repository - x-veeam-authorize: - claims: - - UpdateRepositories - /api/v1/backupInfrastructure/scaleOutRepositories: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of repositories to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/ScaleOutRepositoriesFilters' - - description: Maximum number of repositories to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/ScaleOutRepositoriesFilters' - - description: Sorts repositories by one of the repository parameters. - enum: - - Name - - Description - - Type - - Host - - Path - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/ScaleOutRepositoriesFilters' - - description: >- - Sorts repositories in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/ScaleOutRepositoriesFilters' - - description: >- - Filters repositories by the `nameFilter` substring. The substring - can be part of any repository parameter. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ScaleOutRepositoriesFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ScaleOutRepositoriesResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP GET request to the - `/api/v1/backupInfrastructure/scaleOutRepositories` path allows you to - get an array of all scale-out backup repositories that are added to the - backup infrastructure. - operationId: GetAllScaleOutRepositories - summary: Get All Scale-Out Backup Repositories - x-veeam-authorize: - claims: - - ViewScaleOutRepositories - '/api/v1/backupInfrastructure/scaleOutRepositories/{id}': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the scale-out backup repository. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ScaleOutRepositoryModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP GET request to the - `/api/v1/backupInfrastructure/scaleOutRepositories/{id}` path allows you - to get a scale-out backup repository that has the specified `id`. - operationId: GetScaleOutRepository - summary: Get Scale-Out Backup Repository - x-veeam-authorize: - claims: - - ViewScaleOutRepositories - '/api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode': - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the scale-out backup repository extent. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ScaleOutExtentMaintenanceSpec' - responses: - '201': - description: RepositoryMaintenance session has been created. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP POST request to the - `/api/v1/backupInfrastructure/scaleOutRepositories/{id}/disableMaintenanceMode` - path allows you to disable maintenance mode for a scale-out backup - repository extent that has the specified `id`. - operationId: DisableScaleOutExtentMaintenanceMode - summary: Disable Maintenance Mode - x-veeam-authorize: - claims: - - DisableRepositoryMaintenanceMode - '/api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode': - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the scale-out backup repository extent. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ScaleOutExtentMaintenanceSpec' - responses: - '201': - description: RepositoryMaintenance session has been created. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Repositories - description: >- - The HTTP POST request to the - `/api/v1/backupInfrastructure/scaleOutRepositories/{id}/enableMaintenanceMode` - path allows you to enable maintenance mode for a scale-out backup - repository extent that has the specified `id`. - operationId: EnableScaleOutExtentMaintenanceMode - summary: Enable Maintenance Mode - x-veeam-authorize: - claims: - - EnableRepositoryMaintenanceMode - /api/v1/backupObjects: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of backup objects to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - - description: Maximum number of backup objects to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - - description: Sorts backup objects by one of the backup object parameters. - enum: - - Name - - ObjectId - - PlatformId - - Type - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - - description: >- - Sorts backup objects in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - - description: >- - Filters backup objects by the `nameFilter` pattern. The pattern can - match any backup object parameter. To substitute one or more - characters, use the asterisk (*) character at the beginning and/or - at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - - description: Filters backup objects by platform ID. - enum: - - VmWare - - HyperV - - Vcd - - WindowsPhysical - - LinuxPhysical - - Tape - - NasBackup - - CustomPlatform - in: query - name: platformNameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - - description: Filters backup objects by platform ID. - format: uuid - in: query - name: platformIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - - description: Filters backup objects by object type. - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - - description: Filters backup objects by the type of VMware vSphere server. - in: query - name: viTypeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupObjectsFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BackupObjectsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Backup Objects - description: >- - The HTTP GET request to the `/api/v1/backupObjects` path allows you to - get an array of virtual infrastructure objects (VMs and VM containers) - that are inсluded in backups created by the backup server. - operationId: GetAllBackupObjects - summary: Get All Backup Objects - x-veeam-authorize: - claims: - - ViewBackupObjects - '/api/v1/backupObjects/{id}': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup object. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BackupObjectModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Backup Objects - description: >- - The HTTP GET request to the `/api/v1/backupObjects/{id}` path allows you - to get a backup object that has the specified `id`. - operationId: GetBackupObject - summary: Get Backup Object - x-veeam-authorize: - claims: - - ViewBackupObjects - '/api/v1/backupObjects/{id}/restorePoints': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup object. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ObjectRestorePointsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Backup Objects - description: >- - The HTTP GET request to the `/api/v1/backupObjects/{id}/restorePoints` - path allows you to get an array of restore points of a backup object - that has the specified `id`. - operationId: GetBackupObjectRestorePoints - summary: Get Restore Points - x-veeam-authorize: - claims: - - ViewRestorePoints - /api/v1/backups: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of backups to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: Maximum number of backups to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: Sorts backups by one of the backup parameters. - enum: - - Name - - CreationTime - - PlatformId - - JobId - - PolicyTag - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: Sorts backups in the ascending order by the `orderColumn` parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: >- - Filters backups by the `nameFilter` pattern. The pattern can match - any backup parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: Returns backups that are created after the specified date and time. - format: date-time - in: query - name: createdAfterFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: Returns backups that are created before the specified date and time. - format: date-time - in: query - name: createdBeforeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: Filters backups by ID of the backup object platform. - format: uuid - in: query - name: platformIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: Filters backups by ID of the parent job. - format: uuid - in: query - name: jobIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - - description: Filters backups by retention policy tag. - in: query - name: policyTagFilter - type: string - x-veeam-spec: - $ref: '#/definitions/BackupsFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BackupsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Backups - description: >- - The HTTP GET request to the `/api/v1/backups` path allows you to get an - array of all backups that are created on or imported to the backup - server. - operationId: GetAllBackups - summary: Get All Backups - x-veeam-authorize: - claims: - - ViewBackups - '/api/v1/backups/{id}': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BackupModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Backups - description: >- - The HTTP GET request to the `/api/v1/backups/{id}` path allows you to - get a backup that has the specified `id`. - operationId: GetBackup - summary: Get Backup - x-veeam-authorize: - claims: - - ViewBackups - '/api/v1/backups/{id}/objects': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the backup. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BackupObjectsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Backups - description: >- - The HTTP GET request to the `/api/v1/backups/{id}/objects` path allows - you to get an array of virtual infrastructure objects (VMs and VM - containers) that are inсluded in a backup that has the specified ID. - operationId: GetBackupObjects - summary: Get Backup Objects - x-veeam-authorize: - claims: - - ViewBackupObjects - /api/v1/configBackup: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ConfigBackupModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Configuration Backup - description: >- - The HTTP GET request to the `/api/v1/configBackup` path allows you to - get configuration backup of the backup server. - operationId: GetConfigBackupOptions - summary: Get Configuration Backup - x-veeam-authorize: - claims: - - ViewConfigBackupOptions - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/ConfigBackupModel' - responses: - '200': - description: Configuration backup settings have been updated. - schema: - $ref: '#/definitions/ConfigBackupModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Configuration Backup - description: >- - The HTTP PUT request to the `/api/v1/configBackup` path allows you to - edit configuration backup of the backup server. - operationId: UpdateConfigBackupOptions - summary: Edit Configuration Backup - x-veeam-authorize: - claims: - - UpdateConfigBackupOptions - /api/v1/configBackup/backup: - post: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: Configuration backup has been started. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Configuration Backup - description: >- - The HTTP POST request to the `/api/v1/configBackup` path allows you to - start configuration backup. - operationId: StartConfigBackup - summary: Start Configuration Backup - x-veeam-authorize: - claims: - - StartConfigBackup - /api/v1/connectionCertificate: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/HostConnectionSpec' - responses: - '201': - description: OK - schema: - $ref: '#/definitions/ConnectionCertificateModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Connection - description: >- - The HTTP POST request to the `/api/v1/connectionCertificate` path allows - you to get a TLS certificate or SSH fingerprint of the specified host. - operationId: GetConnectionCertificate - summary: Request TLS Certificate or SSH Fingerprint - x-veeam-authorize: - claims: - - CheckCertificate - /api/v1/credentials: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of credentials records to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/CredentialsFilters' - - description: Maximum number of credentials records to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/CredentialsFilters' - - description: Sorts credentials by one of the credentials parameters. - enum: - - Username - - Description - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/CredentialsFilters' - - description: >- - Sorts credentials in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/CredentialsFilters' - - description: >- - Filters credentials by the `nameFilter` pattern. The pattern can - match any credentials parameter. To substitute one or more - characters, use the asterisk (*) character at the beginning and/or - at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/CredentialsFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/CredentialsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Credentials - description: >- - The HTTP GET request to the `/api/v1/credentials` path allows you to get - an array of credentials records that are added to the backup server. - operationId: GetAllCreds - summary: Get All Credentials - x-veeam-authorize: - claims: - - ViewCredentials - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/CredentialsSpec' - responses: - '200': - description: Account has been added. - schema: - $ref: '#/definitions/CredentialsModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Credentials - description: >- - The HTTP POST request to the `/api/v1/credentials` path allows you to - add a credentials record. - operationId: CreateCreds - summary: Add Credentials Record - x-veeam-authorize: - claims: - - CreateCredentials - '/api/v1/credentials/{id}': - delete: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the credentials record. - format: uuid - in: path - name: id - required: true - type: string - responses: - '204': - description: Credentials record has been removed. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Credentials - description: >- - The HTTP DELETE request to the `/api/v1/credentials/{id}` path allows - you to remove a credentials record that has the specified `id`. - operationId: DeleteCreds - summary: Remove Credentials Record - x-veeam-authorize: - claims: - - DeleteCredentials - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the credentials record. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/CredentialsModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Credentials - description: >- - The HTTP GET request to the `/api/v1/credentials/{id}` path allows you - to get a credentials record that has the specified `id`. - operationId: GetCreds - summary: Get Credentials Record - x-veeam-authorize: - claims: - - ViewCredentials - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the credentials record. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/CredentialsModel' - responses: - '200': - description: Credentials record has been updated. - schema: - $ref: '#/definitions/CredentialsModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Credentials - description: >- - The HTTP PUT request to the `/api/v1/credentials/{id}` path allows you - to edit a credentials record that has the specified `id`. - operationId: UpdateCreds - summary: Edit Credentials Record - x-veeam-authorize: - claims: - - UpdateCredentials - '/api/v1/credentials/{id}/changepassword': - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the credentials record. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/CredentialsPasswordChangeSpec' - responses: - '200': - description: Password has been changed. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Credentials - description: >- - The HTTP POST request to the `/api/v1/credentials/{id}/changepassword` - path allows you to change a password of the credentials record that has - the specified `id`. - operationId: ChangePasswordForCreds - summary: Change Password - x-veeam-authorize: - claims: - - ChangeAccountPassword - '/api/v1/credentials/{id}/changeprivatekey': - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the credentials record. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/PrivateKeyChangeSpec' - responses: - '200': - description: Private key has been changed. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Credentials - description: >- - The HTTP POST request to the `/api/v1/credentials/{id}/changeprivatekey` - path allows you to change a Linux private key of the credentials record - that has the specified `id`. - operationId: ChangePrivateKeyForCreds - summary: Change Linux Private Key - x-veeam-authorize: - claims: - - ChangeLinuxPrivateKey - '/api/v1/credentials/{id}/changerootpassword': - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the credentials record. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/CredentialsPasswordChangeSpec' - responses: - '200': - description: Root password has been changed. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Credentials - description: >- - The HTTP POST request to the - `/api/v1/credentials/{id}/changerootpassword` path allows you to change - a Linux root password of the credentials record that has the specified - `id`. - operationId: ChangeRootPasswordForCreds - summary: Change Linux Root Password - x-veeam-authorize: - claims: - - ChangeLinuxRootPassword - /api/v1/encryptionPasswords: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of passwords to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/EncryptionPasswordsFilters' - - description: Maximum number of passwords to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/EncryptionPasswordsFilters' - - description: Sorts passwords by one of the password parameters. - enum: - - Hint - - ModificationTime - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/EncryptionPasswordsFilters' - - description: >- - Sorts passwords in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/EncryptionPasswordsFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/EncryptionPasswordsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Encryption - description: >- - The HTTP GET request to the `/api/v1/encryptionPasswords` path allows - you to get an array of all passwords that are used for data encryption. - operationId: GetAllEncryptionPasswords - summary: Get All Encryption Passwords - x-veeam-authorize: - claims: - - ViewEncryptionPasswords - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/EncryptionPasswordSpec' - responses: - '201': - description: Password has been added. - schema: - $ref: '#/definitions/EncryptionPasswordModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Encryption - description: >- - The HTTP POST request to the `/api/v1/encryptionPasswords` path allows - you to add an encryption password. - operationId: CreateEncryptionPassword - summary: Add Encryption Password - x-veeam-authorize: - claims: - - CreateEncryptionPasswords - '/api/v1/encryptionPasswords/{id}': - delete: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the encryption password. - format: uuid - in: path - name: id - required: true - type: string - responses: - '204': - description: Password has been removed. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Encryption - description: >- - The HTTP DELETE request to the `/api/v1/encryptionPasswords/{id}` path - allows you to remove an encryption password that has the specified `id`. - operationId: DeleteEncryptionPassword - summary: Remove Encryption Password - x-veeam-authorize: - claims: - - DeleteEncryptionPasswords - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the encryption password. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/EncryptionPasswordModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Encryption - description: >- - The HTTP GET request to the `/api/v1/encryptionPasswords/{id}` path - allows you to get an encryption password that has the specified `id`. - operationId: GetEncryptionPassword - summary: Get Encryption Password - x-veeam-authorize: - claims: - - ViewEncryptionPasswords - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the encryption password. - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/EncryptionPasswordModel' - responses: - '200': - description: Password has been updated. - schema: - $ref: '#/definitions/EncryptionPasswordModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Encryption - description: >- - The HTTP PUT request to the `/api/v1/encryptionPasswords/{id}` path - allows you to edit an encryption password that has the specified `id`. - operationId: UpdateEncryptionPassword - summary: Edit Encryption Password - x-veeam-authorize: - claims: - - UpdateEncryptionPasswords - /api/v1/generalOptions: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/GeneralOptionsModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - General Options - description: >- - The HTTP GET request to the `/api/v1/generalOptions` path allows you to - get general options of Veeam Backup & Replication. - operationId: GetGeneralOptions - summary: Get General Options - x-veeam-authorize: - claims: - - ViewGeneralOptions - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/GeneralOptionsModel' - responses: - '200': - description: General options have been updated. - schema: - $ref: '#/definitions/GeneralOptionsModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - General Options - description: >- - The HTTP PUT request to the `/api/v1/generalOptions` path allows you to - edit general options of Veeam Backup & Replication. - operationId: UpdateGeneralOptions - summary: Edit General Options - x-veeam-authorize: - claims: - - UpdateGeneralOptions - /api/v1/inventory/vmware/hosts: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of VMware vSphere servers to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/ViRootFilters' - - description: Maximum number of VMware vSphere servers to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/ViRootFilters' - - description: >- - Sorts VMware vSphere servers by one of the VMware vSphere server - parameters. - enum: - - Name - - Type - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/ViRootFilters' - - description: >- - Sorts VMware vSphere servers in the ascending order by the - `orderColumn` parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/ViRootFilters' - - description: >- - Filters VMware vSphere servers by the `nameFilter` pattern. The - pattern can match any VMware vSphere server parameter. To substitute - one or more characters, use the asterisk (*) character at the - beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ViRootFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ViRootsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Inventory Browser - description: >- - The HTTP GET request to the `/api/v1/inventory/vmware/hosts` path allows - you to get an array of all VMware vSphere servers added to the backup - infrastructure. - operationId: GetAllInventoryVmwareHosts - summary: Get All VMware vSphere Servers - x-veeam-authorize: - claims: - - ViewViHierarchy - '/api/v1/inventory/vmware/hosts/{name}': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Name of the VMware vSphere server. - in: path - name: name - required: true - type: string - - description: Number of objects to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - - description: Maximum number of objects to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - - description: Sorts objects by one of the object parameters. - enum: - - Name - - ObjectId - - Type - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - - description: Sorts objects in the ascending order by the `orderColumn` parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - - description: Filters objects by object ID. - in: query - name: objectIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - - description: Filters objects by hierarchy type. - enum: - - HostsAndClusters - - DatastoresAndVms - - HostsAndDatastores - - VmsAndTemplates - - VmsAndTags - in: query - name: hierarchyTypeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - - description: >- - Filters objects by the `nameFilter` pattern. The pattern can match - any object parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - - description: Filters objects by virtual infrastructure type. - enum: - - Unknown - - VirtualMachine - - vCenterServer - - Datacenter - - Cluster - - Host - - ResourcePool - - Folder - - Datastore - - DatastoreCluster - - StoragePolicy - - Template - - ComputeResource - - VirtualApp - - Tag - - Category - - Multitag - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - - description: Filters objects by name of the parent container. - in: query - name: parentContainerNameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/VCenterInventoryFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/VCenterInventoryResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Inventory Browser - description: >- - The HTTP GET request to the `/api/v1/inventory/vmware/hosts/{name}` path - allows you to get an array of virtual infrastructure objects of the - VMware vSphere server that has the specified `name`. - operationId: GetVmwareHostObject - summary: Get VMware vSphere Server Objects - x-veeam-authorize: - claims: - - ViewViHierarchy - /api/v1/jobs: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of jobs to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/JobsFilters' - - description: Maximum number of jobs to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/JobsFilters' - - description: Sorts jobs by one of the job parameters. - enum: - - Name - - Type - - Description - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/JobsFilters' - - description: Sorts jobs in the ascending order by the `orderColumn` parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/JobsFilters' - - description: >- - Filters jobs by the `nameFilter` pattern. The pattern can match any - job parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobsFilters' - - description: Filters jobs by job type. - enum: - - Backup - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobsFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/JobsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP GET request to the `/api/v1/jobs` path allows you to get an - array of all jobs coordinated by the backup server. - operationId: GetAllJobs - summary: Get All Jobs - x-veeam-authorize: - claims: - - ViewJobs - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/JobSpec' - responses: - '201': - description: Job has been created. - schema: - $ref: '#/definitions/JobModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP POST request to the `/api/v1/jobs` path allows you to create a - new job that has the specified parameters. - operationId: CreateJob - summary: Create Job - x-veeam-authorize: - claims: - - CreateJobs - /api/v1/jobs/states: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of job states to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Maximum number of job states to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Sorts job states by one of the state parameters. - enum: - - Name - - Type - - Status - - LastRun - - LastResult - - NextRun - - Description - - RepositoryId - - ObjectsCount - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: >- - Sorts job states in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Filters job states by job ID. - format: uuid - in: query - name: idFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: >- - Filters job states by the `nameFilter` pattern. The pattern can - match any state parameter. To substitute one or more characters, use - the asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Filters job states by job type. - enum: - - Backup - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Filters job states by status with which jobs must finish. - enum: - - None - - Success - - Warning - - Failed - in: query - name: lastResultFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Filters job states by current status of the job. - enum: - - running - - inactive - - disabled - in: query - name: statusFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Filters job states by workloads that jobs must process. - enum: - - application - - cloudVm - - file - - server - - workstation - - vm - in: query - name: workloadFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: >- - Returns job states for jobs that have run after the specified date - and time. - format: date-time - in: query - name: lastRunAfterFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: >- - Returns job states for jobs that have not run after the specified - date and time. - format: date-time - in: query - name: lastRunBeforeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: 'If *true*, Returns job states for jobs with high priority.' - in: query - name: isHighPriorityJobFilter - type: boolean - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Filters job states by repository ID. - format: uuid - in: query - name: repositoryIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - - description: Filters job states by number of objects processed by the job. - in: query - name: objectsCountFilter - type: integer - x-veeam-spec: - $ref: '#/definitions/JobStatesFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/JobStatesResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP GET request to the `/api/v1/jobs/states` path allows you to get - an array of all job states. The states include brief job information - that you can also find under the **Jobs** node in the Veeam Backup & - Replication console. - operationId: GetAllJobsStates - summary: Get All Job States - x-veeam-authorize: - claims: - - ViewJobs - '/api/v1/jobs/{id}': - delete: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - format: uuid - in: path - name: id - required: true - type: string - responses: - '204': - description: Removed. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP DELETE request to the `/api/v1/jobs/{id}` path allows you to - delete a job that has the specified `id`. - operationId: DeleteJob - summary: Delete Job - x-veeam-authorize: - claims: - - DeleteJobs - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/JobModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP GET request to the `/api/v1/jobs/{id}` path allows you to get a - job that has the specified `id`. - operationId: GetJob - summary: Get Job - x-veeam-authorize: - claims: - - ViewJobs - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/JobModel' - responses: - '200': - description: Job has been updated. - schema: - $ref: '#/definitions/JobModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP PUT request to the `/api/v1/jobs/{id}` path allows you to edit - a job that has the specified `id`. - operationId: UpdateJob - summary: Edit Job - x-veeam-authorize: - claims: - - UpdateJobs - '/api/v1/jobs/{id}/disable': - post: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: Job has been disabled. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP POST request to the `/api/v1/jobs/{id}/disable` path allows you - to disable a job that has the specified `id`. - operationId: DisableJob - summary: Disable Job - x-veeam-authorize: - claims: - - DisableJobs - '/api/v1/jobs/{id}/enable': - post: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: Job has been enabled. - schema: - $ref: '#/definitions/EmptySuccessResponse' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP POST request to the `/api/v1/jobs/{id}/enable` path allows you - to enable a job that has the specified `id`. - operationId: EnableJob - summary: Enable Job - x-veeam-authorize: - claims: - - EnableJobs - '/api/v1/jobs/{id}/start': - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: false - schema: - $ref: '#/definitions/JobStartSpec' - responses: - '201': - description: Job session has been started. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP POST request to the `/api/v1/jobs/{id}/start` path allows you - to start a job that has the specified `id`. - operationId: StartJob - summary: Start Job - x-veeam-authorize: - claims: - - StartJobs - '/api/v1/jobs/{id}/stop': - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - format: uuid - in: path - name: id - required: true - type: string - - in: body - name: body - required: false - schema: - $ref: '#/definitions/JobStopSpec' - responses: - '201': - description: Job session has been stopped. - schema: - $ref: '#/definitions/SessionModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Jobs - description: >- - The HTTP POST request to the `/api/v1/jobs/{id}/stop` path allows you to - stop a job that has the specified `id`. - operationId: StopJob - summary: Stop Job - x-veeam-authorize: - claims: - - StopJobs - /api/v1/objectRestorePoints: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of restore points to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: Maximum number of restore points to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: Sorts restore points by one of the restore point parameters. - enum: - - CreationTime - - PlatformId - - BackupId - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: >- - Sorts restore points in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: >- - Returns restore points that are created after the specified date and - time. - format: date-time - in: query - name: createdAfterFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: >- - Returns restore points that are created before the specified date - and time. - format: date-time - in: query - name: createdBeforeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: >- - Filters restore points by the `nameFilter` pattern. The pattern can - match any restore point parameter. To substitute one or more - characters, use the asterisk (*) character at the beginning and/or - at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: Filters restore points by name of the backup object platform. - enum: - - VmWare - - HyperV - - Vcd - - WindowsPhysical - - LinuxPhysical - - Tape - - NasBackup - - CustomPlatform - in: query - name: platformNameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: Filters restore points by ID of the backup object platform. - format: uuid - in: query - name: platformIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: Filters restore points by backup ID. - format: uuid - in: query - name: backupIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - - description: Filters restore points by backup object ID. - format: uuid - in: query - name: backupObjectIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ObjectRestorePointsFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ObjectRestorePointsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Object Restore Points - description: >- - The HTTP GET request to the `/api/v1/objectRestorePoints` path allows - you to get an array of all restore points created on the backup server. - operationId: GetAllObjectRestorePoints - summary: Get All Restore Points - x-veeam-authorize: - claims: - - ViewRestorePoints - '/api/v1/objectRestorePoints/{id}': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the restore point. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ObjectRestorePointModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Object Restore Points - description: >- - The HTTP GET request to the `/api/v1/objectRestorePoints/{id}` path - allows you to get a restore point that has the specified `id`. - operationId: GetObjectRestorePoint - summary: Get Restore Point - x-veeam-authorize: - claims: - - ViewRestorePoints - '/api/v1/objectRestorePoints/{id}/disks': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: ID of the restore point. - format: uuid - in: path - name: id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ObjectRestorePointDisksResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Object Restore Points - description: >- - The HTTP GET request to the `/api/v1/objectRestorePoints/{id}/disks` - path allows you to get an array of disks from a restore point that has - the specified `id`. - operationId: GetObjectRestorePointDisks - summary: Get Restore Point Disks - x-veeam-authorize: - claims: - - ViewRestorePointDisks - /api/v1/restore/instantRecovery/vmware/fcd/: - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/VmwareFcdInstantRecoverySpec' - responses: - '201': - description: Instant FCD Recovery has been started. - schema: - $ref: '#/definitions/VmwareFcdInstantRecoveryMount' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Restore - description: >- - The HTTP POST request to the - `/api/v1/restore/instantRecovery/vmware/fcd/` path allows you to start - Instant FCD Recovery from the specified restore point to the specified - cluster. For details on how to get a cluster model, see [Get VMware - vSphere Server Objects](#operation/GetVmwareHostObject). - operationId: InstantRecoveryVmwareFcdMount - summary: Start Instant FCD Recovery - x-veeam-authorize: - claims: - - StartFCDInstantRecovery - '/api/v1/restore/instantRecovery/vmware/fcd/{mountId}': - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Mount ID. - format: uuid - in: path - name: mountId - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/VmwareFcdInstantRecoveryMount' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Restore - description: >- - The HTTP GET request to the - `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}` path allows you - to get information about the mounted vPower NFS datastore, such as - restore session ID, mount state, instant recovery settings and disks - that will be recovered. - operationId: GetVmwareFcdInstantRecoveryMountModel - summary: Get Mount Information - x-veeam-authorize: - claims: - - ViewIRMountedDisks - '/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount': - post: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Mount ID. - format: uuid - in: path - name: mountId - required: true - type: string - responses: - '200': - description: Disks has been unmounted. - schema: - $ref: '#/definitions/VmwareFcdInstantRecoveryMount' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Restore - description: >- - The HTTP POST request to the - `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/dismount` path - allows you to stop publishing the recovered FCDs and remove the disks - from the datastore. - operationId: InstantRecoveryVmwareFcdDismount - summary: Stop FCD Publishing - x-veeam-authorize: - claims: - - DismountIRDisks - '/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate': - post: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Mount ID. - format: uuid - in: path - name: mountId - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/VmwareFcdQuickMigrationSpec' - responses: - '200': - description: FCD Migration has been started. - schema: - $ref: '#/definitions/VmwareFcdInstantRecoveryMount' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Restore - description: >- - The HTTP POST request to the - `/api/v1/restore/instantRecovery/vmware/fcd/{mountId}/migrate` path - allows you to start migration of FCDs from the specified mount. - operationId: InstantRecoveryVmwareFcdMigrate - summary: Start FCD Migration - x-veeam-authorize: - claims: - - MigrateIRMountedDisks - /api/v1/serverCertificate: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/CertificateModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - security: [] - tags: - - Service - description: >- - The HTTP GET request to the `/api/v1/serverCertificate` path allows you - to get a certificate of the backup server. - operationId: GetServerCertificate - summary: Get Server Certificate - /api/v1/serverTime: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ServerTimeModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - security: [] - tags: - - Service - description: >- - The HTTP GET request to the `/api/v1/serverTime` path allows you to get - current date and time on the backup server. - operationId: GetServerTime - summary: Get Server Time - /api/v1/services: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of services to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/ServicesFilters' - - description: Maximum number of services to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/ServicesFilters' - - description: Sorts services by one of the service parameters. - enum: - - Name - - Port - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/ServicesFilters' - - description: >- - Sorts services in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/ServicesFilters' - - description: >- - Filters services by the `nameFilter` pattern. The pattern can match - any service parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/ServicesFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/ServicesResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Services - description: >- - The HTTP GET request to the `/api/v1/services` path allows you to get - associated services for integration with Veeam Backup & Replication. - operationId: GetAllServices - summary: Get Associated Services - x-veeam-authorize: - claims: - - ViewServices - /api/v1/sessions: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - description: Number of sessions to skip. - format: int32 - in: query - name: skip - type: integer - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Maximum number of sessions to return. - format: int32 - in: query - name: limit - type: integer - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Sorts sessions by one of the session parameters. - enum: - - Name - - SessionType - - CreationTime - - EndTime - - State - - Result - in: query - name: orderColumn - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Sorts sessions in the ascending order by the `orderColumn` - parameter. - in: query - name: orderAsc - type: boolean - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Filters sessions by the `nameFilter` pattern. The pattern can match - any session parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - in: query - name: nameFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Returns sessions that are created after the specified date and time. - format: date-time - in: query - name: createdAfterFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Returns sessions that are created before the specified date and - time. - format: date-time - in: query - name: createdBeforeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Returns sessions that are finished after the specified date and - time. - format: date-time - in: query - name: endedAfterFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: >- - Returns sessions that are finished before the specified date and - time. - format: date-time - in: query - name: endedBeforeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Filters sessions by session type. - enum: - - Infrastructure - - Job - - Automation - - ConfigurationBackup - - RepositoryMaintenance - - RepositoryEvacuate - - InfrastructureItemDeletion - in: query - name: typeFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Filters sessions by session state. - enum: - - Stopped - - Starting - - Stopping - - Working - - Pausing - - Resuming - - WaitingTape - - Idle - - Postprocessing - - WaitingRepository - - WaitingSlot - in: query - name: stateFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Filters sessions by session result. - enum: - - None - - Success - - Warning - - Failed - in: query - name: resultFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - - description: Filters sessions by job ID. - format: uuid - in: query - name: jobIdFilter - type: string - x-veeam-spec: - $ref: '#/definitions/SessionsFilters' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/SessionsResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Sessions - description: >- - The HTTP GET request to the `/api/v1/sessions` path allows you to get an - array of sessions performed on the backup server. - operationId: GetAllSessions - summary: Get All Sessions - x-veeam-authorize: - claims: - - ViewSessions - '/api/v1/sessions/{id}': - get: - produces: - - application/json - parameters: - - description: ID of the session. - format: uuid - in: path - name: id - required: true - type: string - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/SessionModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Sessions - description: >- - The HTTP GET request to the `/api/v1/sessions/{id}` path allows you to - get a session that has the specified `id`. - operationId: GetSession - summary: Get Session - x-veeam-authorize: - claims: - - ViewSessions - '/api/v1/sessions/{id}/logs': - get: - produces: - - application/json - parameters: - - description: ID of the session. - format: uuid - in: path - name: id - required: true - type: string - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/SessionLogResult' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Sessions - description: >- - The HTTP GET request to the `/api/v1/sessions/{id}/logs` path allows you - to get an array of log records of a session that has the specified `id`. - operationId: GetSessionLogs - summary: Get Session Logs - x-veeam-authorize: - claims: - - ViewSessions - '/api/v1/sessions/{id}/stop': - post: - produces: - - application/json - parameters: - - description: ID of the session. - format: uuid - in: path - name: id - required: true - type: string - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/EmptySuccessResponse' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '404': - description: >- - Not found. No object was found with the path parameter specified in - the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Sessions - description: >- - The HTTP POST request to the `/api/v1/sessions/{id}/stop` path allows - you to stop a session that has the specified `id`. - operationId: StopSession - summary: Stop Session - x-veeam-authorize: - claims: - - StopSessions - /api/v1/trafficRules: - get: - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/GlobalNetworkTrafficRulesModel' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Traffic Rules - description: >- - The HTTP GET request to the `/api/v1/trafficRules` path allows you to - get network traffic rules that control traffic transferred between - backup infrastructure components. - operationId: GetAllTrafficRules - summary: Get Traffic Rules - x-veeam-authorize: - claims: - - ViewTrafficRules - put: - consumes: - - application/json - produces: - - application/json - parameters: - - default: 1.0-rev1 - description: > - Version and revision of the client REST API. Must be in the - following - - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - - in: body - name: body - required: true - schema: - $ref: '#/definitions/GlobalNetworkTrafficRulesModel' - responses: - '201': - description: >- - Infrastructure session has been created to edit the traffic rules. - To check the progress, track the session `state`. - schema: - $ref: '#/definitions/GlobalNetworkTrafficRulesModel' - '400': - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - schema: - $ref: '#/definitions/Error' - '401': - description: >- - Unauthorized. The authorization header has been expected but not - found (or found but is expired). - schema: - $ref: '#/definitions/Error' - '403': - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - schema: - $ref: '#/definitions/Error' - '500': - description: >- - Internal server error. The request has been received but could not - be completed because of an internal error at the server side. - schema: - $ref: '#/definitions/Error' - tags: - - Traffic Rules - description: >- - The HTTP PUT request to the `/api/v1/trafficRules` path allows you to - edit network traffic rules that are configured on the backup server. - operationId: UpdateTrafficRules - summary: Edit Traffic Rules - x-veeam-authorize: - claims: - - UpdateTrafficRules -definitions: - ActiveFullSettingsModel: - description: Active full backup settings. - properties: - isEnabled: - description: 'If *true*, active full backups are enabled.' - type: boolean - monthly: - $ref: '#/definitions/AdvancedStorageScheduleMonthlyModel' - weekly: - $ref: '#/definitions/AdvancedStorageScheduleWeeklyModel' - required: - - isEnabled - type: object - AdvancedSmtpOptionsModel: - description: advanced global email notification settings. - properties: - SSLEnabled: - description: 'If *true*, secure connection for email operations is used.' - type: boolean - authRequred: - description: >- - If *true*, the `credentialsId` credentials are used to connect to the - SMTP server. - type: boolean - credentialsId: - description: ID of the credentials used to connect to the server. - format: uuid - type: string - port: - description: Port number for the SMTP server. - format: int32 - type: integer - timeoutMs: - description: Connection timeout for the SMTP server. - format: int32 - type: integer - required: - - port - - timeoutMs - - SSLEnabled - - authRequred - type: object - AdvancedStorageScheduleMonthlyModel: - description: Monthly schedule settings. - properties: - dayNumberInMonth: - $ref: '#/definitions/EDayNumberInMonth' - dayOfMonths: - description: Day of the month when the operation is performed. - type: integer - dayOfWeek: - $ref: '#/definitions/EDayOfWeek' - isEnabled: - description: 'If *true*, the monthly schedule is enabled.' - type: boolean - months: - description: Months when the operation is performed. - items: - $ref: '#/definitions/EMonth' - type: array - uniqueItems: true - required: - - isEnabled - type: object - AdvancedStorageScheduleWeeklyModel: - description: Weekly schedule settings. - properties: - days: - description: Days of the week when the operation is performed. - items: - $ref: '#/definitions/EDayOfWeek' - type: array - uniqueItems: true - isEnabled: - default: false - description: 'If *true*, the weekly schedule is enabled.' - type: boolean - required: - - isEnabled - type: object - ArchiveTierAdvancedSettingsModel: - description: Advanced settings of the archive tier. - properties: - archiveDeduplicationEnabled: - description: 'If *true*, each backup is stored as a delta to the previous one.' - type: boolean - costOptimizedArchiveEnabled: - description: >- - If *true*, backups are archived if the remaining retention time is - above minimum storage period for the repository. - type: boolean - type: object - ArchiveTierModel: - description: Archive tier. - properties: - advancedSettings: - $ref: '#/definitions/ArchiveTierAdvancedSettingsModel' - archivePeriodDays: - description: >- - Number of days after which backup chains on the capacity extent are - moved to the archive extent. Specify *0* to offload inactive backup - chains on the same day they are created. - type: integer - extentId: - description: ID of an object storage repository added as an archive extent. - format: uuid - type: string - isEnabled: - description: 'If *true*, the archive tier is enabled.' - type: boolean - required: - - isEnabled - type: object - AuthorizationCodeModel: - properties: - code: - description: >- - String that is used to obtain an access token. Lifetime of the - authorization code is 60 seconds. - type: string - required: - - code - type: object - BackupApplicationAwareProcessingImportModel: - description: Application-aware processing settings. - properties: - appSettings: - description: Array of VMware objects and their application settings. - items: - $ref: '#/definitions/BackupApplicationSettingsImportModel' - type: array - isEnabled: - description: 'If *true*, application-aware processing is enabled.' - type: boolean - required: - - isEnabled - type: object - BackupApplicationAwareProcessingModel: - description: Application-aware processing settings. - properties: - appSettings: - description: Array of VMware objects and their application settings. - items: - $ref: '#/definitions/BackupApplicationSettingsModel' - type: array - isEnabled: - description: 'If *true*, application-aware processing is enabled.' - type: boolean - required: - - isEnabled - type: object - BackupApplicationSettingsImportModel: - properties: - exclusions: - $ref: '#/definitions/BackupFSExclusionsModel' - oracle: - $ref: '#/definitions/BackupOracleSettingsImportModel' - scripts: - $ref: '#/definitions/BackupScriptSettingsModel' - sql: - $ref: '#/definitions/BackupSQLSettingsImportModel' - transactionLogs: - $ref: '#/definitions/ETransactionLogsSettings' - usePersistentGuestAgent: - description: 'If *true*, persistent guest agent is used.' - type: boolean - vmObject: - $ref: '#/definitions/VmwareObjectModel' - vss: - $ref: '#/definitions/EApplicationSettingsVSS' - required: - - vmObject - - vss - type: object - BackupApplicationSettingsModel: - properties: - exclusions: - $ref: '#/definitions/BackupFSExclusionsModel' - oracle: - $ref: '#/definitions/BackupOracleSettingsModel' - scripts: - $ref: '#/definitions/BackupScriptSettingsModel' - sql: - $ref: '#/definitions/BackupSQLSettingsModel' - transactionLogs: - $ref: '#/definitions/ETransactionLogsSettings' - usePersistentGuestAgent: - description: 'If *true*, persistent guest agent is used.' - type: boolean - vmObject: - $ref: '#/definitions/VmwareObjectModel' - vss: - $ref: '#/definitions/EApplicationSettingsVSS' - required: - - vmObject - - vss - type: object - BackupFSExclusionsModel: - description: VM guest OS file exclusion. - properties: - exclusionPolicy: - $ref: '#/definitions/EBackupExclusionPolicy' - itemsList: - description: >- - Array of files and folders. Full paths to files and folders, - environmental variables and file masks with the asterisk (*) and - question mark (?) characters can be used. - items: - type: string - type: array - required: - - exclusionPolicy - type: object - BackupHealthCheckSettingsModels: - description: >- - Health check settings for the for the latest restore point in the backup - chain. - properties: - isEnabled: - description: 'If *true*, the health check is enabled.' - type: boolean - monthly: - $ref: '#/definitions/AdvancedStorageScheduleMonthlyModel' - weekly: - $ref: '#/definitions/AdvancedStorageScheduleWeeklyModel' - required: - - isEnabled - type: object - BackupIndexingSettingsModel: - properties: - LinuxIndexing: - $ref: '#/definitions/BackupObjectIndexingModel' - WindowsIndexing: - $ref: '#/definitions/BackupObjectIndexingModel' - vmObject: - $ref: '#/definitions/VmwareObjectModel' - required: - - vmObject - type: object - BackupJobAdvancedSettingsModel: - description: Advanced settings of the backup job. - properties: - activeFulls: - $ref: '#/definitions/ActiveFullSettingsModel' - backupHealth: - $ref: '#/definitions/BackupHealthCheckSettingsModels' - backupModeType: - $ref: '#/definitions/EBackupModeType' - fullBackupMaintenance: - $ref: '#/definitions/FullBackupMaintenanceModel' - notifications: - $ref: '#/definitions/NotificationSettingsModel' - scripts: - $ref: '#/definitions/JobScriptsSettingsModel' - storageData: - $ref: '#/definitions/BackupStorageSettingModel' - storageIntegration: - $ref: '#/definitions/PrimaryStorageIntegrationSettingsModel' - synthenticFulls: - $ref: '#/definitions/SyntheticFullSettingsModel' - vSphere: - $ref: '#/definitions/BackupJobAdvancedSettingsVSphereModel' - required: - - backupModeType - type: object - BackupJobAdvancedSettingsVSphereModel: - description: VMware vSphere settings for the backup job. - properties: - changedBlockTracking: - $ref: '#/definitions/VSphereChangedBlockTrackingSettingsModel' - enableVMWareToolsQuiescence: - description: >- - If *true*, VMware Tools quiescence is enabled for freezing the VM file - system and application data. - type: boolean - type: object - BackupJobExclusions: - properties: - disks: - description: Array of VM disks excluded from the backup. - items: - $ref: '#/definitions/VmwareObjectDiskModel' - type: array - templates: - $ref: '#/definitions/BackupJobExclusionsTemplates' - description: Array of VM templates excluded from the backup. OUTSIDE - vms: - description: Array of VMs excluded from the backup. - items: - $ref: '#/definitions/VmwareObjectSizeModel' - type: array - type: object - BackupJobExclusionsSpec: - properties: - disks: - items: - $ref: '#/definitions/VmwareObjectDiskModel' - type: array - templates: - $ref: '#/definitions/BackupJobExclusionsTemplates' - vms: - items: - $ref: '#/definitions/VmwareObjectModel' - type: array - type: object - BackupJobExclusionsTemplates: - description: Array of VM templates excluded from the backup. - properties: - excludeFromIncremental: - description: 'If *true*, the template is excluded from the incremental backup.' - type: boolean - isEnabled: - description: 'If *true*, the template is included into the backup.' - type: boolean - type: object - BackupJobGuestProcessingImportModel: - description: Guest processing settings. - properties: - applicationAwareProcessing: - $ref: '#/definitions/BackupApplicationAwareProcessingImportModel' - guestCredentials: - $ref: '#/definitions/GuestOsCredentialsImportModel' - guestFileSystemIndexing: - $ref: '#/definitions/GuestFileSystemIndexingModel' - guestInteractionProxies: - $ref: '#/definitions/GuestInteractionProxiesSettingsImportModel' - required: - - applicationAwareProcessing - - guestFileSystemIndexing - type: object - BackupJobGuestProcessingModel: - description: Guest processing settings. - properties: - appAwareProcessing: - $ref: '#/definitions/BackupApplicationAwareProcessingModel' - guestCredentials: - $ref: '#/definitions/GuestOsCredentialsModel' - guestFSIndexing: - $ref: '#/definitions/GuestFileSystemIndexingModel' - guestInteractionProxies: - $ref: '#/definitions/GuestInteractionProxiesSettingsModel' - required: - - appAwareProcessing - - guestFSIndexing - type: object - BackupJobImportProxiesModel: - description: Backup proxies. - properties: - automaticSelection: - default: true - description: 'If *true*, backup proxies are detected and assigned automatically.' - type: boolean - proxies: - description: Array of backup proxies. - items: - $ref: '#/definitions/BackupProxyImportModel' - type: array - required: - - automaticSelection - type: object - BackupJobModel: - allOf: - - $ref: '#/definitions/JobModel' - - properties: - guestProcessing: - $ref: '#/definitions/BackupJobGuestProcessingModel' - isHighPriority: - description: >- - If *true*, the job has a high priority in getting backup - infrastructure resources. - type: boolean - schedule: - $ref: '#/definitions/BackupScheduleModel' - storage: - $ref: '#/definitions/BackupJobStorageModel' - virtualMachines: - $ref: '#/definitions/BackupJobVirtualMachinesModel' - required: - - guestProcessing - - isHighPriority - - schedule - - storage - - virtualMachines - type: object - BackupJobRetentionPolicySettingsModel: - description: Retention policy settings. - properties: - quantity: - description: Number of restore points or days to keep. - type: integer - type: - $ref: '#/definitions/ERetentionPolicyType' - required: - - quantity - - type - type: object - BackupJobSpec: - allOf: - - $ref: '#/definitions/JobSpec' - - properties: - guestProcessing: - $ref: '#/definitions/BackupJobGuestProcessingModel' - isHighPriority: - default: false - description: >- - If *true*, the job has a high priority in getting backup - infrastructure resources. - type: boolean - schedule: - $ref: '#/definitions/BackupScheduleModel' - storage: - $ref: '#/definitions/BackupJobStorageModel' - virtualMachines: - $ref: '#/definitions/BackupJobVirtualMachinesSpec' - required: - - guestProcessing - - isHighPriority - - schedule - - storage - - virtualMachines - type: object - BackupJobStorageImportModel: - description: Backup storage settings. - properties: - advancedSettings: - $ref: '#/definitions/BackupJobAdvancedSettingsModel' - backupProxies: - $ref: '#/definitions/BackupJobImportProxiesModel' - backupRepository: - $ref: '#/definitions/BackupRepositoryImportModel' - gfsPolicy: - $ref: '#/definitions/GFSPolicySettingsModel' - retentionPolicy: - $ref: '#/definitions/BackupJobRetentionPolicySettingsModel' - required: - - backupProxies - - backupRepository - - retentionPolicy - type: object - BackupJobStorageModel: - description: Backup storage settings. - properties: - advancedSettings: - $ref: '#/definitions/BackupJobAdvancedSettingsModel' - backupProxies: - $ref: '#/definitions/BackupProxiesSettingsModel' - backupRepositoryId: - description: ID of the backup repository. - format: uuid - type: string - gfsPolicy: - $ref: '#/definitions/GFSPolicySettingsModel' - retentionPolicy: - $ref: '#/definitions/BackupJobRetentionPolicySettingsModel' - required: - - backupProxies - - backupRepositoryId - - retentionPolicy - type: object - BackupJobVirtualMachinesModel: - properties: - excludes: - $ref: '#/definitions/BackupJobExclusions' - includes: - description: Array of VM and VM containers processed by the job. - items: - $ref: '#/definitions/VmwareObjectSizeModel' - type: array - required: - - includes - type: object - BackupJobVirtualMachinesSpec: - properties: - excludes: - $ref: '#/definitions/BackupJobExclusionsSpec' - includes: - items: - $ref: '#/definitions/VmwareObjectModel' - type: array - required: - - includes - type: object - BackupLinuxScriptModel: - description: Paths to pre-freeze and post-thaw scripts for Linux VMs. - properties: - postThawScript: - description: Path to a post-thaw script. - type: string - preFreezeScript: - description: Path to a pre-freeze script. - type: string - type: object - BackupLogShippingServersImportModel: - description: Log shipping server used to transport logs. - properties: - autoSelection: - description: >- - If *true*, Veeam Backup & Replication chooses an optimal log shipping - server automatically. - type: boolean - shippingServerNames: - description: Array of servers that are explicitly selected for log shipping. - items: - type: string - type: array - required: - - autoSelection - type: object - BackupLogShippingServersModel: - description: Log shipping server used to transport logs. - properties: - autoSelection: - description: >- - If *true*, Veeam Backup & Replication chooses an optimal log shipping - server automatically. - type: boolean - shippingServerIds: - description: Array of servers that are explicitly selected for log shipping. - items: - format: uuid - type: string - type: array - required: - - autoSelection - type: object - BackupModel: - properties: - creationTime: - description: Date and time when the backup was created. - format: date-time - type: string - id: - description: ID of the backup. - format: uuid - type: string - jobId: - description: ID of the job that created the backup. - format: uuid - type: string - name: - description: Name of the job that created the backup. - type: string - platformId: - description: ID of the platform of the backup resource. - format: uuid - type: string - platformName: - $ref: '#/definitions/EPlatformType' - policyTag: - description: Tag that identifies retention policy. - type: string - repositoryId: - description: ID of the backup repository where the backup is stored. - format: uuid - type: string - required: - - id - - name - - platformName - - platformId - - creationTime - - repositoryId - type: object - BackupObjectIndexingModel: - description: Guest OS indexing options for the VM. - properties: - guestFSIndexingMode: - $ref: '#/definitions/EGuestFSIndexingMode' - indexingList: - description: >- - Array of folders. Environmental variables and full paths to folders - can be used. - items: - type: string - type: array - required: - - guestFSIndexingMode - type: object - BackupObjectModel: - properties: - id: - description: ID of the object. - format: uuid - type: string - name: - description: Name of the object. - type: string - platformId: - description: Id of the platform where the object was created. - format: uuid - type: string - platformName: - $ref: '#/definitions/EPlatformType' - restorePointsCount: - description: Number of restore points. - type: integer - type: - description: Type of the object. - type: string - required: - - id - - platformName - type: object - BackupObjectsFilters: - properties: - limit: - format: int32 - type: integer - nameFilter: - type: string - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/EBackupObjectsFiltersOrderColumn' - platformIdFilter: - format: uuid - type: string - platformNameFilter: - $ref: '#/definitions/EPlatformType' - skip: - format: int32 - type: integer - typeFilter: - type: string - viTypeFilter: - type: string - type: object - BackupObjectsResult: - properties: - data: - description: Array of backup objects. - items: - $ref: '#/definitions/BackupObjectModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - BackupOracleSettingsImportModel: - description: Oracle archived log settings. - properties: - archiveLogs: - $ref: '#/definitions/EBackupOracleLogsSettings' - backupLogs: - description: 'If *true*, archived logs are backed up.' - type: boolean - backupMinsCount: - description: 'Frequency of archived log backup, in minutes.' - type: integer - credentials: - $ref: '#/definitions/CredentialsImportModel' - deleteGBsCount: - description: >- - Maximum size for archived logs in GB. This parameter should be - specified if the `EBackupOracleLogsSettings` value is - *deleteExpiredGBs*. - type: integer - deleteHoursCount: - description: >- - Time period in hours to keep archived logs. This parameter should be - specified if the `EBackupOracleLogsSettings` value is - *deleteExpiredHours*. - type: integer - keepDaysCount: - description: Number of days to keep archived logs. - type: integer - logShippingServers: - $ref: '#/definitions/BackupLogShippingServersImportModel' - retainLogBackups: - $ref: '#/definitions/ERetainLogBackupsType' - useGuestCredentials: - description: >- - If *true*, Veeam Backup & Replication uses credentials specified in - the guest processing settings. - type: boolean - required: - - archiveLogs - - useGuestCredentials - type: object - BackupOracleSettingsModel: - description: Oracle archived log settings. - properties: - archiveLogs: - $ref: '#/definitions/EBackupOracleLogsSettings' - backupLogs: - description: 'If *true*, archived logs are backed up.' - type: boolean - backupMinsCount: - description: 'Frequency of archived log backup, in minutes.' - type: integer - credentialsId: - description: >- - ID of the credentials record that is used if `useGuestCredentials` is - *false*. - format: uuid - type: string - deleteGBsCount: - description: >- - Maximum size for archived logs in GB. This parameter should be - specified if the `EBackupOracleLogsSettings` value is - *deleteExpiredGBs*. - type: integer - deleteHoursCount: - description: >- - Time period in hours to keep archived logs. This parameter should be - specified if the `EBackupOracleLogsSettings` value is - *deleteExpiredHours*. - type: integer - keepDaysCount: - description: Number of days to keep archived logs. - type: integer - logShippingServers: - $ref: '#/definitions/BackupLogShippingServersModel' - retainLogBackups: - $ref: '#/definitions/ERetainLogBackupsType' - useGuestCredentials: - description: >- - If *true*, Veeam Backup & Replication uses credentials specified in - the guest processing settings. - type: boolean - required: - - archiveLogs - - useGuestCredentials - type: object - BackupPlacementSettingsModel: - description: Settings of the performance placement policy. - properties: - allowedBackups: - $ref: '#/definitions/EAllowedBackupsType' - extentName: - description: Name of a performance extent. - type: string - required: - - extentName - - allowedBackups - type: object - BackupProxiesSettingsModel: - description: Backup proxy settings. - properties: - autoSelection: - default: true - description: 'If *true*, backup proxies are detected and assigned automatically.' - type: boolean - proxyIds: - description: Array of proxy IDs. - items: - format: uuid - type: string - type: array - uniqueItems: true - required: - - autoSelection - type: object - BackupProxyImportModel: - properties: - name: - description: Name of the backup proxy. - type: string - tag: - description: Tag assigned to the backup proxy. - type: string - type: - $ref: '#/definitions/EBackupProxyImportType' - required: - - name - - type - type: object - BackupRepositoryImportModel: - description: Backup repository. - properties: - name: - description: Name of the backup repository. - type: string - tag: - description: Tag assigned to the backup repository. - type: string - required: - - name - type: object - BackupSQLSettingsImportModel: - description: Microsoft SQL Server transaction log settings. - properties: - backupMinsCount: - description: 'Frequency of transaction log backup, in minutes.' - type: integer - keepDaysCount: - description: Number of days to keep transaction logs in the backup repository. - type: integer - logShippingServers: - $ref: '#/definitions/BackupLogShippingServersImportModel' - logsProcessing: - $ref: '#/definitions/ESQLLogsProcessing' - retainLogBackups: - $ref: '#/definitions/ERetainLogBackupsType' - required: - - logsProcessing - type: object - BackupSQLSettingsModel: - description: Microsoft SQL Server transaction log settings. - properties: - backupMinsCount: - description: 'Frequency of transaction log backup, in minutes.' - type: integer - keepDaysCount: - description: Number of days to keep transaction logs in the backup repository. - type: integer - logShippingServers: - $ref: '#/definitions/BackupLogShippingServersModel' - logsProcessing: - $ref: '#/definitions/ESQLLogsProcessing' - retainLogBackups: - $ref: '#/definitions/ERetainLogBackupsType' - required: - - logsProcessing - type: object - BackupScheduleModel: - description: Job scheduling options. - properties: - afterThisJob: - $ref: '#/definitions/ScheduleAfterThisJobModel' - backupWindow: - $ref: '#/definitions/ScheduleBackupWindowModel' - continuously: - $ref: '#/definitions/ScheduleBackupWindowModel' - daily: - $ref: '#/definitions/ScheduleDailyModel' - monthly: - $ref: '#/definitions/ScheduleMonthlyModel' - periodically: - $ref: '#/definitions/SchedulePeriodicallyModel' - retry: - $ref: '#/definitions/ScheduleRetryModel' - runAutomatically: - default: false - description: 'If *true*, job scheduling is enabled.' - type: boolean - required: - - runAutomatically - type: object - BackupScriptSettingsModel: - description: Pre-freeze and post-thaw scripts. - properties: - linuxScripts: - $ref: '#/definitions/BackupLinuxScriptModel' - scriptProcessingMode: - $ref: '#/definitions/EBackupScriptProcessingMode' - windowsScripts: - $ref: '#/definitions/BackupWindowsScriptModel' - required: - - scriptProcessingMode - type: object - BackupStorageSettingModel: - description: Storage settings. - properties: - compressionLevel: - $ref: '#/definitions/ECompressionLevel' - enableInlineDataDedup: - description: >- - If *true*, Veeam Backup & Replication deduplicates VM data before - storing it in the backup repository. - type: boolean - encryption: - $ref: '#/definitions/BackupStorageSettingsEncryptionModel' - excludeDeletedFileBlocks: - description: >- - If *true*, Veeam Backup & Replication does not copy deleted file - blocks. - type: boolean - excludeSwapFileBlocks: - description: >- - If *true*, Veeam Backup & Replication excludes swap file blocks from - processing. - type: boolean - storageOptimization: - $ref: '#/definitions/EStorageOptimization' - type: object - BackupStorageSettingsEncryptionModel: - description: Encription of backup files. - properties: - encryptionPasswordIdOrNull: - description: >- - ID of the password used for encryption. The value is *null* for - exported objects. - format: uuid - type: string - encryptionPasswordTag: - description: Tag used to identify the password. - type: string - isEnabled: - description: 'If *true*, the content of backup files is encrypted.' - type: boolean - required: - - isEnabled - type: object - BackupWindowDayHoursModel: - description: Hourly scheme for a day. - properties: - day: - $ref: '#/definitions/EDayOfWeek' - hours: - description: | - String of hours in the following format: - *1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1* - where *1* means enabled, *0* means disabled. - type: string - required: - - day - - hours - type: object - BackupWindowSettingModel: - description: Time scheme. - properties: - days: - description: Array of per-day schemes. - items: - $ref: '#/definitions/BackupWindowDayHoursModel' - type: array - required: - - days - type: object - BackupWindowsScriptModel: - description: Paths to pre-freeze and post-thaw scripts for Microsoft Windows VMs. - properties: - postThawScript: - description: Path to a post-thaw script. - type: string - preFreezeScript: - description: Path to a pre-freeze script. - type: string - type: object - BackupsFilters: - properties: - createdAfterFilter: - format: date-time - type: string - createdBeforeFilter: - format: date-time - type: string - jobIdFilter: - format: uuid - type: string - limit: - format: int32 - type: integer - nameFilter: - type: string - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/EBackupsFiltersOrderColumn' - platformIdFilter: - format: uuid - type: string - policyTagFilter: - type: string - skip: - format: int32 - type: integer - type: object - BackupsResult: - properties: - data: - description: Array of backups. - items: - $ref: '#/definitions/BackupModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - CapacityTierModel: - description: Capacity tier. - properties: - copyPolicyEnabled: - description: >- - If *true*, Veeam Backup & Replication copies backups from the - performance extents to the capacity extent as soon as the backups are - created. - type: boolean - enabled: - description: 'If *true*, the capacity tier is enabled.' - type: boolean - encryption: - $ref: '#/definitions/BackupStorageSettingsEncryptionModel' - extentId: - description: ID of an object storage repository added as a capacity extent. - format: uuid - type: string - movePolicyEnabled: - description: >- - If *true*, Veeam Backup & Replication moves backup files that belong - to inactive backup chains from the performance extents to the capacity - extent. - type: boolean - offloadWindow: - $ref: '#/definitions/BackupWindowSettingModel' - operationalRestorePeriodDays: - description: >- - Number of days after which inactive backup chains on the performance - extents are moved to the capacity extent. Specify *0* to offload - inactive backup chains on the same day they are created. - type: integer - overridePolicy: - $ref: '#/definitions/CapacityTierOverridePolicyModel' - type: object - CapacityTierOverridePolicyModel: - description: Override policy. - properties: - isEnabled: - description: >- - If *true*, Veeam Backup & Replication moves oldest backup files sooner - if scale-out backup repository is reaching the threshold. - type: boolean - overrideSpaceThresholdPercents: - description: 'Space threshold of the scale-out backup repository, in percent.' - type: integer - type: object - CertificateModel: - properties: - issuedBy: - description: Issuer of the certificate. - type: string - issuedTo: - description: Acquirer of the certificate. - type: string - keyAlgorithm: - description: Key algorithm of the certificate. - type: string - keySize: - description: Key size of the certificate. - type: string - serialNumber: - description: Serial number of the certificate. - type: string - subject: - description: Subject of the certificate. - type: string - thumbprint: - description: Thumbprint of the certificate. - type: string - validBy: - description: Expiration date and time of the certificate. - format: date-time - type: string - validFrom: - description: Date and time the certificate is valid from. - format: date-time - type: string - required: - - issuedBy - - issuedTo - - keyAlgorithm - - keySize - - serialNumber - - subject - - thumbprint - - validBy - - validFrom - type: object - ConfigBackupEncryptionModel: - description: Encryption settings. - properties: - isEnabled: - description: 'If *true*, backup encryption is enabled.' - type: boolean - passwordId: - description: ID of the password used for encryption. - format: uuid - type: string - required: - - isEnabled - - passwordId - type: object - ConfigBackupLastSuccessfulModel: - description: Last successful backup. - properties: - lastSuccessfulTime: - description: Date and time when the last successful backup was created. - format: date-time - type: string - sessionId: - description: ID of the job session. - format: uuid - type: string - type: object - ConfigBackupModel: - properties: - backupRepositoryId: - description: >- - ID of the backup repository on which the configuration backup is - stored. - format: uuid - type: string - encryption: - $ref: '#/definitions/ConfigBackupEncryptionModel' - isEnabled: - description: 'If *true*, configuration backup is enabled.' - type: boolean - lastSuccessfulBackup: - $ref: '#/definitions/ConfigBackupLastSuccessfulModel' - notifications: - $ref: '#/definitions/ConfigBackupNotificationsModel' - restorePointsToKeep: - description: Number of restore points to keep in the backup repository. - format: int32 - type: integer - schedule: - $ref: '#/definitions/ConfigBackupScheduleModel' - required: - - isEnabled - - backupRepositoryId - - restorePointsToKeep - - notifications - - schedule - - lastSuccessfulBackup - - encryption - type: object - ConfigBackupNotificationsModel: - description: Notification settings. - properties: - SMTPSettings: - $ref: '#/definitions/ConfigBackupSMTPSettigsModel' - SNMPEnabled: - description: 'If *true*, SNMP traps are enabled for this job.' - type: boolean - required: - - SNMPEnabled - type: object - ConfigBackupSMTPSettigsModel: - description: Email notification settings. - properties: - isEnabled: - description: 'If *true*, email notifications are enabled for this job.' - type: boolean - notifyOnError: - description: 'If *true*, email notifications are sent when the job fails.' - type: boolean - notifyOnSuccess: - description: >- - If *true*, email notifications are sent when the job completes - successfully. - type: boolean - notifyOnWarning: - description: >- - If *true*, email notifications are sent when the job completes with a - warning. - type: boolean - recipients: - description: Array of recipients' email addresses. - items: - type: string - type: array - settingsType: - $ref: '#/definitions/EConfigBackupSMTPSettingsType' - subject: - description: > - Notification subject. Use the following variables in the subject: - *%JobResult%*, *%JobName%*, *%Time%* (completion time). - type: string - required: - - isEnabled - - recipients - - settingsType - - subject - - notifyOnSuccess - - notifyOnWarning - - notifyOnError - type: object - ConfigBackupScheduleModel: - description: Scheduling settings. - properties: - daily: - $ref: '#/definitions/ScheduleDailyModel' - isEnabled: - description: 'If *true*, backup scheduling is enabled.' - type: boolean - monthly: - $ref: '#/definitions/ScheduleMonthlyModel' - required: - - isEnabled - type: object - ConnectionCertificateModel: - properties: - certificate: - $ref: '#/definitions/CertificateModel' - fingerprint: - description: SSH key fingerprint used to verify the server identity. - type: string - type: object - CredentialsExportSpec: - properties: - ids: - description: Array of credentials IDs. - items: - format: uuid - type: string - type: array - uniqueItems: true - names: - description: Array of credentials user names. Wildcard characters are supported. - items: - type: string - type: array - uniqueItems: true - showHiddenCreds: - description: 'If *true*, service credentials are exported.' - type: boolean - types: - description: Array of credentials types. - items: - $ref: '#/definitions/ECredentialsType' - type: array - uniqueItems: true - type: object - CredentialsFilters: - properties: - limit: - description: Maximum number of credentials records to return. - format: int32 - type: integer - nameFilter: - description: >- - Filters credentials by the `nameFilter` pattern. The pattern can match - any credentials parameter. To substitute one or more characters, use - the asterisk (*) character at the beginning and/or at the end. - type: string - orderAsc: - description: >- - Sorts credentials in the ascending order by the `orderColumn` - parameter. - type: boolean - orderColumn: - $ref: '#/definitions/ECredentialsFiltersOrderColumn' - skip: - description: Number of credentials records to skip. - format: int32 - type: integer - type: object - CredentialsImportModel: - properties: - credentialsName: - description: 'User name, account name or access key.' - type: string - credentialsTag: - description: Tag used to identify the credentials record. - type: string - required: - - credentialsName - type: object - CredentialsImportSpec: - properties: - description: - description: Description of the credentials record. - type: string - linuxAdditionalSettings: - $ref: '#/definitions/CredentialsLinuxSettingsImportModel' - password: - description: Password. - type: string - tag: - description: Tag used to identify the credentials record. - type: string - type: - $ref: '#/definitions/ECredentialsType' - username: - description: User name. - type: string - required: - - tag - - type - - username - type: object - CredentialsImportSpecCollection: - properties: - credentials: - description: Array of credentials. - items: - $ref: '#/definitions/CredentialsImportSpec' - type: array - uniqueItems: true - required: - - credentials - type: object - CredentialsLinuxSettingsImportModel: - properties: - SSHPort: - description: SSH port used to connect to a Linux server. - type: integer - addToSudoers: - description: 'If *true*, the account is automatically added to the sudoers file.' - type: boolean - autoElevated: - description: >- - If *true*, the permissions of the account are automatically elevated - to the root user. - type: boolean - passphrase: - description: Passphrase that protects the private key. - type: string - privateKey: - description: Private key. - type: string - rootPassword: - description: Password for the root account. - type: string - useSu: - description: >- - If *true*, the `su` command is used for Linux distributions where the - `sudo` command is not available. - type: boolean - type: object - CredentialsModel: - properties: - creationTime: - description: Date and time when the credentials were created. - format: date-time - type: string - description: - description: Description of the credentials record. - type: string - id: - description: ID of the credentials record. - format: uuid - type: string - type: - $ref: '#/definitions/ECredentialsType' - username: - description: User name. - type: string - required: - - id - - username - - description - - type - - creationTime - type: object - CredentialsPasswordChangeSpec: - properties: - password: - description: New password. - type: string - required: - - password - type: object - CredentialsResult: - properties: - data: - description: Array of credentials. - items: - $ref: '#/definitions/CredentialsModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - CredentialsSpec: - properties: - description: - description: Description of the credentials record. - type: string - password: - description: Password. - type: string - type: - $ref: '#/definitions/ECredentialsType' - username: - description: User name. - type: string - required: - - username - - type - type: object - DeleteRepositoryFilters: - properties: - deleteBackups: - type: boolean - type: object - EAllowedBackupsType: - description: Type of backup files that can be stored on the extent. - enum: - - All - - FullsOnly - - IncrementsOnly - type: string - EApplicationSettingsVSS: - description: Behavior scenario for application-aware processing. - enum: - - requireSuccess - - ignoreFailures - - disabled - type: string - EBackupExclusionPolicy: - description: Exclusion policy. - enum: - - disabled - - excludeOnly - - includeOnly - type: string - EBackupModeType: - description: Type of the backup method used to create a restore point. - enum: - - Full - - Incremental - - ReverseIncremental - - Transofrm - - TransformForeverIncremental - type: string - EBackupObjectsFiltersOrderColumn: - enum: - - Name - - ObjectId - - PlatformId - - Type - type: string - EBackupOracleLogsSettings: - description: Type of archived logs processing. - enum: - - preserve - - deleteExpiredHours - - deleteExpiredGBs - type: string - EBackupProxyImportType: - enum: - - vmware - type: string - EBackupProxyTransportMode: - description: Transport mode of the backup proxy. - enum: - - auto - - directAccess - - virtualAppliance - - network - type: string - EBackupScriptProcessingMode: - description: Scenario for scripts execution. - enum: - - disableExec - - ignoreExecFailures - - requireSuccess - type: string - EBackupsFiltersOrderColumn: - enum: - - Name - - CreationTime - - PlatformId - - JobId - - PolicyTag - type: string - ECompressionLevel: - description: Compression level. - enum: - - Auto - - None - - DedupFriendly - - Optimal - - High - - Extreme - type: string - EConfigBackupSMTPSettingsType: - description: Type of notification settings. - enum: - - Global - - Custom - type: string - ECredentialsFiltersOrderColumn: - enum: - - Username - - Description - type: string - ECredentialsType: - description: Credentials type. - enum: - - Standard - - Linux - type: string - EDailyKinds: - description: Kind of daily scheduling scheme. - enum: - - Everyday - - WeekDays - - SelectedDays - type: string - EDayNumberInMonth: - enum: - - First - - Second - - Third - - Fourth - - Last - - OnDay - type: string - EDayOfWeek: - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - type: string - EDiskInfoProcessState: - description: Process state of the disk. - enum: - - NotProcessed - - InProcessing - - PartiallyProcessed - - Processed - type: string - EDiskInfoType: - description: Type of the disk. - enum: - - Unknown - - Simple - - Vi - - Hv - - HvRawDiskFile - - EndPoint - type: string - EEmailNotificationType: - description: > - Type of email notification settings: global notification settings - specified for the backup server, or custom notification settings specified - for this job. - enum: - - UseGlobalNotificationSettings - - UseCustomNotificationSettings - type: string - EEncryptionPasswordsFiltersOrderColumn: - enum: - - Hint - - ModificationTime - type: string - EGuestFSIndexingMode: - description: Indexing mode. - enum: - - disable - - indexAll - - indexAllExcept - - indexOnly - type: string - EGuestOSType: - description: Type of the guest OS. - enum: - - Windows - - Linux - type: string - EHierarchyType: - description: Hierarchy type. - enum: - - HostsAndClusters - - DatastoresAndVms - - HostsAndDatastores - - VmsAndTemplates - - VmsAndTags - type: string - EInstantRecoveryMountState: - description: Mount state. - enum: - - Failed - - Mounting - - Mounted - - Dismounting - type: string - EJobFiltersOrderColumn: - description: Orders jobs by the specified column. - enum: - - Name - - Type - - Description - type: string - EJobStatesFiltersOrderColumn: - description: Orders job states by the specified column. - enum: - - Name - - Type - - Status - - LastRun - - LastResult - - NextRun - - Description - - RepositoryId - - ObjectsCount - type: string - EJobStatus: - description: Current status of the job. - enum: - - running - - inactive - - disabled - type: string - EJobType: - description: Type of the job. - enum: - - Backup - type: string - EJobWorkload: - description: Workload which the job must process. - enum: - - application - - cloudVm - - file - - server - - workstation - - vm - type: string - ELoginGrantType: - default: password - description: > - Authorization grant type. - - - Available values: - - - `password` — used to obtain an access token by providing a user name and - password. - - - `refresh_token` — used to refresh an expired or lost access token by - providing a refresh token. - - - `authorization_code` — used to obtain an access token by providing an - authorization code. - enum: - - password - - refresh_token - - authorization_code - type: string - EManagedServerType: - description: Type of the server. - enum: - - WindowsHost - - LinuxHost - - ViHost - type: string - EManagedServersFiltersOrderColumn: - enum: - - Name - - Type - - Description - type: string - EMonth: - enum: - - January - - February - - March - - April - - May - - June - - July - - August - - September - - October - - November - - December - type: string - EObjectRestorePointOperation: - enum: - - VmwareInstantRecoveryFcd - type: string - EObjectRestorePointsFiltersOrderColumn: - enum: - - CreationTime - - PlatformId - - BackupId - type: string - EPeriodicallyKinds: - description: Time unit for periodic job scheduling. - enum: - - Hours - - Minutes - - Seconds - - Days - type: string - EPlacementPolicyType: - description: Type of placement policy. - enum: - - DataLocality - - Performance - type: string - EPlatform: - enum: - - Vmware - - HyperV - - Test - - Vcd - - Tape - - EndPoint - - LinuxPhysical - - CustomPlatform - - Conf - - NasBackup - - EmulatedVmWare - - Extension0 - - Extension1 - - Extension - type: string - EPlatformType: - enum: - - VmWare - - HyperV - - Vcd - - WindowsPhysical - - LinuxPhysical - - Tape - - NasBackup - - CustomPlatform - type: string - EProxiesFiltersOrderColumn: - enum: - - Name - - Type - - Description - type: string - EProxyType: - description: Type of the backup proxy. - enum: - - ViProxy - type: string - ERepositoryExtentStatusType: - enum: - - Normal - - Evacuate - - Pending - - Sealed - - Maintenance - type: string - ERepositoryFiltersOrderColumn: - enum: - - Name - - Description - - Type - - Host - - Path - type: string - ERepositoryStatesFiltersOrderColumn: - description: Orders repositories by the specified column. - enum: - - Name - - Type - - Host - - Path - - CapacityGB - - FreeGB - - UsedSpaceGB - - Description - type: string - ERepositoryType: - description: Repository type. - enum: - - WinLocal - - LinuxLocal - - Smb - - Nfs - - AzureBlob - - AzureArchive - - AmazonS3 - - AmazonS3Glacier - - S3Compatible - - GoogleCloud - - IBMCloud - type: string - ERetainLogBackupsType: - description: Retention policy for the logs stored in the backup repository. - enum: - - untilBackupDeleted - - KeepOnlyDays - type: string - ERetentionPolicyType: - description: Type of the retention policy. - enum: - - RestorePoints - - Days - type: string - ESQLLogsProcessing: - description: Type of transaction logs processing. - enum: - - truncate - - preserve - - backup - - neverTruncate - type: string - EScaleOutRepositoryFiltersOrderColumn: - enum: - - Name - - Description - - Type - - Host - - Path - type: string - EScriptPeriodicityType: - description: Type of script periodicity. - enum: - - Days - - BackupSessions - type: string - ESennightOfMonth: - description: Sennight of the month. - enum: - - First - - Second - - Third - - Fourth - - Fifth - - Last - type: string - EServicesFiltersOrderColumn: - enum: - - Name - - Port - type: string - ESessionResult: - description: Result of the session. - enum: - - None - - Success - - Warning - - Failed - type: string - ESessionState: - description: State of the session. - enum: - - Stopped - - Starting - - Stopping - - Working - - Pausing - - Resuming - - WaitingTape - - Idle - - Postprocessing - - WaitingRepository - - WaitingSlot - type: string - ESessionType: - description: Type of the session. - enum: - - Infrastructure - - Job - - Automation - - ConfigurationBackup - - RepositoryMaintenance - - RepositoryEvacuate - - InfrastructureItemDeletion - type: string - ESessionsFiltersOrderColumn: - enum: - - Name - - SessionType - - CreationTime - - EndTime - - State - - Result - type: string - ESpeedUnit: - description: Traffic speed unit. - enum: - - KbytePerSec - - MbitPerSpec - - MbytePerSec - type: string - EStorageOptimization: - description: Storage optimization that depends on the target type. - enum: - - Auto - - LocalTargetLarge - - LocalTarget - - LANTarget - - WANTarget - type: string - ETaskLogRecordStatus: - enum: - - None - - Succeeded - - Warning - - Failed - type: string - ETransactionLogsSettings: - description: > - Transaction logs settings that define whether copy-only backups must be - created or transaction logs for Microsoft Exchange, Microsoft SQL and - Oracle VMs must be processed.
- - If transaction log processing is selected, specify the following - parameters:
- -
    - -
  • [For Microsoft SQL Server VMs] Microsoft SQL Server transaction log - settings
  • - -
  • [For Oracle VMs] Oracle archived log settings
  • - -
- enum: - - process - - copyOnly - type: string - EViHostType: - description: Type of the VMware vSphere server. - enum: - - ESX - - ESXi - - VC - type: string - EViRootFiltersOrderColumn: - description: >- - Sorts VMware vSphere servers by one of the VMware vSphere server - parameters. - enum: - - Name - - Type - type: string - EVmwareDisksTypeToProcess: - description: Type of disk selection. - enum: - - AllDisks - - SystemOnly - - SelectedDisks - type: string - EVmwareInventoryType: - description: Type of the VMware vSphere object. - enum: - - Unknown - - VirtualMachine - - vCenterServer - - Datacenter - - Cluster - - Host - - ResourcePool - - Folder - - Datastore - - DatastoreCluster - - StoragePolicy - - Template - - ComputeResource - - VirtualApp - - Tag - - Category - - Multitag - type: string - EWindowsHostComponentType: - description: Veeam Backup & Replication component. - enum: - - Transport - - Nfs - - HvIntegration - - DeployerSvc - - WanAccelerator - - Tape - - CloudGate - - CloudServiceInvoker - - CloudServiceRemoting - - RestoreProxy - - EpAgent - - EpAgentSqlLocalDB - - EpAgentSharedManagementObjects - - EpAgentSqlSysClrTypes - - AgentConfigureService - - VawRedist - - ValRedist - - GuestControl - - FileSystemVssIntegration - - VssHwSnapshotProvider - - Cdp - - VamRedist - type: string - EmailCustomNotificationType: - properties: - SuppressNotificationUntilLastRetry: - description: >- - If *true*, email notifications are sent about the final job status - only (not per every job retry). - type: boolean - notifyOnError: - description: 'If *true*, email notifications are sent when the job fails.' - type: boolean - notifyOnSuccess: - description: >- - If *true*, email notifications are sent when the job completes - successfully. - type: boolean - notifyOnWarning: - description: >- - If *true*, email notifications are sent when the job completes with a - warning. - type: boolean - subject: - description: > - Notification subject. Use the following variables in the subject: - *%Time%* (completion time), *%JobName%*, *%JobResult%*, - *%ObjectCount%* (number of VMs in the job) and *%Issues%* (number of - VMs in the job that have finished with the Warning or Failed status). - type: string - type: object - EmailNotificationSettingsModel: - description: Email notification settings for the backup job. - properties: - customNotificationSettings: - $ref: '#/definitions/EmailCustomNotificationType' - isEnabled: - description: 'If *true*, email notifications are enabled for this job.' - type: boolean - notificationType: - $ref: '#/definitions/EEmailNotificationType' - recipients: - description: Array of recipient’s email addresses. - items: - type: string - type: array - uniqueItems: true - required: - - isEnabled - type: object - EmptySuccessResponse: - description: 'Empty success response (200, 201, 204).' - type: object - EncryptionPasswordExportSpec: - properties: - tags: - description: Array of password tags. - items: - type: string - type: array - uniqueItems: true - hints: - description: Array of password hints. - items: - type: string - type: array - uniqueItems: true - ids: - description: Array of password IDs. - items: - format: uuid - type: string - type: array - uniqueItems: true - modificationTimeFrom: - description: Date and time the password was last modified. - format: date-time - type: string - type: object - EncryptionPasswordImportSpec: - properties: - hint: - description: Hint for the encryption password. - type: string - password: - description: Password. - type: string - tag: - description: Tag for the encryption password. - type: string - required: - - hint - - password - type: object - EncryptionPasswordImportSpecCollection: - properties: - encryptionPasswords: - description: Array of encryption passwords. - items: - $ref: '#/definitions/EncryptionPasswordImportSpec' - type: array - uniqueItems: true - type: object - EncryptionPasswordModel: - properties: - hint: - description: Hint for the encryption password. - type: string - id: - description: ID of the encryption password. - format: uuid - type: string - modificationTime: - description: Date and time the password was last modified. - format: date-time - type: string - tag: - description: Tag for the encryption password. - type: string - required: - - hint - - id - type: object - EncryptionPasswordSpec: - properties: - hint: - description: >- - Hint for the encryption password. Provide a meaningful hint that will - help you recall the password. - type: string - password: - description: >- - Password for data encryption. If you lose the password, you will not - be able to restore it. - type: string - tag: - description: Tag for the encryption password. - type: string - required: - - hint - - password - type: object - EncryptionPasswordsFilters: - properties: - limit: - format: int32 - type: integer - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/EEncryptionPasswordsFiltersOrderColumn' - skip: - format: int32 - type: integer - type: object - EncryptionPasswordsResult: - properties: - data: - description: Array of encryption passwords. - items: - $ref: '#/definitions/EncryptionPasswordModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - Error: - description: '' - properties: - errorCode: - description: >- - The error code is a string that uniquely identifies an error condition - and should be understood by programs that detect and handle errors by - type - enum: - - AccessDenied - - ExpiredToken - - InvalidToken - - InvalidURI - - MethodNotAllowed - - NotFound - - NotImplemented - - ServiceUnavailable - - UnexpectedContent - - UnknownError - type: string - message: - description: >- - The error message contains a generic description of the error - condition in English. It is intended for a human audience - type: string - resourceId: - description: ID of the object that is involved in the error (or empty) - type: string - required: - - errorCode - - message - type: object - EvCentersInventoryFiltersOrderColumn: - description: Sorts vCenter Servers by one of the job parameters. - enum: - - Name - - ObjectId - - Type - type: string - FullBackupMaintenanceDefragmentAndCompactModel: - description: Compact operation settings. - properties: - isEnabled: - description: 'If *true*, Veeam Backup & Replication compacts full backup files.' - type: boolean - monthly: - $ref: '#/definitions/AdvancedStorageScheduleMonthlyModel' - weekly: - $ref: '#/definitions/AdvancedStorageScheduleWeeklyModel' - required: - - isEnabled - type: object - FullBackupMaintenanceModel: - description: Maintenance settings for full backup files. - properties: - RemoveData: - $ref: '#/definitions/FullBackupMaintenanceRemoveDataModel' - defragmentAndCompact: - $ref: '#/definitions/FullBackupMaintenanceDefragmentAndCompactModel' - type: object - FullBackupMaintenanceRemoveDataModel: - description: Backup data setting for deleted VMs. - properties: - afterDays: - description: Number of days. - type: integer - isEnabled: - description: >- - If *true*, Veeam Backup & Replication keeps the backup data of deleted - VMs for the `afterDays` number of days. - type: boolean - required: - - isEnabled - type: object - GFSPolicySettingsModel: - description: GFS retention policy settings. - properties: - isEnabled: - description: 'If *true*, the long-term (GFS) retention policy is enabled.' - type: boolean - monthly: - $ref: '#/definitions/GFSPolicySettingsMonthlyModel' - weekly: - $ref: '#/definitions/GFSPolicySettingsWeeklyModel' - yearly: - $ref: '#/definitions/GFSPolicySettingsYearlyModel' - required: - - isEnabled - type: object - GFSPolicySettingsMonthlyModel: - description: Monthly GFS retention policy. - properties: - desiredTime: - $ref: '#/definitions/ESennightOfMonth' - description: >- - Week of the month when the full backup that will be kept for archival - purposes is created (the first week is the first 7 days of the month). - isEnabled: - description: 'If *true*, the monthly GFS retention policy is enabled.' - type: boolean - keepForNumberOfMonths: - description: Number of months to keep full backups for archival purposes. - type: integer - required: - - isEnabled - type: object - GFSPolicySettingsWeeklyModel: - description: Weekly GFS retention policy. - properties: - desiredTime: - $ref: '#/definitions/EDayOfWeek' - description: >- - Day of the week when the full backup that will be kept for archival - purposes is created. - isEnabled: - description: 'If *true*, the weekly GFS retention policy is enabled.' - type: boolean - keepForNumberOfWeeks: - description: Number of weeks to keep full backups for archival purposes. - type: integer - required: - - isEnabled - type: object - GFSPolicySettingsYearlyModel: - description: Yearly GFS retention policy. - properties: - desiredTime: - $ref: '#/definitions/EMonth' - description: >- - Month when the full backup that will be kept for archival purposes is - created. - isEnabled: - description: 'If *true*, the yearly GFS retention policy is enabled.' - type: boolean - keepForNumberOfYears: - description: Number of years to keep full backups for archival purposes. - type: integer - required: - - isEnabled - type: object - GeneralOptionsEmailNotificationsModel: - description: Global email notification settings. - properties: - advancedSmtpOptions: - $ref: '#/definitions/AdvancedSmtpOptionsModel' - from: - description: Email address from which email notifications must be sent. - type: string - isEnabled: - description: 'If *true*, global email notification settings are enabled.' - type: boolean - notifyOnFailure: - description: 'If *true*, email notifications are sent when the job fails.' - type: boolean - notifyOnLastRetry: - description: >- - If *true*, email notifications are sent about the final job status - only (not per every job retry). - type: boolean - notifyOnSuccess: - description: >- - If *true*, email notifications are sent when the job completes - successfully. - type: boolean - notifyOnWarning: - description: >- - If *true*, email notifications are sent when the job completes with a - warning. - type: boolean - sendDailyReportsAt: - description: Time when Veeam Backup & Replication sends daily email reports. - format: date-time - type: string - smtpServerName: - description: Full DNS name or IP address of the SMTP server. - type: string - subject: - description: > - Notification subject. Use the following variables in the subject:
-
    -
  1. %Time% — completion time
  2. -
  3. %JobName%
  4. -
  5. %JobResult%
  6. -
  7. %ObjectCount% — number of VMs in the job
  8. -
  9. %Issues% — number of VMs in the job that have been processed with the Warning or Failed status
  10. -
- type: string - to: - description: >- - Recipient email addresses. Use a semicolon to separate multiple - addresses. - type: string - required: - - isEnabled - - smtpServerName - - advancedSmtpOptions - - from - - to - - subject - - sendDailyReportsAt - - notifyOnSuccess - - notifyOnWarning - - notifyOnFailure - - notifyOnLastRetry - type: object - GeneralOptionsModel: - properties: - emailSettings: - $ref: '#/definitions/GeneralOptionsEmailNotificationsModel' - notifications: - $ref: '#/definitions/GeneralOptionsNotificationsModel' - type: object - GeneralOptionsNotificationsModel: - properties: - datastoreSpaceThreshold: - description: 'Space threshold of production datastore, in percent.' - format: int32 - type: integer - datastoreSpaceThresholdEnabled: - description: >- - If *true*, notifications about critical amount of free space in - production datastore are enabled. - type: boolean - notifyOnSupportExpiration: - description: >- - If *true*, notifications about support contract expiration are - enabled. - type: boolean - notifyOnUpdates: - description: 'If *true*, notifications about updates are enabled.' - type: boolean - skipVMSpaceThreshold: - description: 'Space threshold of production datastore, in percent.' - format: int32 - type: integer - skipVMSpaceThresholdEnabled: - description: >- - If *true* and the `skipVMSpaceThreshold` threshold is reached, Veeam - Backup & Replication terminates backup and replication jobs working - with production datastores before VM snapshots are taken. - type: boolean - storageSpaceThreshold: - description: 'Space threshold of backup storage, in percent.' - format: int32 - type: integer - storageSpaceThresholdEnabled: - description: >- - If *true*, notifications about critical amount of free space in backup - storage are enabled. - type: boolean - required: - - storageSpaceThresholdEnabled - - storageSpaceThreshold - - datastoreSpaceThresholdEnabled - - datastoreSpaceThreshold - - skipVMSpaceThresholdEnabled - - skipVMSpaceThreshold - - notifyOnSupportExpiration - - notifyOnUpdates - type: object - GlobalNetworkTrafficRulesModel: - properties: - preferredNetworks: - $ref: '#/definitions/PreferredNetworksModel' - trafficRules: - description: Array of traffic rules. - items: - $ref: '#/definitions/TrafficRuleModel' - type: array - uploadStreamsCount: - description: Number of TCP/IP connections per job. - format: integer - type: integer - useMultipleStreamsPerJob: - description: >- - If *true*, Veeam Backup & Replication uses multiple TCP/IP transfer - connection for every job session. - type: boolean - required: - - useMultipleStreamsPerJob - type: object - GuestFileSystemIndexingModel: - description: VM guest OS file indexing. - properties: - indexingSettings: - description: Array of VMs with guest OS file indexing options. - items: - $ref: '#/definitions/BackupIndexingSettingsModel' - type: array - isEnabled: - type: boolean - required: - - isEnabled - type: object - GuestInteractionProxiesSettingsImportModel: - description: >- - Guest interaction proxy used to deploy the runtime process on the VM guest - OS. - properties: - automaticSelection: - default: true - description: >- - If *true*, Veeam Backup & Replication automatically selects the guest - interaction proxy. - type: boolean - proxies: - description: >- - Array of proxies specified explicitly. The array must contain - Microsoft Windows servers added to the backup infrastructure only. - items: - type: string - type: array - uniqueItems: true - required: - - automaticSelection - type: object - GuestInteractionProxiesSettingsModel: - description: >- - Guest interaction proxy used to deploy the runtime process on the VM guest - OS. - properties: - autoSelection: - default: true - description: >- - If *true*, Veeam Backup & Replication automatically selects the guest - interaction proxy. - type: boolean - proxyIds: - description: >- - Array of proxies specified explicitly. The array must contain - Microsoft Windows servers added to the backup infrastructure only. - items: - format: uuid - type: string - type: array - uniqueItems: true - required: - - autoSelection - type: object - GuestOsCredentialsImportModel: - description: VM custom credentials. - properties: - credentialsPerMachine: - description: Individual credentials for VMs. - items: - $ref: '#/definitions/GuestOsCredentialsPerMachineImportModel' - type: array - uniqueItems: true - creds: - $ref: '#/definitions/CredentialsImportModel' - type: object - GuestOsCredentialsModel: - description: VM custom credentials. - properties: - credentialsPerMachine: - description: Individual credentials for VMs. - items: - $ref: '#/definitions/GuestOsCredentialsPerMachineModel' - type: array - uniqueItems: true - credsId: - description: Credentials ID for Microsoft Windows VMs. - format: uuid - type: string - credsType: - $ref: '#/definitions/ECredentialsType' - required: - - credsId - - credsType - type: object - GuestOsCredentialsPerMachineImportModel: - properties: - linuxCreds: - $ref: '#/definitions/CredentialsImportModel' - vmObject: - $ref: '#/definitions/VmwareObjectModel' - windowsCreds: - $ref: '#/definitions/CredentialsImportModel' - required: - - vmObject - type: object - GuestOsCredentialsPerMachineModel: - properties: - linuxCredsId: - description: Credentials ID for a Linux VM. - format: uuid - type: string - vmObject: - $ref: '#/definitions/VmwareObjectModel' - windowsCredsId: - description: Credentials ID for a Microsoft Windows VM. - format: uuid - type: string - required: - - vmObject - type: object - HostConnectionSpec: - properties: - credentialsId: - description: ID of a credentials record used to connect to the server. - format: uuid - type: string - port: - description: Port used to communicate with the server. - type: integer - serverName: - description: Full DNS name or IP address of the server. - type: string - type: - $ref: '#/definitions/EManagedServerType' - required: - - serverName - - credentialsId - - type - type: object - JobExportSpec: - properties: - ids: - description: Array of job IDs. - items: - format: uuid - type: string - type: array - uniqueItems: true - names: - description: Array of job names. Wildcard characters are supported. - items: - type: string - type: array - uniqueItems: true - types: - description: Array of job types. - items: - type: string - type: array - uniqueItems: true - type: object - JobImportSpec: - properties: - description: - description: Description of the job. - type: string - guestProcessing: - $ref: '#/definitions/BackupJobGuestProcessingImportModel' - isHighPriority: - description: >- - If *true*, the job has a high priority in getting backup - infrastructure resources. - type: boolean - name: - description: Name of the job. - type: string - schedule: - $ref: '#/definitions/BackupScheduleModel' - storage: - $ref: '#/definitions/BackupJobStorageImportModel' - type: - $ref: '#/definitions/EJobType' - virtualMachines: - $ref: '#/definitions/BackupJobVirtualMachinesSpec' - required: - - description - - guestProcessing - - isHighPriority - - name - - schedule - - storage - - type - - virtualMachines - type: object - JobImportSpecCollection: - properties: - jobs: - description: Array of jobs. - items: - $ref: '#/definitions/JobImportSpec' - type: array - uniqueItems: true - required: - - jobs - type: object - JobModel: - properties: - description: - description: Description of the job. - type: string - id: - description: ID of the job. - format: uuid - type: string - isDisabled: - description: 'If *true*, the job is disabled.' - type: boolean - name: - description: Name of the job. - type: string - type: - $ref: '#/definitions/EJobType' - required: - - id - - name - - description - - type - - isDisabled - type: object - JobScriptsSettingsModel: - description: Script settings. - properties: - dayOfWeek: - description: Days of the week when the scripts must be executed. - items: - $ref: '#/definitions/EDayOfWeek' - type: array - uniqueItems: true - periodicityType: - $ref: '#/definitions/EScriptPeriodicityType' - postCommand: - $ref: '#/definitions/ScriptCommand' - description: Script executed after the backup job. - preCommand: - $ref: '#/definitions/ScriptCommand' - description: Script executed before the backup job. - runScriptEvery: - description: >- - Number of the backup job session after which the scripts must be - executed. - type: integer - type: object - JobSpec: - properties: - description: - description: Job description specified at the time of the job creation. - type: string - name: - description: Name of the job. - type: string - type: - $ref: '#/definitions/EJobType' - description: Job type. - required: - - name - - description - - type - type: object - JobStartSpec: - properties: - performActiveFull: - default: false - type: boolean - startChainedJobs: - default: false - type: boolean - required: - - performActiveFull - type: object - JobStateModel: - properties: - description: - description: Description of the job. - type: string - id: - description: ID of the job. - format: uuid - type: string - lastResult: - $ref: '#/definitions/ESessionResult' - lastRun: - description: Last run of the job. - format: date-time - type: string - name: - description: Name of the job. - type: string - nextRun: - description: Next run of the job. - format: date-time - type: string - objectsCount: - description: Number of objects processed by the job. - type: integer - repositoryId: - description: ID of the backup repository. - format: uuid - type: string - repositoryName: - description: Name of the backup repository. - type: string - sessionId: - description: ID of the last job session. - format: uuid - type: string - status: - $ref: '#/definitions/EJobStatus' - type: - $ref: '#/definitions/EJobType' - workload: - $ref: '#/definitions/EJobWorkload' - required: - - id - - name - - type - - description - - status - - lastResult - - workload - - objectsCount - type: object - JobStatesFilters: - description: Filters jobs by the specified parameters. - properties: - idFilter: - format: uuid - type: string - isHighPriorityJobFilter: - type: boolean - lastResultFilter: - $ref: '#/definitions/ESessionResult' - lastRunAfterFilter: - format: date-time - type: string - lastRunBeforeFilter: - format: date-time - type: string - limit: - description: Returns the specified number of jobs. - format: int32 - type: integer - nameFilter: - description: >- - Filters jobs by the `nameFilter` pattern. The pattern can match any - job state parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - type: string - objectsCountFilter: - type: integer - orderAsc: - description: Sorts jobs in the ascending order by the `orderColumn` parameter. - type: boolean - orderColumn: - $ref: '#/definitions/EJobStatesFiltersOrderColumn' - repositoryIdFilter: - format: uuid - type: string - skip: - description: Skips the specified number of jobs. - format: int32 - type: integer - statusFilter: - $ref: '#/definitions/EJobStatus' - typeFilter: - $ref: '#/definitions/EJobType' - workloadFilter: - $ref: '#/definitions/EJobWorkload' - type: object - JobStatesResult: - properties: - data: - description: Array of job states. - items: - $ref: '#/definitions/JobStateModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - JobStopSpec: - properties: - gracefullStop: - default: true - type: boolean - required: - - gracefullStop - type: object - JobsFilters: - description: Filters jobs by the specified parameters. - properties: - limit: - description: Returns the specified number of jobs. - format: int32 - type: integer - nameFilter: - description: >- - Filters jobs by the `nameFilter` pattern. The pattern can match any - job parameter. To substitute one or more characters, use the asterisk - (*) character at the beginning and/or at the end. - type: string - orderAsc: - description: Sorts jobs in the ascending order by the `orderColumn` parameter. - type: boolean - orderColumn: - $ref: '#/definitions/EJobFiltersOrderColumn' - skip: - description: Skips the specified number of jobs. - format: int32 - type: integer - typeFilter: - $ref: '#/definitions/EJobType' - type: object - JobsResult: - properties: - data: - description: Array of jobs. - items: - $ref: '#/definitions/JobModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - LinuxCredentialsModel: - allOf: - - $ref: '#/definitions/CredentialsModel' - - properties: - SSHPort: - description: SSH port used to connect to a Linux server. - type: integer - addToSudoers: - description: 'If *true*, the account is automatically added to the sudoers file.' - type: boolean - autoElevated: - description: >- - If *true*, the permissions of the account are automatically - elevated to the root user. - type: boolean - passphrase: - description: Passphrase that protects the private key. - type: string - privateKey: - description: Private key. - type: string - tag: - description: Tag used to identify the credentials record. - type: string - useSu: - description: >- - If *true*, the `su` command is used for Linux distributions where - the `sudo` command is not available. - type: boolean - type: object - LinuxCredentialsSpec: - allOf: - - $ref: '#/definitions/CredentialsSpec' - - properties: - SSHPort: - description: SSH port used to connect to a Linux server. - type: integer - addToSudoers: - description: 'If *true*, the account is automatically added to the sudoers file.' - type: boolean - autoElevated: - description: >- - If *true*, the permissions of the account are automatically - elevated to the root user. - type: boolean - passphrase: - description: Passphrase that protects the private key. - type: string - privateKey: - description: Private key. - type: string - rootPassword: - description: Password for the root account. - type: string - tag: - description: Tag used to identify the credentials record. - type: string - useSu: - description: >- - If *true*, the `su` command is used for Linux distributions where - the `sudo` command is not available. - type: boolean - type: object - LinuxHostImportSpec: - properties: - credentials: - $ref: '#/definitions/CredentialsImportModel' - description: - description: Description of the server. - type: string - name: - description: Full DNS name or IP address of the server. - type: string - sshFingerprint: - description: SSH key fingerprint used to verify the server identity. - type: string - sshSettings: - $ref: '#/definitions/LinuxHostSSHSettingsModel' - type: - $ref: '#/definitions/EManagedServerType' - required: - - credentials - - description - - name - - type - - sshFingerprint - type: object - LinuxHostModel: - allOf: - - $ref: '#/definitions/ManagedServerModel' - - properties: - sshSettings: - $ref: '#/definitions/LinuxHostSSHSettingsModel' - type: object - LinuxHostSSHSettingsModel: - description: SSH settings. - properties: - managementPort: - description: >- - Port used as a control channel from the Veeam Backup & Replication - console to the Linux server. - type: integer - portRangeEnd: - description: End port used for data transfer. - type: integer - portRangeStart: - description: Start port used for data transfer. - type: integer - serverThisSide: - description: 'If *true*, the server is run on this side.' - type: boolean - sshTimeOutMs: - description: >- - SSH timeout, in ms. If a task targeted at the server is inactive after - the timeout, the task is terminated. - type: integer - type: object - LinuxHostSpec: - allOf: - - $ref: '#/definitions/ManagedServerSpec' - properties: - sshFingerprint: - description: > - SSH key fingerprint used to verify the server identity. For details on - how to get the fingerprint, see [Get TLS Certificate or SSH - Fingerprint](#operation/GetConnectionCertificate). - type: string - sshSettings: - $ref: '#/definitions/LinuxHostSSHSettingsModel' - required: - - sshFingerprint - type: object - LinuxLocalRepositorySettingsModel: - description: Repository settings. - properties: - advancedSettings: - $ref: '#/definitions/RepositoryAdvancedSettingsModel' - makeRecentBackupsImmutableDays: - description: Number of days to keep immutable backups. - type: integer - maxTaskCount: - description: Maximum number of concurrent tasks. - type: integer - path: - description: Path to the folder where backup files are stored. - type: string - readWriteRate: - description: >- - Maximum rate that restricts the total speed of reading and writing - data to the backup repository disk. - type: integer - useFastCloningOnXFSVolumes: - description: | - [For Linux repository] If *true*, fast cloning on XFS volumes is used. - type: boolean - useImmutableBackups: - description: 'If *true*, the Object Lock feature is used to protect recent backups.' - type: boolean - type: object - LinuxLocalStorageImportSpec: - properties: - description: - description: Description of the backup repository. - type: string - hostName: - description: ID of the server that is used as a backup repository. - type: string - mountServer: - $ref: '#/definitions/MountServerSettingsImportSpec' - name: - description: Name of the backup repository. - type: string - repository: - $ref: '#/definitions/LinuxLocalRepositorySettingsModel' - tag: - description: VMware vSphere tag assigned to the backup repository. - type: string - type: - $ref: '#/definitions/ERepositoryType' - required: - - description - - hostName - - mountServer - - name - - repository - - tag - - type - type: object - LinuxLocalStorageModel: - allOf: - - $ref: '#/definitions/RepositoryModel' - - properties: - hostId: - description: ID of the server that is used as a backup repository. - format: uuid - type: string - mountServer: - $ref: '#/definitions/MountServerSettingsModel' - repository: - $ref: '#/definitions/LinuxLocalRepositorySettingsModel' - required: - - hostId - - mountServer - - repository - type: object - description: Direct attached storage. - LinuxLocalStorageSpec: - allOf: - - $ref: '#/definitions/RepositorySpec' - - properties: - hostId: - description: ID of the server that is used as a backup repository. - format: uuid - type: string - mountServer: - $ref: '#/definitions/MountServerSettingsModel' - repository: - $ref: '#/definitions/LinuxLocalRepositorySettingsModel' - required: - - hostId - - mountServer - - repository - type: object - ManageServerExportSpec: - properties: - ids: - description: Array of server IDs. - items: - format: uuid - type: string - type: array - uniqueItems: true - names: - description: Array of server names. Wildcard characters are supported. - items: - type: string - type: array - uniqueItems: true - types: - description: Array of server types. - items: - $ref: '#/definitions/EManagedServerType' - type: array - uniqueItems: true - type: object - ManageServerImportSpecCollection: - properties: - linuxHosts: - description: Array of managed Linux servers. - items: - $ref: '#/definitions/LinuxHostImportSpec' - type: array - uniqueItems: true - viHosts: - description: Array of VMware vSphere servers. - items: - $ref: '#/definitions/ViHostImportSpec' - type: array - uniqueItems: true - windowsHosts: - description: Array of managed Microsoft Windows servers. - items: - $ref: '#/definitions/WindowsHostImportSpec' - type: array - uniqueItems: true - type: object - ManagedServerModel: - properties: - credentialsId: - description: ID of a credentials record used to connect to the server. - format: uuid - type: string - description: - description: Description of the server. - type: string - id: - description: ID of the server. - format: uuid - type: string - name: - description: Full DNS name or IP address of the server. - type: string - type: - $ref: '#/definitions/EManagedServerType' - required: - - credentialsId - - description - - id - - name - - type - type: object - ManagedServerSpec: - properties: - credentialsId: - description: ID of the credentials used to connect to the server. - format: uuid - type: string - description: - description: Description of the server. - type: string - name: - description: Full DNS name or IP address of the server. - type: string - type: - $ref: '#/definitions/EManagedServerType' - required: - - credentialsId - - description - - name - - type - type: object - ManagedServersFilters: - properties: - limit: - format: int32 - type: integer - nameFilter: - type: string - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/EManagedServersFiltersOrderColumn' - skip: - format: int32 - type: integer - typeFilter: - $ref: '#/definitions/EManagedServerType' - viTypeFilter: - $ref: '#/definitions/EViHostType' - type: object - ManagedServersResult: - properties: - data: - description: Array of managed servers. - items: - $ref: '#/definitions/ManagedServerModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - MountServerSettingsImportSpec: - properties: - mountServerName: - description: Name of the mount server. - type: string - vPowerNFSEnabled: - description: 'If *true*, the vPower NFS Service is enabled on the mount server.' - type: boolean - vPowerNFSPortSettings: - $ref: '#/definitions/VPowerNFSPortSettingsModel' - writeCacheFolder: - description: Path to the folder used for writing cache during mount operations. - type: string - required: - - mountServerName - - vPowerNFSEnabled - - writeCacheFolder - type: object - MountServerSettingsModel: - description: >- - Settings for the mount server that is used for file-level and application - items restore. - properties: - mountServerId: - description: ID of the mount server. - format: uuid - type: string - vPowerNFSEnabled: - description: 'If *true*, the vPower NFS Service is enabled on the mount server.' - type: boolean - vPowerNFSPortSettings: - $ref: '#/definitions/VPowerNFSPortSettingsModel' - writeCacheFolder: - description: Path to the folder used for writing cache during mount operations. - type: string - required: - - mountServerId - - vPowerNFSEnabled - - writeCacheFolder - type: object - NetworkRepositorySettingsModel: - description: Repository settings. - properties: - advancedSettings: - $ref: '#/definitions/RepositoryAdvancedSettingsModel' - maxTaskCount: - description: Maximum number of concurrent tasks. - type: integer - readWriteRate: - description: >- - Maximum rate that restricts the total speed of reading and writing - data to the backup repository disk. - type: integer - type: object - NfsRepositoryShareSettingsModel: - description: Share settings. - properties: - gatewayServer: - $ref: '#/definitions/RepositoryShareGatewayModel' - sharePath: - description: Path to the shared folder that that is used as a backup repository. - type: string - required: - - sharePath - type: object - NfsRepositoryShareSettingsSpec: - properties: - gatewayServer: - $ref: '#/definitions/RepositoryShareGatewayImportSpec' - sharePath: - description: Path to the shared folder that that is used as a backup repository. - type: string - required: - - sharePath - type: object - NfsStorageImportSpec: - properties: - description: - description: Description of the backup repository. - type: string - mountServer: - $ref: '#/definitions/MountServerSettingsImportSpec' - name: - description: Name of the backup repository. - type: string - repository: - $ref: '#/definitions/NetworkRepositorySettingsModel' - share: - $ref: '#/definitions/NfsRepositoryShareSettingsSpec' - tag: - description: VMware vSphere tag assigned to the backup repository. - type: string - type: - $ref: '#/definitions/ERepositoryType' - required: - - description - - mountServer - - name - - repository - - share - - tag - - type - type: object - NfsStorageModel: - allOf: - - $ref: '#/definitions/RepositoryModel' - - properties: - mountServer: - $ref: '#/definitions/MountServerSettingsModel' - repository: - $ref: '#/definitions/NetworkRepositorySettingsModel' - share: - $ref: '#/definitions/NfsRepositoryShareSettingsModel' - required: - - mountServer - - repository - - share - type: object - description: Network attached storage. - NfsStorageSpec: - allOf: - - $ref: '#/definitions/RepositorySpec' - - properties: - mountServer: - $ref: '#/definitions/MountServerSettingsModel' - repository: - $ref: '#/definitions/NetworkRepositorySettingsModel' - share: - $ref: '#/definitions/NfsRepositoryShareSettingsModel' - required: - - mountServer - - repository - - share - type: object - NotificationSettingsModel: - description: Notification settings for the backup job. - properties: - emailNotifications: - $ref: '#/definitions/EmailNotificationSettingsModel' - sendSNMPNotifications: - description: 'If *true*, SNMP notifications are enabled for this job.' - type: boolean - vmAttribute: - $ref: '#/definitions/NotificationVmAttributeSettingsModel' - type: object - NotificationVmAttributeSettingsModel: - description: VM attribute settings. - properties: - appendToExisitingValue: - description: >- - If *true*, information about successfully performed backup is appended - to the existing value of the attribute added by the user. - type: boolean - isEnabled: - description: >- - If *true*, information about successfully performed backup is written - to a VM attribute. - type: boolean - notes: - description: Name of the VM attribute. - type: string - required: - - isEnabled - type: object - ObjectRestorePointDiskModel: - properties: - capacity: - description: Capacity of the disk. - format: int64 - type: integer - name: - description: Name of the disk. - type: string - state: - $ref: '#/definitions/EDiskInfoProcessState' - type: - $ref: '#/definitions/EDiskInfoType' - uid: - description: ID of the disk. - type: string - required: - - uid - - type - - name - - capacity - - state - type: object - ObjectRestorePointDisksResult: - properties: - data: - description: Array of disks. - items: - $ref: '#/definitions/ObjectRestorePointDiskModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - ObjectRestorePointModel: - properties: - allowedOperations: - description: Array of operations allowed for the restore point. - items: - $ref: '#/definitions/EObjectRestorePointOperation' - type: array - backupId: - description: ID of a backup that contains the restore point. - format: uuid - type: string - creationTime: - description: Date and time when the restore point was created. - format: date-time - type: string - id: - format: uuid - type: string - name: - type: string - platformId: - description: ID of a platform on which the object was created. - format: uuid - type: string - platformName: - $ref: '#/definitions/EPlatformType' - required: - - id - - name - - platformName - - platformId - - creationTime - - backupId - - allowedOperations - type: object - ObjectRestorePointsFilters: - properties: - backupIdFilter: - format: uuid - type: string - backupObjectIdFilter: - format: uuid - type: string - createdAfterFilter: - format: date-time - type: string - createdBeforeFilter: - format: date-time - type: string - limit: - format: int32 - type: integer - nameFilter: - type: string - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/EObjectRestorePointsFiltersOrderColumn' - platformIdFilter: - format: uuid - type: string - platformNameFilter: - $ref: '#/definitions/EPlatformType' - skip: - format: int32 - type: integer - type: object - ObjectRestorePointsResult: - properties: - data: - description: Array of restore points. - items: - $ref: '#/definitions/ObjectRestorePointModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - PaginationResult: - description: Pagination settings. - properties: - count: - description: Number of returned results. - format: int32 - type: integer - limit: - description: Maximum number of results to return. - format: int32 - type: integer - skip: - description: Number of skipped results. - format: int32 - type: integer - total: - description: Total number of results. - format: int32 - type: integer - required: - - total - - count - type: object - PerformanceExtentModel: - properties: - id: - description: ID of the backup repository added as a performance extent. - format: uuid - type: string - name: - description: Name of the backup repository added as a performance extent. - type: string - status: - $ref: '#/definitions/ERepositoryExtentStatusType' - required: - - id - - name - - status - type: object - PerformanceTierAdvancedSettingsModel: - description: Advanced settings of the performance tier. - properties: - fullWhenExtentOffline: - description: >- - If *true*, Veeam Backup & Replication creates a full backup file - instead of an incremental backup file in case the required extent is - offline. - type: boolean - perVmBackup: - description: >- - If *true*, Veeam Backup & Replication creates a separate backup file - for every VM in the job. - type: boolean - type: object - PerformanceTierModel: - description: Performance tier. - properties: - advancedSettings: - $ref: '#/definitions/PerformanceTierAdvancedSettingsModel' - performanceExtents: - description: Array of performance extents. - items: - $ref: '#/definitions/PerformanceExtentModel' - type: array - type: object - PlacementPolicyModel: - description: Backup file placement policy. - properties: - settings: - items: - $ref: '#/definitions/BackupPlacementSettingsModel' - type: array - type: - $ref: '#/definitions/EPlacementPolicyType' - required: - - type - - settings - type: object - PreferredNetworkModel: - properties: - cidrNotation: - description: CIDR notation. - type: string - ipAddress: - description: IP address. - type: string - subnetMask: - description: Subnet mask. - type: string - type: object - PreferredNetworksModel: - description: Preferred networks used for backup and replication traffic. - properties: - isEnabled: - description: 'If *true*, prefered networks are enabled.' - type: boolean - networks: - description: Array of networks. - items: - $ref: '#/definitions/PreferredNetworkModel' - type: array - required: - - isEnabled - type: object - PrimaryStorageIntegrationSettingsModel: - description: Primary storage integration settings for the backup job. - properties: - failoverToStandardBackup: - description: >- - If *true*, failover to the regular VM processing mode is enabled. In - this case, if backup from storage snapshot fails, VM snapshots are - used. - type: boolean - isEnabled: - description: >- - If *true*, the primary storage integration is enabled. In this case, - storage snapshots (instead of VM snapshots) are used for VM data - processing. - type: boolean - limitProcessedVm: - description: >- - If *true*, the number of processed VMs per storage snapshot is - limited. - type: boolean - limitProcessedVmCount: - description: Number of processed VMs per storage snapshot. - type: integer - required: - - isEnabled - type: object - PrivateKeyChangeSpec: - properties: - passphrase: - description: Passphrase that protects the private key. - type: string - privateKey: - description: Private key. - type: string - required: - - privateKey - type: object - ProxiesFilters: - properties: - hostIdFilter: - format: uuid - type: string - limit: - format: int32 - type: integer - nameFilter: - type: string - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/EProxiesFiltersOrderColumn' - skip: - format: int32 - type: integer - typeFilter: - $ref: '#/definitions/EProxyType' - type: object - ProxiesResult: - properties: - data: - description: Array of backup proxies. - items: - $ref: '#/definitions/ProxyModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - ProxyDatastoreModel: - properties: - datastore: - $ref: '#/definitions/VmwareObjectModel' - vmCount: - description: Number of VMs. - type: integer - type: object - ProxyDatastoreSettingsModel: - description: Datastores to which the backup proxy has a direct SAN or NFS connection. - properties: - autoSelect: - description: >- - If *true*, all datastores that the backup proxy can access are - detected automatically. - type: boolean - datastores: - description: >- - Array of datastores to which the backup proxy has a direct SAN or NFS - connection. - items: - $ref: '#/definitions/ProxyDatastoreModel' - type: array - required: - - autoSelect - type: object - ProxyExportSpec: - properties: - ids: - description: Array of backup proxy IDs. - items: - format: uuid - type: string - type: array - uniqueItems: true - names: - description: Array of backup proxy names. Wildcard characters are supported. - items: - type: string - type: array - uniqueItems: true - types: - description: Array of backup proxy types. - items: - $ref: '#/definitions/EProxyType' - type: array - uniqueItems: true - type: object - ProxyImportSpec: - properties: - description: - description: Description of the backup proxy. - type: string - server: - $ref: '#/definitions/ProxyServerSettingsImportSpec' - type: - $ref: '#/definitions/EProxyType' - required: - - description - - server - - type - type: object - ProxyImportSpecCollection: - properties: - proxies: - description: Array of backup proxies. - items: - $ref: '#/definitions/ProxyImportSpec' - type: array - uniqueItems: true - required: - - proxies - type: object - ProxyModel: - properties: - description: - description: Description of the backup proxy. - type: string - id: - description: ID of the backup proxy. - format: uuid - type: string - name: - description: Name of the backup proxy. - type: string - type: - $ref: '#/definitions/EProxyType' - required: - - id - - description - - name - - type - type: object - ProxyServerSettingsImportSpec: - description: Settings of the server that is used as a backup proxy. - properties: - connectedDatastores: - $ref: '#/definitions/ProxyDatastoreSettingsModel' - failoverToNetwork: - type: boolean - hostName: - description: Name of the server. - type: string - hostTag: - description: Tag assigned to the server. - type: string - hostToProxyEncryption: - description: > - [For the Network mode] If *true*, VM data is transferred over an - encrypted TLS connection. - type: boolean - maxTaskCount: - description: Maximum number of concurrent tasks. - type: integer - transportMode: - $ref: '#/definitions/EBackupProxyTransportMode' - required: - - hostName - type: object - ProxyServerSettingsModel: - description: Server settings for the backup proxy. - properties: - connectedDatastores: - $ref: '#/definitions/ProxyDatastoreSettingsModel' - failoverToNetwork: - description: > - [For the Direct storage access and Virtual appliance transport modes] - If *true*, Veeam Backup & Replication failovers to the network - transport mode in case the primary mode fails or is unavailable. - type: boolean - hostId: - description: ID of the server. - format: uuid - type: string - hostToProxyEncryption: - description: > - [For the Network mode] If *true*, VM data is transferred over an - encrypted TLS connection. - type: boolean - maxTaskCount: - description: Maximum number of concurrent tasks. - type: integer - transportMode: - $ref: '#/definitions/EBackupProxyTransportMode' - required: - - hostId - type: object - ProxySpec: - properties: - description: - description: Description of the backup proxy. - type: string - type: - $ref: '#/definitions/EProxyType' - required: - - description - - type - type: object - RepositoriesFilters: - properties: - hostIdFilter: - format: uuid - type: string - limit: - format: int32 - type: integer - nameFilter: - type: string - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/ERepositoryFiltersOrderColumn' - pathFilter: - type: string - skip: - format: int32 - type: integer - typeFilter: - $ref: '#/definitions/ERepositoryType' - vmbApiFilter: - description: >- - VmbApiFilterModel as json serialized in base64 format (see - VmbApiFilterModel) - type: string - type: object - RepositoriesResult: - properties: - data: - description: Array of backup repositories. - items: - $ref: '#/definitions/RepositoryModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - RepositoryAdvancedSettingsModel: - description: Advanced settings for the backup repository. - properties: - alignDataBlocks: - description: >- - If *true*, Veeam Backup & Replication aligns VM data saved to a backup - file at a 4 KB block boundary. - type: boolean - decompressBeforeStoring: - description: >- - If *true*, Veeam Backup & Replication decompresses backup data blocks - before storing to improve deduplication ratios. - type: boolean - perVmBackup: - description: >- - If *true*, Veeam Backup & Replication creates a separate backup file - for every VM in the job. - type: boolean - rotatedDrives: - description: 'If *true*, the repository drive is rotated.' - type: boolean - type: object - RepositoryExportSpec: - properties: - ids: - description: Array of backup repository IDs. - items: - format: uuid - type: string - type: array - uniqueItems: true - names: - description: Array of repository names. Wildcard characters are supported. - items: - type: string - type: array - uniqueItems: true - types: - description: Array of backup repository types. - items: - $ref: '#/definitions/ERepositoryType' - type: array - uniqueItems: true - type: object - RepositoryImportSpecCollection: - properties: - LinuxLocalRepositories: - description: Array of linux local storages. - items: - $ref: '#/definitions/LinuxLocalStorageImportSpec' - type: array - uniqueItems: true - NfsRepositories: - description: Array of network attached storages. - items: - $ref: '#/definitions/NfsStorageImportSpec' - type: array - uniqueItems: true - SmbRepositories: - description: Array of network attached storages. - items: - $ref: '#/definitions/SmbStorageImportSpec' - type: array - uniqueItems: true - WindowsLocalRepositories: - description: Array of windows local storages. - items: - $ref: '#/definitions/WindowsLocalStorageImportSpec' - type: array - uniqueItems: true - type: object - RepositoryModel: - properties: - description: - description: Description of the backup repository. - type: string - id: - description: ID of the backup repository. - format: uuid - type: string - name: - description: Name of the backup repository. - type: string - tag: - description: VMware vSphere tag assigned to the backup repository. - type: string - type: - $ref: '#/definitions/ERepositoryType' - required: - - description - - id - - name - - type - type: object - RepositoryShareGatewayImportSpec: - description: Settings for the gateway server. - properties: - autoSelect: - description: >- - If *true*, Veeam Backup & Replication automatically selects a gateway - server. - type: boolean - gatewayServerName: - description: Name of the gateway server. - type: string - type: object - RepositoryShareGatewayModel: - description: Settings for the gateway server. - properties: - autoSelect: - description: >- - If *true*, Veeam Backup & Replication automatically selects a gateway - server. - type: boolean - gatewayServerId: - description: ID of the gateway server. - format: uuid - type: string - type: object - RepositorySpec: - properties: - description: - description: Description of the backup repository. - type: string - name: - description: Name of the backup repository. - type: string - tag: - description: VMware vSphere tag assigned to the backup repository. - type: string - type: - $ref: '#/definitions/ERepositoryType' - required: - - description - - name - - type - type: object - RepositoryStateModel: - properties: - capacityGB: - description: Repository capacity in GB. - format: double - type: number - description: - type: string - freeGB: - description: Repository free space in GB. - format: double - type: number - hostId: - description: ID of the server that is used as a backup repository. - format: uuid - type: string - hostName: - description: Name of the server that is used as a backup repository. - type: string - id: - description: ID of the backup repository. - format: uuid - type: string - name: - description: Name of the backup repository. - type: string - path: - description: Path to the folder where backup files are stored. - type: string - type: - $ref: '#/definitions/ERepositoryType' - usedSpaceGB: - description: Repository used space in GB. - format: double - type: number - required: - - id - - name - - type - - description - - capacityGB - - freeGB - - usedSpaceGB - type: object - RepositoryStatesFilters: - description: Filters repositories by the specified parameters. - properties: - capacityFilter: - description: Filters repositories by repository capacity. - format: double - type: number - freeSpaceFilter: - description: Filters repositories by repository free space. - format: double - type: number - idFilter: - format: uuid - type: string - limit: - description: Returns the specified number of repositories. - format: int32 - type: integer - nameFilter: - description: >- - Filters repositories by the `nameFilter` pattern. The pattern can - match any repository parameter. To substitute one or more characters, - use the asterisk (*) character at the beginning and/or at the end. - type: string - orderAsc: - description: >- - Sorts repositories in the ascending order by the `orderColumn` - parameter. - type: boolean - orderColumn: - $ref: '#/definitions/ERepositoryStatesFiltersOrderColumn' - skip: - description: Skips the specified number of repositories. - format: int32 - type: integer - typeFilter: - $ref: '#/definitions/ERepositoryType' - usedSpaceFilter: - description: Filters repositories by repository used space. - format: double - type: number - type: object - RepositoryStatesResult: - properties: - data: - description: Array of repository states. - items: - $ref: '#/definitions/RepositoryStateModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - ScaleOutExtentMaintenanceSpec: - properties: - repositoryIds: - items: - format: uuid - type: string - type: array - required: - - repositoryIds - type: object - ScaleOutRepositoriesFilters: - properties: - limit: - description: Maximum number of repositories to return. - format: int32 - type: integer - nameFilter: - description: >- - Filters repositories by the `nameFilter` substring. The substring can - be part of any repository parameter. - type: string - orderAsc: - description: >- - Sorts repositories in the ascending order by the `orderColumn` - parameter. - type: boolean - orderColumn: - $ref: '#/definitions/EScaleOutRepositoryFiltersOrderColumn' - skip: - description: Number of repositories to skip. - format: int32 - type: integer - type: object - ScaleOutRepositoriesResult: - properties: - data: - description: Array of scale-out backup repositories. - items: - $ref: '#/definitions/ScaleOutRepositoryModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - ScaleOutRepositoryModel: - properties: - archiveTier: - $ref: '#/definitions/ArchiveTierModel' - capacityTier: - $ref: '#/definitions/CapacityTierModel' - description: - description: Description of the scale-out backup repository. - type: string - id: - description: ID of the scale-out backup repository. - format: uuid - type: string - name: - description: Name of the scale-out backup repository. - type: string - performanceTier: - $ref: '#/definitions/PerformanceTierModel' - placementPolicy: - $ref: '#/definitions/PlacementPolicyModel' - tag: - description: Tag assigned to of the scale-out backup repository. - type: string - required: - - id - - name - - description - - tag - - performanceTier - type: object - ScheduleAfterThisJobModel: - description: Job chaining options. - properties: - isEnabled: - description: 'If *true*, job chaining is enabled.' - type: boolean - jobName: - description: Name of the preceding job. - type: string - required: - - isEnabled - type: object - ScheduleBackupWindowModel: - properties: - WindowSetting: - $ref: '#/definitions/BackupWindowSettingModel' - isEnabled: - default: false - description: 'If *true*, periodic schedule is enabled.' - type: boolean - required: - - isEnabled - type: object - ScheduleDailyModel: - description: Daily scheduling options. - properties: - dailyKind: - $ref: '#/definitions/EDailyKinds' - days: - description: Days of the week when the job must start. - items: - $ref: '#/definitions/EDayOfWeek' - type: array - uniqueItems: true - isEnabled: - default: true - description: 'If *true*, daily schedule is enabled.' - type: boolean - localTime: - description: Local time when the job must start. - format: time - type: string - required: - - isEnabled - type: object - ScheduleMonthlyModel: - description: Monthly scheduling options. - properties: - dayNumberInMonth: - $ref: '#/definitions/EDayNumberInMonth' - dayOfMonth: - description: Day of the month when the job must start. - type: integer - dayOfWeek: - $ref: '#/definitions/EDayOfWeek' - isEnabled: - default: false - description: 'If *true*, monthly schedule is enabled.' - type: boolean - localTime: - description: Local time when the job must start. - format: time - type: string - months: - description: Months when the job must start. - items: - $ref: '#/definitions/EMonth' - type: array - uniqueItems: true - required: - - isEnabled - type: object - SchedulePeriodicallyModel: - description: Periodic scheduling options. - properties: - backupWindow: - $ref: '#/definitions/BackupWindowSettingModel' - frequency: - description: Number of time units that defines the time interval. - type: integer - isEnabled: - default: false - description: 'If *true*, periodic schedule is enabled.' - type: boolean - periodicallyKind: - $ref: '#/definitions/EPeriodicallyKinds' - required: - - isEnabled - type: object - ScheduleRetryModel: - description: Retry options. - properties: - awaitMinutes: - description: Time interval between job retries in minutes. - type: integer - isEnabled: - default: false - description: 'If *true*, retry options are enabled.' - type: boolean - retryCount: - description: Number of retries set for the job. - type: integer - type: object - ScriptCommand: - description: Script settings. - properties: - command: - description: Path to the script. - type: string - isEnabled: - description: 'If *true*, script execution is enabled.' - type: boolean - required: - - isEnabled - type: object - ServerTimeModel: - properties: - serverTime: - description: Current date and time on the server. - format: date-time - type: string - timeZone: - type: string - required: - - serverTime - type: object - ServicesFilters: - properties: - limit: - format: int32 - type: integer - nameFilter: - type: string - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/EServicesFiltersOrderColumn' - skip: - format: int32 - type: integer - type: object - ServicesModel: - properties: - name: - description: Name of the service. - type: string - port: - description: Port used to communicate with the service. - type: integer - required: - - name - - port - type: object - ServicesResult: - properties: - data: - description: Array of services. - items: - $ref: '#/definitions/ServicesModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - SessionLogRecordModel: - description: Record of the session log. - properties: - description: - description: Description of the log record. - type: string - id: - description: ID of the log record. - type: integer - startTime: - description: Date and time the operation was started. - format: date-time - type: string - status: - $ref: '#/definitions/ETaskLogRecordStatus' - description: Status of the operation described by the log record. - title: - description: Title of the log record. - type: string - updateTime: - description: Date and time the log record was updated. - format: date-time - type: string - type: object - SessionLogResult: - description: Log of the session. - properties: - records: - description: Array of log records. - items: - $ref: '#/definitions/SessionLogRecordModel' - type: array - totalRecords: - description: Total number of records. - type: integer - type: object - SessionModel: - properties: - activityId: - description: ID of the activity. - format: uuid - type: string - creationTime: - description: Date and time the session was created. - format: date-time - type: string - endTime: - description: Date and time the session was ended. - format: date-time - type: string - id: - description: ID of the session. - format: uuid - type: string - name: - description: Name of the session. - type: string - parentSessionId: - description: ID of the parent session. - format: uuid - type: string - progressPercent: - description: Progress percentage of the session. - type: integer - resourceId: - description: ID of the resource. - format: uuid - type: string - resourceReference: - description: URI of the resource. - type: string - result: - $ref: '#/definitions/SessionResultModel' - sessionType: - $ref: '#/definitions/ESessionType' - state: - $ref: '#/definitions/ESessionState' - usn: - description: Update sequence number. - format: int64 - type: integer - required: - - activityId - - creationTime - - id - - name - - sessionType - - state - - usn - type: object - SessionResultModel: - properties: - isCanceled: - description: 'If *true*, the session has been canceled.' - type: boolean - message: - description: Message that explains the session result. - type: string - result: - $ref: '#/definitions/ESessionResult' - required: - - result - type: object - SessionsFilters: - properties: - createdAfterFilter: - format: date-time - type: string - createdBeforeFilter: - format: date-time - type: string - endedAfterFilter: - format: date-time - type: string - endedBeforeFilter: - format: date-time - type: string - jobIdFilter: - format: uuid - type: string - limit: - format: int32 - type: integer - nameFilter: - type: string - orderAsc: - type: boolean - orderColumn: - $ref: '#/definitions/ESessionsFiltersOrderColumn' - resultFilter: - $ref: '#/definitions/ESessionResult' - skip: - format: int32 - type: integer - stateFilter: - $ref: '#/definitions/ESessionState' - typeFilter: - $ref: '#/definitions/ESessionType' - type: object - SessionsResult: - properties: - data: - description: Array of sessions. - items: - $ref: '#/definitions/SessionModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - SmbRepositoryShareSettingsModel: - description: Share settings. - properties: - credentialsId: - description: ID of the credentials record used to access the shared folder. - format: uuid - type: string - gatewayServer: - $ref: '#/definitions/RepositoryShareGatewayModel' - sharePath: - description: Path to the shared folder that that is used as a backup repository. - type: string - required: - - credentialsId - - sharePath - type: object - SmbRepositoryShareSettingsSpec: - properties: - credentials: - $ref: '#/definitions/CredentialsImportModel' - gatewayServer: - $ref: '#/definitions/RepositoryShareGatewayImportSpec' - sharePath: - description: Path to the shared folder that that is used as a backup repository. - type: string - required: - - credentials - - sharePath - type: object - SmbStorageImportSpec: - properties: - description: - description: Description of the backup repository. - type: string - mountServer: - $ref: '#/definitions/MountServerSettingsImportSpec' - name: - description: Name of the backup repository. - type: string - repository: - $ref: '#/definitions/NetworkRepositorySettingsModel' - share: - $ref: '#/definitions/SmbRepositoryShareSettingsSpec' - tag: - description: VMware vSphere tag assigned to the backup repository. - type: string - type: - $ref: '#/definitions/ERepositoryType' - required: - - description - - mountServer - - name - - repository - - share - - tag - - type - type: object - SmbStorageModel: - allOf: - - $ref: '#/definitions/RepositoryModel' - - properties: - mountServer: - $ref: '#/definitions/MountServerSettingsModel' - repository: - $ref: '#/definitions/NetworkRepositorySettingsModel' - share: - $ref: '#/definitions/SmbRepositoryShareSettingsModel' - required: - - mountServer - - repository - - share - type: object - description: Network attached storage. - SmbStorageSpec: - allOf: - - $ref: '#/definitions/RepositorySpec' - - properties: - mountServer: - $ref: '#/definitions/MountServerSettingsModel' - repository: - $ref: '#/definitions/NetworkRepositorySettingsModel' - share: - $ref: '#/definitions/SmbRepositoryShareSettingsModel' - required: - - mountServer - - repository - - share - type: object - StandardCredentialsModel: - allOf: - - $ref: '#/definitions/CredentialsModel' - - properties: - tag: - description: Tag used to identify the credentials record. - type: string - type: object - StandardCredentialsSpec: - allOf: - - $ref: '#/definitions/CredentialsSpec' - - properties: - tag: - description: Tag used to identify the credentials record. - type: string - type: object - SyntheticFullSettingsModel: - description: Synthetic full backup settings. - properties: - days: - description: >- - Days of the week when Veeam Backup & Replication creates a synthetic - full backup. - items: - $ref: '#/definitions/EDayOfWeek' - type: array - uniqueItems: true - isEnabled: - description: 'If *true*, synthetic full backups are enabled.' - type: boolean - required: - - isEnabled - type: object - TokenLoginSpec: - properties: - code: - description: >- - Authorization code. Required if the `grant_type` value is - `authorization_code`. - type: string - grant_type: - $ref: '#/definitions/ELoginGrantType' - password: - description: Password. Required if the `grant_type` value is `password`. - format: password - type: string - refresh_token: - description: Refresh token. Required if the `grant_type` value is `refresh_token`. - type: string - use_short_term_refresh: - description: >- - If *true*, a short-term refresh token is used. Lifetime of the - short-term refresh token is the access token lifetime plus 15 minutes. - type: boolean - username: - description: User name. Required if the `grant_type` value is `password`. - type: string - required: - - grant_type - type: object - TokenModel: - properties: - .expires: - description: Date and time the access token expires. - format: date-time - type: string - .issued: - description: Date and time the access token is issued. - format: date-time - type: string - access_token: - description: >- - String that represents authorization issued to the client. It must be - specified in all requests. An access token can be used multiple times, - but its lifetime is 15 minutes. - type: string - expires_in: - description: 'Lifetime of the access token, in seconds.' - format: int32 - type: integer - refresh_token: - description: >- - String that is used to obtain a new access token if the current access - token expires or becomes lost. A refresh token can be used only once, - and its default lifetime is 14 days. - type: string - token_type: - description: Type of the access token. - type: string - required: - - .expires - - .issued - - access_token - - expires_in - - refresh_token - - token_type - type: object - TrafficRuleModel: - properties: - encryptionEnabled: - description: 'If *true*, traffic encryption is enabled.' - type: boolean - id: - description: ID of the rule. - format: uuid - type: string - name: - description: Name of the rule. - type: string - sourceIPEnd: - description: >- - End IP address of the range for the backup infrastructure components - on the source side. - type: string - sourceIPStart: - description: >- - Start IP address of the range for the backup infrastructure components - on the source side. - type: string - targetIPEnd: - description: >- - End IP address of the range for the backup infrastructure components - on the target side. - type: string - targetIPStart: - description: >- - Start IP address of the range for the backup infrastructure components - on the target side. - type: string - throttlingEnabled: - description: 'If *true*, traffic throttling is enabled.' - type: boolean - throttlingUnit: - $ref: '#/definitions/ESpeedUnit' - throttlingValue: - description: >- - Maximum speed that must be used to transfer data from source to - target. - format: int32 - type: integer - throttlingWindowEnabled: - description: >- - If *true*, throttling window during which the speed must be limited is - enabled. - type: boolean - throttlingWindowOptions: - $ref: '#/definitions/BackupWindowSettingModel' - required: - - name - - sourceIPStart - - sourceIPEnd - - targetIPStart - - targetIPEnd - type: object - VCenterInventoryFilters: - properties: - hierarchyTypeFilter: - $ref: '#/definitions/EHierarchyType' - limit: - description: Maximum number of objects to return. - format: int32 - type: integer - nameFilter: - description: >- - Filters objects by the `nameFilter` pattern. The pattern can match any - object parameter. To substitute one or more characters, use the - asterisk (*) character at the beginning and/or at the end. - type: string - objectIdFilter: - description: Filters objects by object ID. - type: string - orderAsc: - description: Sorts objects in the ascending order by the `orderColumn` parameter. - type: boolean - orderColumn: - $ref: '#/definitions/EvCentersInventoryFiltersOrderColumn' - parentContainerNameFilter: - description: Filters objects by name of the parent container. - type: string - skip: - description: Number of objects to skip. - format: int32 - type: integer - typeFilter: - $ref: '#/definitions/EVmwareInventoryType' - type: object - VCenterInventoryResult: - properties: - data: - description: Array of vCenter Servers. - items: - $ref: '#/definitions/VmwareObjectSizeModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - VPowerNFSPortSettingsModel: - description: Network ports used by the vPower NFS Service. - properties: - mountPort: - description: Mount port. - type: integer - vPowerNFSPort: - description: vPower NFS port. - type: integer - type: object - VSphereChangedBlockTrackingSettingsModel: - description: CBT settings for the backup job. - properties: - enableCBTautomatically: - description: >- - If *true*, CBT is enabled for all processed VMs even if CBT is - disabled in VM configuration. CBT is used for VMs with virtual - hardware version 7 or later. These VMs must not have existing - snapshots. - type: boolean - isEnabled: - description: 'If *true*, CBT data is used.' - type: boolean - resetCBTonActiveFull: - description: 'If *true*, CBT is reset before creating active full backups.' - type: boolean - required: - - isEnabled - type: object - ViBackupObjectModel: - allOf: - - $ref: '#/definitions/BackupObjectModel' - - properties: - objectId: - description: > - ID of the virtual infrastructure object: mo-ref or ID, depending - on the virtualization platform. - type: string - path: - description: Path to the object. - type: string - viType: - $ref: '#/definitions/EVmwareInventoryType' - required: - - server - type: object - ViHostImportSpec: - properties: - certificateThumbprint: - description: | - [Optional] Certificate thumbprint used to verify the server identity. - type: string - credentials: - $ref: '#/definitions/CredentialsImportModel' - description: - description: Description of the server. - type: string - name: - description: Full DNS name or IP address of the server. - type: string - port: - description: Port used to communicate with the server. - type: integer - type: - $ref: '#/definitions/EManagedServerType' - viHostType: - $ref: '#/definitions/EViHostType' - required: - - credentials - - description - - name - - type - - viHostType - type: object - ViHostModel: - allOf: - - $ref: '#/definitions/ManagedServerModel' - - properties: - port: - description: Port used to communicate with the server. - type: integer - viHostType: - $ref: '#/definitions/EViHostType' - required: - - port - type: object - ViHostSpec: - allOf: - - $ref: '#/definitions/ManagedServerSpec' - - properties: - certificateThumbprint: - description: > - [Optional] Certificate thumbprint used to verify the server - identity. For details on how to get the thumbprint, see [Get TLS - Certificate or SSH - Fingerprint](#operation/GetConnectionCertificate). - type: string - port: - description: Port used to communicate with the server. - type: integer - type: object - ViProxyModel: - allOf: - - $ref: '#/definitions/ProxyModel' - - properties: - server: - $ref: '#/definitions/ProxyServerSettingsModel' - required: - - server - type: object - ViProxySpec: - allOf: - - $ref: '#/definitions/ProxySpec' - - properties: - server: - $ref: '#/definitions/ProxyServerSettingsModel' - required: - - server - type: object - ViRootFilters: - properties: - limit: - description: Maximum number of VMware vSphere servers to return. - format: int32 - type: integer - nameFilter: - description: >- - Filters VMware vSphere servers by the `nameFilter` pattern. The - pattern can match any VMware vSphere server parameter. To substitute - one or more characters, use the asterisk (*) character at the - beginning and/or at the end. - type: string - orderAsc: - description: >- - Sorts VMware vSphere servers in the ascending order by the - `orderColumn` parameter. - type: boolean - orderColumn: - $ref: '#/definitions/EViRootFiltersOrderColumn' - skip: - description: Number of VMware vSphere servers to skip. - format: int32 - type: integer - type: object - ViRootsResult: - properties: - data: - description: Array of VMware vSphere servers. - items: - $ref: '#/definitions/VmwareObjectSizeModel' - type: array - pagination: - $ref: '#/definitions/PaginationResult' - required: - - data - - pagination - type: object - VmbApiFilterModel: - properties: - assemblyVersion: - type: string - productId: - format: uuid - type: string - protocolVersion: - type: integer - versionFlags: - type: integer - required: - - protocolVersion - - assemblyVersion - - productId - - versionFlags - type: object - VmwareFcdInstantRecoveryDiskInfo: - properties: - mountedDiskName: - description: Name of the VMDK file that is stored in the datastore. - type: string - nameInBackup: - description: Disk name displayed in the backup. - type: string - objectId: - description: FCD ID. - type: string - registeredFcdName: - description: >- - Name under which the disk is registered as an FCD in the vCenter - Managed Object Browser. - type: string - required: - - nameInBackup - - mountedDiskName - - registeredFcdName - - objectId - type: object - VmwareFcdInstantRecoveryDiskSpec: - properties: - mountedDiskName: - description: Name of the VMDK file that will be stored in the datastore. - type: string - nameInBackup: - description: Disk name displayed in the backup. - type: string - registeredFcdName: - description: >- - Name under which the disk will be registered as an FCD in the vCenter - Managed Object Browser. - type: string - required: - - nameInBackup - - mountedDiskName - - registeredFcdName - type: object - VmwareFcdInstantRecoveryMount: - properties: - errorMessage: - type: string - id: - description: Mount ID. - format: uuid - type: string - mountedDisks: - description: Array of mounted disks. - items: - $ref: '#/definitions/VmwareFcdInstantRecoveryDiskInfo' - type: array - sessionId: - description: >- - ID of the restore session. Use the ID to track the progress. For - details, see [Get Session](#operation/GetSession). - format: uuid - type: string - spec: - $ref: '#/definitions/VmwareFcdInstantRecoverySpec' - state: - $ref: '#/definitions/EInstantRecoveryMountState' - required: - - id - - sessionId - - state - - spec - type: object - VmwareFcdInstantRecoverySpec: - properties: - destinationCluster: - allOf: - - $ref: '#/definitions/VmwareObjectModel' - description: Destination cluster. - disksMapping: - description: Array of disks that will be restored. - items: - $ref: '#/definitions/VmwareFcdInstantRecoveryDiskSpec' - type: array - objectRestorePointId: - description: ID of the restore point. - format: uuid - type: string - writeCache: - $ref: '#/definitions/VmwareFcdWriteCacheSpec' - required: - - objectRestorePointId - - destinationCluster - - disksMapping - type: object - VmwareFcdQuickMigrationSpec: - properties: - mountedDiskNames: - description: >- - Array of disks that will be migrated to the `targetDatastore` - associated with the `storagePolicy`. - items: - type: string - type: array - storagePolicy: - allOf: - - $ref: '#/definitions/VmwareObjectModel' - description: >- - Storage policy that will be applied to the migrated disks. For details - on how to get a storage policy model, see [Get VMware vSphere Server - Objects](#operation/GetVmwareHostObject). - targetDatastore: - allOf: - - $ref: '#/definitions/VmwareObjectModel' - description: >- - Target datastore. For details on how to get a datastore model, see - [Get VMware vSphere Server Objects](#operation/GetVmwareHostObject). - required: - - targetDatastore - type: object - VmwareFcdWriteCacheSpec: - description: Write cache for recovered disks. - properties: - cacheDatastore: - $ref: '#/definitions/VmwareObjectModel' - redirectIsEnabled: - description: >- - If *true*, cache redirection is enabled. In this case, all changes - made to the recovered disks while the Instant FCD Recovery is active - are redirected to the specified `cacheDatastore` associated with the - `storagePolicy`. - type: boolean - storagePolicy: - $ref: '#/definitions/VmwareObjectModel' - required: - - redirectIsEnabled - type: object - VmwareObjectDiskModel: - properties: - disks: - description: Array of disks. - items: - description: ID of the disk. - type: string - type: array - disksToProcess: - $ref: '#/definitions/EVmwareDisksTypeToProcess' - removeFromVMConfiguration: - description: 'If *true*, the disk is removed from VM configuration.' - type: boolean - vmObject: - $ref: '#/definitions/VmwareObjectModel' - required: - - disks - - disksToProcess - - vmObject - type: object - VmwareObjectModel: - description: VMware object. - properties: - hostName: - description: Name of the host. - type: string - name: - description: Name of the VMware vSphere object. - type: string - objectId: - description: ID of the VMware vSphere object. - type: string - type: - $ref: '#/definitions/EVmwareInventoryType' - required: - - name - - type - - hostName - type: object - VmwareObjectSizeModel: - properties: - inventoryObject: - $ref: '#/definitions/VmwareObjectModel' - size: - description: Size used by the VMware vSphere object. - type: string - required: - - inventoryObject - type: object - WindowsHostComponentPortModel: - description: Ports used by Veeam Backup & Replication components. - properties: - componentName: - $ref: '#/definitions/EWindowsHostComponentType' - port: - description: Port used by the component. - type: integer - required: - - componentName - - port - type: object - WindowsHostImportSpec: - properties: - credentials: - $ref: '#/definitions/CredentialsImportModel' - description: - description: Description of the server. - type: string - name: - description: Full DNS name or IP address of the server. - type: string - networkSettings: - $ref: '#/definitions/WindowsHostPortsModel' - type: - $ref: '#/definitions/EManagedServerType' - required: - - description - - name - - type - type: object - WindowsHostModel: - allOf: - - $ref: '#/definitions/ManagedServerModel' - - properties: - networkSettings: - $ref: '#/definitions/WindowsHostPortsModel' - type: object - WindowsHostPortsModel: - description: Network ports. - properties: - components: - items: - $ref: '#/definitions/WindowsHostComponentPortModel' - type: array - portRangeEnd: - description: End port used for data transfer. - type: integer - portRangeStart: - description: Start port used for data transfer. - type: integer - serverThisSide: - description: 'If *true*, the server is run on this side.' - type: boolean - type: object - WindowsHostSpec: - allOf: - - $ref: '#/definitions/ManagedServerSpec' - - properties: - networkSettings: - $ref: '#/definitions/WindowsHostPortsModel' - type: object - WindowsLocalRepositorySettingsModel: - description: Repository settings. - properties: - advancedSettings: - $ref: '#/definitions/RepositoryAdvancedSettingsModel' - maxTaskCount: - description: Maximum number of concurrent tasks. - type: integer - path: - description: Path to the folder where backup files are stored. - type: string - readWriteRate: - description: >- - Maximum rate that restricts the total speed of reading and writing - data to the backup repository disk. - type: integer - type: object - WindowsLocalStorageImportSpec: - properties: - description: - description: Description of the backup repository. - type: string - hostName: - description: ID of the server that is used as a backup repository. - type: string - mountServer: - $ref: '#/definitions/MountServerSettingsImportSpec' - name: - description: Name of the backup repository. - type: string - repository: - $ref: '#/definitions/WindowsLocalRepositorySettingsModel' - tag: - description: VMware vSphere tag assigned to the backup repository. - type: string - type: - $ref: '#/definitions/ERepositoryType' - required: - - description - - hostName - - mountServer - - name - - repository - - tag - - type - type: object - WindowsLocalStorageModel: - allOf: - - $ref: '#/definitions/RepositoryModel' - - properties: - hostId: - description: ID of the server that is used as a backup repository. - format: uuid - type: string - mountServer: - $ref: '#/definitions/MountServerSettingsModel' - repository: - $ref: '#/definitions/WindowsLocalRepositorySettingsModel' - required: - - hostId - - mountServer - - repository - type: object - description: Direct attached storage. - WindowsLocalStorageSpec: - allOf: - - $ref: '#/definitions/RepositorySpec' - - properties: - hostId: - description: ID of the server that is used as a backup repository. - format: uuid - type: string - mountServer: - $ref: '#/definitions/MountServerSettingsModel' - repository: - $ref: '#/definitions/WindowsLocalRepositorySettingsModel' - required: - - hostId - - mountServer - - repository - type: object -securityDefinitions: - Bearer: - description: Access token in the *Bearer \* format. - in: header - name: Authorization - type: apiKey -security: - - Bearer: [] -tags: - - description: > - The authorization process involves obtaining an access token and a refresh - token.
For details on the authorization process and security settings, - see the [Authorization and - Security](https://helpcenter.veeam.com/docs/backup/vbr_rest/authorization_security.html) - section of the Veeam Backup & Replication REST API Reference. - name: Login - - description: > - The Service section defines paths and operations for retrieving current - date and time and a certificate of the backup server where the REST API - service is running. - name: Service - - description: > - The Services section defines a path and operation for retrieving - information about associated backend services. You may need to connect to - these services for integration with Veeam Backup & Replication only. - name: Services - - description: > - The Traffic Rules section defines paths and operations for retrieving and - editing information about network traffic rules that are configured on the - backup server. - name: Traffic Rules - - description: > - The General Options section defines paths and operations for retrieving - and editing general options of Veeam Backup & Replication. - name: General Options - - description: > - The Configuration Backup section defines paths and operations for - retrieving and editing general options of Veeam Backup & Replication. - name: Configuration Backup - - description: > - The Sessions section defines paths and operations for managing sessions - (except [automation sessions](#operation/GetAllAutomationSessions)) - performed on the backup server. - name: Sessions - - description: > - The Connection section defines a path and operation for retrieving a TLS - certificate or SSH fingerprint used to establish a secure connection - between the backup server and the specified server. - name: Connection - - description: > - The Inventory Browser section defines paths and operations for retrieving - VMware vSphere servers and their virtual infrastructure objects - (datacenters, clusters, hosts, resource pools, VMs).
NOTE
In the current version, you can - browse VMware vSphere objects only.
- name: Inventory Browser - - description: > - The Managed Servers section defines paths and operations for managing - servers that are added to the backup infrastructure.
NOTE
In the current version, the REST API - supports the following server types: VMware vSphere, Linux and - Windows.
- name: Managed Servers - - description: > - The Repositories section defines paths and operations for managing backup - repositories that are added to the backup infrastructure.
NOTE
In the current version, the REST API - supports direct attached and network attached storages only.
- name: Repositories - - description: > - The Proxies section defines paths and operations for managing backup - proxies that are added to the backup infrastructure.
NOTE
In the current version, the REST API - supports VMware backup proxies only.
- name: Proxies - - description: > - The Jobs section defines paths and operations for managing jobs that are - coordinated by the backup server.
NOTE
In the current version, the REST API - supports backup jobs with VMware VMs only.
- name: Jobs - - description: > - The Credentials section defines paths and operations for managing - credentials records that are added to the backup server. - name: Credentials - - description: >- - The Encryption section defines paths and operations for managing passwords - that are used for data encryption. - name: Encryption - - description: >- - The Backups section defines paths and operations for managing backups that - are created on or imported to the backup server. - name: Backups - - description: > - The Backup Objects section defines paths and operations for managing - backup objects — virtual infrastructure objects (VMs and VM containers) - that are inсluded in backups created by the backup server. - name: Backup Objects - - description: >- - The Object Restore Points section defines paths and operations for - retrieving restore points created on the backup server and backed up disks - from the restore points. - name: Object Restore Points - - description: > - The Restore section defines paths and operations for performing - restore.
NOTE
In the current - version, you can restore only disks that will be registered as First Class - Disks (FCD) — a type of virtual disks that can be managed independent of - any VM.
- name: Restore - - description: > - The Automation section defines paths and operations for granular import - and export of objects available in the REST API. It can be useful, for - example, if you set up the backup infrastructure using JSON specification - or migrate the infrastructure to another backup server. For details, see - [Mass - Deployment](https://helpcenter.veeam.com/docs/backup/vbr_rest/automation.html). - name: Automation -x-components: - parameters: - apiVersionParam: - default: 1.0-rev1 - description: | - Version and revision of the client REST API. Must be in the following - format: *\-\*. - in: header - name: x-api-version - required: true - type: string - responses: - BadRequest: - content: - application/json: - schema: - $ref: '#/definitions/Error' - description: >- - Bad request. This error is related to POST/PUT requests. The request - body is malformed, incomplete or otherwise invalid. - Deleted: - content: - application/json: - schema: - $ref: '#/definitions/EmptySuccessResponse' - description: Removed. - Forbidden: - content: - application/json: - schema: - $ref: '#/definitions/Error' - description: >- - Forbidden. The user sending the request does not have adequate - privileges to access one or more objects specified in the request. - InternalServerError: - content: - application/json: - schema: - $ref: '#/definitions/Error' - description: >- - Internal server error. The request has been received but could not be - completed because of an internal error at the server side. - NotFound: - content: - application/json: - schema: - $ref: '#/definitions/Error' - description: >- - Not found. No object was found with the path parameter specified in the - request. - Unauthorized: - content: - application/json: - schema: - $ref: '#/definitions/Error' - description: >- - Unauthorized. The authorization header has been expected but not found - (or found but is expired). - diff --git a/vendor/github.com/PuerkitoBio/purell/.gitignore b/vendor/github.com/PuerkitoBio/purell/.gitignore deleted file mode 100644 index 748e4c8..0000000 --- a/vendor/github.com/PuerkitoBio/purell/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.sublime-* -.DS_Store -*.swp -*.swo -tags diff --git a/vendor/github.com/PuerkitoBio/purell/.travis.yml b/vendor/github.com/PuerkitoBio/purell/.travis.yml deleted file mode 100644 index cf31e6a..0000000 --- a/vendor/github.com/PuerkitoBio/purell/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go - -go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - "1.10.x" - - "1.11.x" - - tip diff --git a/vendor/github.com/PuerkitoBio/purell/LICENSE b/vendor/github.com/PuerkitoBio/purell/LICENSE deleted file mode 100644 index 4b9986d..0000000 --- a/vendor/github.com/PuerkitoBio/purell/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012, Martin Angers -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/PuerkitoBio/purell/README.md b/vendor/github.com/PuerkitoBio/purell/README.md deleted file mode 100644 index 07de0c4..0000000 --- a/vendor/github.com/PuerkitoBio/purell/README.md +++ /dev/null @@ -1,188 +0,0 @@ -# Purell - -Purell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell. Sanitizer and all. Yeah, I know... - -Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc]. - -[![build status](https://travis-ci.org/PuerkitoBio/purell.svg?branch=master)](http://travis-ci.org/PuerkitoBio/purell) - -## Install - -`go get github.com/PuerkitoBio/purell` - -## Changelog - -* **v1.1.1** : Fix failing test due to Go1.12 changes (thanks to @ianlancetaylor). -* **2016-11-14 (v1.1.0)** : IDN: Conform to RFC 5895: Fold character width (thanks to @beeker1121). -* **2016-07-27 (v1.0.0)** : Normalize IDN to ASCII (thanks to @zenovich). -* **2015-02-08** : Add fix for relative paths issue ([PR #5][pr5]) and add fix for unnecessary encoding of reserved characters ([see issue #7][iss7]). -* **v0.2.0** : Add benchmarks, Attempt IDN support. -* **v0.1.0** : Initial release. - -## Examples - -From `example_test.go` (note that in your code, you would import "github.com/PuerkitoBio/purell", and would prefix references to its methods and constants with "purell."): - -```go -package purell - -import ( - "fmt" - "net/url" -) - -func ExampleNormalizeURLString() { - if normalized, err := NormalizeURLString("hTTp://someWEBsite.com:80/Amazing%3f/url/", - FlagLowercaseScheme|FlagLowercaseHost|FlagUppercaseEscapes); err != nil { - panic(err) - } else { - fmt.Print(normalized) - } - // Output: http://somewebsite.com:80/Amazing%3F/url/ -} - -func ExampleMustNormalizeURLString() { - normalized := MustNormalizeURLString("hTTpS://someWEBsite.com:443/Amazing%fa/url/", - FlagsUnsafeGreedy) - fmt.Print(normalized) - - // Output: http://somewebsite.com/Amazing%FA/url -} - -func ExampleNormalizeURL() { - if u, err := url.Parse("Http://SomeUrl.com:8080/a/b/.././c///g?c=3&a=1&b=9&c=0#target"); err != nil { - panic(err) - } else { - normalized := NormalizeURL(u, FlagsUsuallySafeGreedy|FlagRemoveDuplicateSlashes|FlagRemoveFragment) - fmt.Print(normalized) - } - - // Output: http://someurl.com:8080/a/c/g?c=3&a=1&b=9&c=0 -} -``` - -## API - -As seen in the examples above, purell offers three methods, `NormalizeURLString(string, NormalizationFlags) (string, error)`, `MustNormalizeURLString(string, NormalizationFlags) (string)` and `NormalizeURL(*url.URL, NormalizationFlags) (string)`. They all normalize the provided URL based on the specified flags. Here are the available flags: - -```go -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) -``` - -For convenience, the set of flags `FlagsSafe`, `FlagsUsuallySafe[Greedy|NonGreedy]`, `FlagsUnsafe[Greedy|NonGreedy]` and `FlagsAll[Greedy|NonGreedy]` are provided for the similarly grouped normalizations on [wikipedia's URL normalization page][wiki]. You can add (using the bitwise OR `|` operator) or remove (using the bitwise AND NOT `&^` operator) individual flags from the sets if required, to build your own custom set. - -The [full godoc reference is available on gopkgdoc][godoc]. - -Some things to note: - -* `FlagDecodeUnnecessaryEscapes`, `FlagEncodeNecessaryEscapes`, `FlagUppercaseEscapes` and `FlagRemoveEmptyQuerySeparator` are always implicitly set, because internally, the URL string is parsed as an URL object, which automatically decodes unnecessary escapes, uppercases and encodes necessary ones, and removes empty query separators (an unnecessary `?` at the end of the url). So this operation cannot **not** be done. For this reason, `FlagRemoveEmptyQuerySeparator` (as well as the other three) has been included in the `FlagsSafe` convenience set, instead of `FlagsUnsafe`, where Wikipedia puts it. - -* The `FlagDecodeUnnecessaryEscapes` decodes the following escapes (*from -> to*): - - %24 -> $ - - %26 -> & - - %2B-%3B -> +,-./0123456789:; - - %3D -> = - - %40-%5A -> @ABCDEFGHIJKLMNOPQRSTUVWXYZ - - %5F -> _ - - %61-%7A -> abcdefghijklmnopqrstuvwxyz - - %7E -> ~ - - -* When the `NormalizeURL` function is used (passing an URL object), this source URL object is modified (that is, after the call, the URL object will be modified to reflect the normalization). - -* The *replace IP with domain name* normalization (`http://208.77.188.166/ → http://www.example.com/`) is obviously not possible for a library without making some network requests. This is not implemented in purell. - -* The *remove unused query string parameters* and *remove default query parameters* are also not implemented, since this is a very case-specific normalization, and it is quite trivial to do with an URL object. - -### Safe vs Usually Safe vs Unsafe - -Purell allows you to control the level of risk you take while normalizing an URL. You can aggressively normalize, play it totally safe, or anything in between. - -Consider the following URL: - -`HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` - -Normalizing with the `FlagsSafe` gives: - -`https://www.root.com/toto/tE%1F///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` - -With the `FlagsUsuallySafeGreedy`: - -`https://www.root.com/toto/tE%1F///a/c?z=3&w=2&a=4&w=1#invalid` - -And with `FlagsUnsafeGreedy`: - -`http://root.com/toto/tE%1F/a/c?a=4&w=1&w=2&z=3` - -## TODOs - -* Add a class/default instance to allow specifying custom directory index names? At the moment, removing directory index removes `(^|/)((?:default|index)\.\w{1,4})$`. - -## Thanks / Contributions - -@rogpeppe -@jehiah -@opennota -@pchristopher1275 -@zenovich -@beeker1121 - -## License - -The [BSD 3-Clause license][bsd]. - -[bsd]: http://opensource.org/licenses/BSD-3-Clause -[wiki]: http://en.wikipedia.org/wiki/URL_normalization -[rfc]: http://tools.ietf.org/html/rfc3986#section-6 -[godoc]: http://go.pkgdoc.org/github.com/PuerkitoBio/purell -[pr5]: https://github.com/PuerkitoBio/purell/pull/5 -[iss7]: https://github.com/PuerkitoBio/purell/issues/7 diff --git a/vendor/github.com/PuerkitoBio/purell/purell.go b/vendor/github.com/PuerkitoBio/purell/purell.go deleted file mode 100644 index 6d0fc19..0000000 --- a/vendor/github.com/PuerkitoBio/purell/purell.go +++ /dev/null @@ -1,379 +0,0 @@ -/* -Package purell offers URL normalization as described on the wikipedia page: -http://en.wikipedia.org/wiki/URL_normalization -*/ -package purell - -import ( - "bytes" - "fmt" - "net/url" - "regexp" - "sort" - "strconv" - "strings" - - "github.com/PuerkitoBio/urlesc" - "golang.org/x/net/idna" - "golang.org/x/text/unicode/norm" - "golang.org/x/text/width" -) - -// A set of normalization flags determines how a URL will -// be normalized. -type NormalizationFlags uint - -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) - -const ( - defaultHttpPort = ":80" - defaultHttpsPort = ":443" -) - -// Regular expressions used by the normalizations -var rxPort = regexp.MustCompile(`(:\d+)/?$`) -var rxDirIndex = regexp.MustCompile(`(^|/)((?:default|index)\.\w{1,4})$`) -var rxDupSlashes = regexp.MustCompile(`/{2,}`) -var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`) -var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`) -var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`) -var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`) -var rxEmptyPort = regexp.MustCompile(`:+$`) - -// Map of flags to implementation function. -// FlagDecodeUnnecessaryEscapes has no action, since it is done automatically -// by parsing the string as an URL. Same for FlagUppercaseEscapes and FlagRemoveEmptyQuerySeparator. - -// Since maps have undefined traversing order, make a slice of ordered keys -var flagsOrder = []NormalizationFlags{ - FlagLowercaseScheme, - FlagLowercaseHost, - FlagRemoveDefaultPort, - FlagRemoveDirectoryIndex, - FlagRemoveDotSegments, - FlagRemoveFragment, - FlagForceHTTP, // Must be after remove default port (because https=443/http=80) - FlagRemoveDuplicateSlashes, - FlagRemoveWWW, - FlagAddWWW, - FlagSortQuery, - FlagDecodeDWORDHost, - FlagDecodeOctalHost, - FlagDecodeHexHost, - FlagRemoveUnnecessaryHostDots, - FlagRemoveEmptyPortSeparator, - FlagRemoveTrailingSlash, // These two (add/remove trailing slash) must be last - FlagAddTrailingSlash, -} - -// ... and then the map, where order is unimportant -var flags = map[NormalizationFlags]func(*url.URL){ - FlagLowercaseScheme: lowercaseScheme, - FlagLowercaseHost: lowercaseHost, - FlagRemoveDefaultPort: removeDefaultPort, - FlagRemoveDirectoryIndex: removeDirectoryIndex, - FlagRemoveDotSegments: removeDotSegments, - FlagRemoveFragment: removeFragment, - FlagForceHTTP: forceHTTP, - FlagRemoveDuplicateSlashes: removeDuplicateSlashes, - FlagRemoveWWW: removeWWW, - FlagAddWWW: addWWW, - FlagSortQuery: sortQuery, - FlagDecodeDWORDHost: decodeDWORDHost, - FlagDecodeOctalHost: decodeOctalHost, - FlagDecodeHexHost: decodeHexHost, - FlagRemoveUnnecessaryHostDots: removeUnncessaryHostDots, - FlagRemoveEmptyPortSeparator: removeEmptyPortSeparator, - FlagRemoveTrailingSlash: removeTrailingSlash, - FlagAddTrailingSlash: addTrailingSlash, -} - -// MustNormalizeURLString returns the normalized string, and panics if an error occurs. -// It takes an URL string as input, as well as the normalization flags. -func MustNormalizeURLString(u string, f NormalizationFlags) string { - result, e := NormalizeURLString(u, f) - if e != nil { - panic(e) - } - return result -} - -// NormalizeURLString returns the normalized string, or an error if it can't be parsed into an URL object. -// It takes an URL string as input, as well as the normalization flags. -func NormalizeURLString(u string, f NormalizationFlags) (string, error) { - parsed, err := url.Parse(u) - if err != nil { - return "", err - } - - if f&FlagLowercaseHost == FlagLowercaseHost { - parsed.Host = strings.ToLower(parsed.Host) - } - - // The idna package doesn't fully conform to RFC 5895 - // (https://tools.ietf.org/html/rfc5895), so we do it here. - // Taken from Go 1.8 cycle source, courtesy of bradfitz. - // TODO: Remove when (if?) idna package conforms to RFC 5895. - parsed.Host = width.Fold.String(parsed.Host) - parsed.Host = norm.NFC.String(parsed.Host) - if parsed.Host, err = idna.ToASCII(parsed.Host); err != nil { - return "", err - } - - return NormalizeURL(parsed, f), nil -} - -// NormalizeURL returns the normalized string. -// It takes a parsed URL object as input, as well as the normalization flags. -func NormalizeURL(u *url.URL, f NormalizationFlags) string { - for _, k := range flagsOrder { - if f&k == k { - flags[k](u) - } - } - return urlesc.Escape(u) -} - -func lowercaseScheme(u *url.URL) { - if len(u.Scheme) > 0 { - u.Scheme = strings.ToLower(u.Scheme) - } -} - -func lowercaseHost(u *url.URL) { - if len(u.Host) > 0 { - u.Host = strings.ToLower(u.Host) - } -} - -func removeDefaultPort(u *url.URL) { - if len(u.Host) > 0 { - scheme := strings.ToLower(u.Scheme) - u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) { - return "" - } - return val - }) - } -} - -func removeTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if strings.HasSuffix(u.Path, "/") { - u.Path = u.Path[:l-1] - } - } else if l = len(u.Host); l > 0 { - if strings.HasSuffix(u.Host, "/") { - u.Host = u.Host[:l-1] - } - } -} - -func addTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } else if l = len(u.Host); l > 0 { - if !strings.HasSuffix(u.Host, "/") { - u.Host += "/" - } - } -} - -func removeDotSegments(u *url.URL) { - if len(u.Path) > 0 { - var dotFree []string - var lastIsDot bool - - sections := strings.Split(u.Path, "/") - for _, s := range sections { - if s == ".." { - if len(dotFree) > 0 { - dotFree = dotFree[:len(dotFree)-1] - } - } else if s != "." { - dotFree = append(dotFree, s) - } - lastIsDot = (s == "." || s == "..") - } - // Special case if host does not end with / and new path does not begin with / - u.Path = strings.Join(dotFree, "/") - if u.Host != "" && !strings.HasSuffix(u.Host, "/") && !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - // Special case if the last segment was a dot, make sure the path ends with a slash - if lastIsDot && !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } -} - -func removeDirectoryIndex(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDirIndex.ReplaceAllString(u.Path, "$1") - } -} - -func removeFragment(u *url.URL) { - u.Fragment = "" -} - -func forceHTTP(u *url.URL) { - if strings.ToLower(u.Scheme) == "https" { - u.Scheme = "http" - } -} - -func removeDuplicateSlashes(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") - } -} - -func removeWWW(u *url.URL) { - if len(u.Host) > 0 && strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = u.Host[4:] - } -} - -func addWWW(u *url.URL) { - if len(u.Host) > 0 && !strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = "www." + u.Host - } -} - -func sortQuery(u *url.URL) { - q := u.Query() - - if len(q) > 0 { - arKeys := make([]string, len(q)) - i := 0 - for k := range q { - arKeys[i] = k - i++ - } - sort.Strings(arKeys) - buf := new(bytes.Buffer) - for _, k := range arKeys { - sort.Strings(q[k]) - for _, v := range q[k] { - if buf.Len() > 0 { - buf.WriteRune('&') - } - buf.WriteString(fmt.Sprintf("%s=%s", k, urlesc.QueryEscape(v))) - } - } - - // Rebuild the raw query string - u.RawQuery = buf.String() - } -} - -func decodeDWORDHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxDWORDHost.FindStringSubmatch(u.Host); len(matches) > 2 { - var parts [4]int64 - - dword, _ := strconv.ParseInt(matches[1], 10, 0) - for i, shift := range []uint{24, 16, 8, 0} { - parts[i] = dword >> shift & 0xFF - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[2]) - } - } -} - -func decodeOctalHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxOctalHost.FindStringSubmatch(u.Host); len(matches) > 5 { - var parts [4]int64 - - for i := 1; i <= 4; i++ { - parts[i-1], _ = strconv.ParseInt(matches[i], 8, 0) - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[5]) - } - } -} - -func decodeHexHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHexHost.FindStringSubmatch(u.Host); len(matches) > 2 { - // Conversion is safe because of regex validation - parsed, _ := strconv.ParseInt(matches[1], 16, 0) - // Set host as DWORD (base 10) encoded host - u.Host = fmt.Sprintf("%d%s", parsed, matches[2]) - // The rest is the same as decoding a DWORD host - decodeDWORDHost(u) - } - } -} - -func removeUnncessaryHostDots(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHostDots.FindStringSubmatch(u.Host); len(matches) > 1 { - // Trim the leading and trailing dots - u.Host = strings.Trim(matches[1], ".") - if len(matches) > 2 { - u.Host += matches[2] - } - } - } -} - -func removeEmptyPortSeparator(u *url.URL) { - if len(u.Host) > 0 { - u.Host = rxEmptyPort.ReplaceAllString(u.Host, "") - } -} diff --git a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml b/vendor/github.com/PuerkitoBio/urlesc/.travis.yml deleted file mode 100644 index ba6b225..0000000 --- a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go - -go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - tip - -install: - - go build . - -script: - - go test -v diff --git a/vendor/github.com/PuerkitoBio/urlesc/LICENSE b/vendor/github.com/PuerkitoBio/urlesc/LICENSE deleted file mode 100644 index 7448756..0000000 --- a/vendor/github.com/PuerkitoBio/urlesc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/PuerkitoBio/urlesc/README.md b/vendor/github.com/PuerkitoBio/urlesc/README.md deleted file mode 100644 index 57aff0a..0000000 --- a/vendor/github.com/PuerkitoBio/urlesc/README.md +++ /dev/null @@ -1,16 +0,0 @@ -urlesc [![Build Status](https://travis-ci.org/PuerkitoBio/urlesc.svg?branch=master)](https://travis-ci.org/PuerkitoBio/urlesc) [![GoDoc](http://godoc.org/github.com/PuerkitoBio/urlesc?status.svg)](http://godoc.org/github.com/PuerkitoBio/urlesc) -====== - -Package urlesc implements query escaping as per RFC 3986. - -It contains some parts of the net/url package, modified so as to allow -some reserved characters incorrectly escaped by net/url (see [issue 5684](https://github.com/golang/go/issues/5684)). - -## Install - - go get github.com/PuerkitoBio/urlesc - -## License - -Go license (BSD-3-Clause) - diff --git a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go b/vendor/github.com/PuerkitoBio/urlesc/urlesc.go deleted file mode 100644 index 1b84624..0000000 --- a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package urlesc implements query escaping as per RFC 3986. -// It contains some parts of the net/url package, modified so as to allow -// some reserved characters incorrectly escaped by net/url. -// See https://github.com/golang/go/issues/5684 -package urlesc - -import ( - "bytes" - "net/url" - "strings" -) - -type encoding int - -const ( - encodePath encoding = 1 + iota - encodeUserPassword - encodeQueryComponent - encodeFragment -) - -// Return true if the specified character should be escaped when -// appearing in a URL string, according to RFC 3986. -func shouldEscape(c byte, mode encoding) bool { - // §2.3 Unreserved characters (alphanum) - if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' { - return false - } - - switch c { - case '-', '.', '_', '~': // §2.3 Unreserved characters (mark) - return false - - // §2.2 Reserved characters (reserved) - case ':', '/', '?', '#', '[', ']', '@', // gen-delims - '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // sub-delims - // Different sections of the URL allow a few of - // the reserved characters to appear unescaped. - switch mode { - case encodePath: // §3.3 - // The RFC allows sub-delims and : @. - // '/', '[' and ']' can be used to assign meaning to individual path - // segments. This package only manipulates the path as a whole, - // so we allow those as well. That leaves only ? and # to escape. - return c == '?' || c == '#' - - case encodeUserPassword: // §3.2.1 - // The RFC allows : and sub-delims in - // userinfo. The parsing of userinfo treats ':' as special so we must escape - // all the gen-delims. - return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@' - - case encodeQueryComponent: // §3.4 - // The RFC allows / and ?. - return c != '/' && c != '?' - - case encodeFragment: // §4.1 - // The RFC text is silent but the grammar allows - // everything, so escape nothing but # - return c == '#' - } - } - - // Everything else must be escaped. - return true -} - -// QueryEscape escapes the string so it can be safely placed -// inside a URL query. -func QueryEscape(s string) string { - return escape(s, encodeQueryComponent) -} - -func escape(s string, mode encoding) string { - spaceCount, hexCount := 0, 0 - for i := 0; i < len(s); i++ { - c := s[i] - if shouldEscape(c, mode) { - if c == ' ' && mode == encodeQueryComponent { - spaceCount++ - } else { - hexCount++ - } - } - } - - if spaceCount == 0 && hexCount == 0 { - return s - } - - t := make([]byte, len(s)+2*hexCount) - j := 0 - for i := 0; i < len(s); i++ { - switch c := s[i]; { - case c == ' ' && mode == encodeQueryComponent: - t[j] = '+' - j++ - case shouldEscape(c, mode): - t[j] = '%' - t[j+1] = "0123456789ABCDEF"[c>>4] - t[j+2] = "0123456789ABCDEF"[c&15] - j += 3 - default: - t[j] = s[i] - j++ - } - } - return string(t) -} - -var uiReplacer = strings.NewReplacer( - "%21", "!", - "%27", "'", - "%28", "(", - "%29", ")", - "%2A", "*", -) - -// unescapeUserinfo unescapes some characters that need not to be escaped as per RFC3986. -func unescapeUserinfo(s string) string { - return uiReplacer.Replace(s) -} - -// Escape reassembles the URL into a valid URL string. -// The general form of the result is one of: -// -// scheme:opaque -// scheme://userinfo@host/path?query#fragment -// -// If u.Opaque is non-empty, String uses the first form; -// otherwise it uses the second form. -// -// In the second form, the following rules apply: -// - if u.Scheme is empty, scheme: is omitted. -// - if u.User is nil, userinfo@ is omitted. -// - if u.Host is empty, host/ is omitted. -// - if u.Scheme and u.Host are empty and u.User is nil, -// the entire scheme://userinfo@host/ is omitted. -// - if u.Host is non-empty and u.Path begins with a /, -// the form host/path does not add its own /. -// - if u.RawQuery is empty, ?query is omitted. -// - if u.Fragment is empty, #fragment is omitted. -func Escape(u *url.URL) string { - var buf bytes.Buffer - if u.Scheme != "" { - buf.WriteString(u.Scheme) - buf.WriteByte(':') - } - if u.Opaque != "" { - buf.WriteString(u.Opaque) - } else { - if u.Scheme != "" || u.Host != "" || u.User != nil { - buf.WriteString("//") - if ui := u.User; ui != nil { - buf.WriteString(unescapeUserinfo(ui.String())) - buf.WriteByte('@') - } - if h := u.Host; h != "" { - buf.WriteString(h) - } - } - if u.Path != "" && u.Path[0] != '/' && u.Host != "" { - buf.WriteByte('/') - } - buf.WriteString(escape(u.Path, encodePath)) - } - if u.RawQuery != "" { - buf.WriteByte('?') - buf.WriteString(u.RawQuery) - } - if u.Fragment != "" { - buf.WriteByte('#') - buf.WriteString(escape(u.Fragment, encodeFragment)) - } - return buf.String() -} diff --git a/vendor/github.com/asaskevich/govalidator/.gitignore b/vendor/github.com/asaskevich/govalidator/.gitignore deleted file mode 100644 index 8d69a94..0000000 --- a/vendor/github.com/asaskevich/govalidator/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -bin/ -.idea/ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - diff --git a/vendor/github.com/asaskevich/govalidator/.travis.yml b/vendor/github.com/asaskevich/govalidator/.travis.yml deleted file mode 100644 index bb83c66..0000000 --- a/vendor/github.com/asaskevich/govalidator/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -dist: xenial -go: - - '1.10' - - '1.11' - - '1.12' - - '1.13' - - 'tip' - -script: - - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md b/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md deleted file mode 100644 index 4b462b0..0000000 --- a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -This project adheres to [The Code Manifesto](http://codemanifesto.com) -as its guidelines for contributor interactions. - -## The Code Manifesto - -We want to work in an ecosystem that empowers developers to reach their -potential — one that encourages growth and effective collaboration. A space -that is safe for all. - -A space such as this benefits everyone that participates in it. It encourages -new developers to enter our field. It is through discussion and collaboration -that we grow, and through growth that we improve. - -In the effort to create such a place, we hold to these values: - -1. **Discrimination limits us.** This includes discrimination on the basis of - race, gender, sexual orientation, gender identity, age, nationality, - technology and any other arbitrary exclusion of a group of people. -2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort - levels. Remember that, and if brought to your attention, heed it. -3. **We are our biggest assets.** None of us were born masters of our trade. - Each of us has been helped along the way. Return that favor, when and where - you can. -4. **We are resources for the future.** As an extension of #3, share what you - know. Make yourself a resource to help those that come after you. -5. **Respect defines us.** Treat others as you wish to be treated. Make your - discussions, criticisms and debates from a position of respectfulness. Ask - yourself, is it true? Is it necessary? Is it constructive? Anything less is - unacceptable. -6. **Reactions require grace.** Angry responses are valid, but abusive language - and vindictive actions are toxic. When something happens that offends you, - handle it assertively, but be respectful. Escalate reasonably, and try to - allow the offender an opportunity to explain themselves, and possibly - correct the issue. -7. **Opinions are just that: opinions.** Each and every one of us, due to our - background and upbringing, have varying opinions. That is perfectly - acceptable. Remember this: if you respect your own opinions, you should - respect the opinions of others. -8. **To err is human.** You might not intend it, but mistakes do happen and - contribute to build experience. Tolerate honest mistakes, and don't - hesitate to apologize if you make one yourself. diff --git a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md b/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md deleted file mode 100644 index 7ed268a..0000000 --- a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Financial contributions - -We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator). -Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. - - -## Credits - - -### Contributors - -Thank you to all the people who have already contributed to govalidator! - - - -### Backers - -Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor)) - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/LICENSE b/vendor/github.com/asaskevich/govalidator/LICENSE deleted file mode 100644 index cacba91..0000000 --- a/vendor/github.com/asaskevich/govalidator/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2020 Alex Saskevich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/README.md b/vendor/github.com/asaskevich/govalidator/README.md deleted file mode 100644 index 39121ea..0000000 --- a/vendor/github.com/asaskevich/govalidator/README.md +++ /dev/null @@ -1,619 +0,0 @@ -govalidator -=========== -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) -[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) -[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield) - -A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js). - -#### Installation -Make sure that Go is installed on your computer. -Type the following command in your terminal: - - go get github.com/asaskevich/govalidator - -or you can get specified release of the package with `gopkg.in`: - - go get gopkg.in/asaskevich/govalidator.v10 - -After it the package is ready to use. - - -#### Import package in your project -Add following line in your `*.go` file: -```go -import "github.com/asaskevich/govalidator" -``` -If you are unhappy to use long `govalidator`, you can do something like this: -```go -import ( - valid "github.com/asaskevich/govalidator" -) -``` - -#### Activate behavior to require all fields have a validation tag by default -`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function. - -`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors. - -```go -import "github.com/asaskevich/govalidator" - -func init() { - govalidator.SetFieldsRequiredByDefault(true) -} -``` - -Here's some code to explain it: -```go -// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -type exampleStruct struct { - Name string `` - Email string `valid:"email"` -} - -// this, however, will only fail when Email is empty or an invalid email address: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email"` -} - -// lastly, this will only fail when Email is an invalid email address but not when it's empty: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email,optional"` -} -``` - -#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123)) -##### Custom validator function signature -A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible. -```go -import "github.com/asaskevich/govalidator" - -// old signature -func(i interface{}) bool - -// new signature -func(i interface{}, o interface{}) bool -``` - -##### Adding a custom validator -This was changed to prevent data races when accessing custom validators. -```go -import "github.com/asaskevich/govalidator" - -// before -govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool { - // ... -} - -// after -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool { - // ... -}) -``` - -#### List of functions: -```go -func Abs(value float64) float64 -func BlackList(str, chars string) string -func ByteLength(str string, params ...string) bool -func CamelCaseToUnderscore(str string) string -func Contains(str, substring string) bool -func Count(array []interface{}, iterator ConditionIterator) int -func Each(array []interface{}, iterator Iterator) -func ErrorByField(e error, field string) string -func ErrorsByField(e error) map[string]string -func Filter(array []interface{}, iterator ConditionIterator) []interface{} -func Find(array []interface{}, iterator ConditionIterator) interface{} -func GetLine(s string, index int) (string, error) -func GetLines(s string) []string -func HasLowerCase(str string) bool -func HasUpperCase(str string) bool -func HasWhitespace(str string) bool -func HasWhitespaceOnly(str string) bool -func InRange(value interface{}, left interface{}, right interface{}) bool -func InRangeFloat32(value, left, right float32) bool -func InRangeFloat64(value, left, right float64) bool -func InRangeInt(value, left, right interface{}) bool -func IsASCII(str string) bool -func IsAlpha(str string) bool -func IsAlphanumeric(str string) bool -func IsBase64(str string) bool -func IsByteLength(str string, min, max int) bool -func IsCIDR(str string) bool -func IsCRC32(str string) bool -func IsCRC32b(str string) bool -func IsCreditCard(str string) bool -func IsDNSName(str string) bool -func IsDataURI(str string) bool -func IsDialString(str string) bool -func IsDivisibleBy(str, num string) bool -func IsEmail(str string) bool -func IsExistingEmail(email string) bool -func IsFilePath(str string) (bool, int) -func IsFloat(str string) bool -func IsFullWidth(str string) bool -func IsHalfWidth(str string) bool -func IsHash(str string, algorithm string) bool -func IsHexadecimal(str string) bool -func IsHexcolor(str string) bool -func IsHost(str string) bool -func IsIP(str string) bool -func IsIPv4(str string) bool -func IsIPv6(str string) bool -func IsISBN(str string, version int) bool -func IsISBN10(str string) bool -func IsISBN13(str string) bool -func IsISO3166Alpha2(str string) bool -func IsISO3166Alpha3(str string) bool -func IsISO4217(str string) bool -func IsISO693Alpha2(str string) bool -func IsISO693Alpha3b(str string) bool -func IsIn(str string, params ...string) bool -func IsInRaw(str string, params ...string) bool -func IsInt(str string) bool -func IsJSON(str string) bool -func IsLatitude(str string) bool -func IsLongitude(str string) bool -func IsLowerCase(str string) bool -func IsMAC(str string) bool -func IsMD4(str string) bool -func IsMD5(str string) bool -func IsMagnetURI(str string) bool -func IsMongoID(str string) bool -func IsMultibyte(str string) bool -func IsNatural(value float64) bool -func IsNegative(value float64) bool -func IsNonNegative(value float64) bool -func IsNonPositive(value float64) bool -func IsNotNull(str string) bool -func IsNull(str string) bool -func IsNumeric(str string) bool -func IsPort(str string) bool -func IsPositive(value float64) bool -func IsPrintableASCII(str string) bool -func IsRFC3339(str string) bool -func IsRFC3339WithoutZone(str string) bool -func IsRGBcolor(str string) bool -func IsRequestURI(rawurl string) bool -func IsRequestURL(rawurl string) bool -func IsRipeMD128(str string) bool -func IsRipeMD160(str string) bool -func IsRsaPub(str string, params ...string) bool -func IsRsaPublicKey(str string, keylen int) bool -func IsSHA1(str string) bool -func IsSHA256(str string) bool -func IsSHA384(str string) bool -func IsSHA512(str string) bool -func IsSSN(str string) bool -func IsSemver(str string) bool -func IsTiger128(str string) bool -func IsTiger160(str string) bool -func IsTiger192(str string) bool -func IsTime(str string, format string) bool -func IsType(v interface{}, params ...string) bool -func IsURL(str string) bool -func IsUTFDigit(str string) bool -func IsUTFLetter(str string) bool -func IsUTFLetterNumeric(str string) bool -func IsUTFNumeric(str string) bool -func IsUUID(str string) bool -func IsUUIDv3(str string) bool -func IsUUIDv4(str string) bool -func IsUUIDv5(str string) bool -func IsUnixTime(str string) bool -func IsUpperCase(str string) bool -func IsVariableWidth(str string) bool -func IsWhole(value float64) bool -func LeftTrim(str, chars string) string -func Map(array []interface{}, iterator ResultIterator) []interface{} -func Matches(str, pattern string) bool -func MaxStringLength(str string, params ...string) bool -func MinStringLength(str string, params ...string) bool -func NormalizeEmail(str string) (string, error) -func PadBoth(str string, padStr string, padLen int) string -func PadLeft(str string, padStr string, padLen int) string -func PadRight(str string, padStr string, padLen int) string -func PrependPathToErrors(err error, path string) error -func Range(str string, params ...string) bool -func RemoveTags(s string) string -func ReplacePattern(str, pattern, replace string) string -func Reverse(s string) string -func RightTrim(str, chars string) string -func RuneLength(str string, params ...string) bool -func SafeFileName(str string) string -func SetFieldsRequiredByDefault(value bool) -func SetNilPtrAllowedByRequired(value bool) -func Sign(value float64) float64 -func StringLength(str string, params ...string) bool -func StringMatches(s string, params ...string) bool -func StripLow(str string, keepNewLines bool) string -func ToBoolean(str string) (bool, error) -func ToFloat(str string) (float64, error) -func ToInt(value interface{}) (res int64, err error) -func ToJSON(obj interface{}) (string, error) -func ToString(obj interface{}) string -func Trim(str, chars string) string -func Truncate(str string, length int, ending string) string -func TruncatingErrorf(str string, args ...interface{}) error -func UnderscoreToCamelCase(s string) string -func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error) -func ValidateStruct(s interface{}) (bool, error) -func WhiteList(str, chars string) string -type ConditionIterator -type CustomTypeValidator -type Error -func (e Error) Error() string -type Errors -func (es Errors) Error() string -func (es Errors) Errors() []error -type ISO3166Entry -type ISO693Entry -type InterfaceParamValidator -type Iterator -type ParamValidator -type ResultIterator -type UnsupportedTypeError -func (e *UnsupportedTypeError) Error() string -type Validator -``` - -#### Examples -###### IsURL -```go -println(govalidator.IsURL(`http://user@pass:domain.com/path/page`)) -``` -###### IsType -```go -println(govalidator.IsType("Bob", "string")) -println(govalidator.IsType(1, "int")) -i := 1 -println(govalidator.IsType(&i, "*int")) -``` - -IsType can be used through the tag `type` which is essential for map validation: -```go -type User struct { - Name string `valid:"type(string)"` - Age int `valid:"type(int)"` - Meta interface{} `valid:"type(string)"` -} -result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"}) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ToString -```go -type User struct { - FirstName string - LastName string -} - -str := govalidator.ToString(&User{"John", "Juan"}) -println(str) -``` -###### Each, Map, Filter, Count for slices -Each iterates over the slice/array and calls Iterator for every item -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.Iterator = func(value interface{}, index int) { - println(value.(int)) -} -govalidator.Each(data, fn) -``` -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} { - return value.(int) * 3 -} -_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15} -``` -```go -data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -var fn govalidator.ConditionIterator = func(value interface{}, index int) bool { - return value.(int)%2 == 0 -} -_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10} -_ = govalidator.Count(data, fn) // result = 5 -``` -###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2) -If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this: -```go -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) -``` -For completely custom validators (interface-based), see below. - -Here is a list of available validators for struct fields (validator - used function): -```go -"email": IsEmail, -"url": IsURL, -"dialstring": IsDialString, -"requrl": IsRequestURL, -"requri": IsRequestURI, -"alpha": IsAlpha, -"utfletter": IsUTFLetter, -"alphanum": IsAlphanumeric, -"utfletternum": IsUTFLetterNumeric, -"numeric": IsNumeric, -"utfnumeric": IsUTFNumeric, -"utfdigit": IsUTFDigit, -"hexadecimal": IsHexadecimal, -"hexcolor": IsHexcolor, -"rgbcolor": IsRGBcolor, -"lowercase": IsLowerCase, -"uppercase": IsUpperCase, -"int": IsInt, -"float": IsFloat, -"null": IsNull, -"uuid": IsUUID, -"uuidv3": IsUUIDv3, -"uuidv4": IsUUIDv4, -"uuidv5": IsUUIDv5, -"creditcard": IsCreditCard, -"isbn10": IsISBN10, -"isbn13": IsISBN13, -"json": IsJSON, -"multibyte": IsMultibyte, -"ascii": IsASCII, -"printableascii": IsPrintableASCII, -"fullwidth": IsFullWidth, -"halfwidth": IsHalfWidth, -"variablewidth": IsVariableWidth, -"base64": IsBase64, -"datauri": IsDataURI, -"ip": IsIP, -"port": IsPort, -"ipv4": IsIPv4, -"ipv6": IsIPv6, -"dns": IsDNSName, -"host": IsHost, -"mac": IsMAC, -"latitude": IsLatitude, -"longitude": IsLongitude, -"ssn": IsSSN, -"semver": IsSemver, -"rfc3339": IsRFC3339, -"rfc3339WithoutZone": IsRFC3339WithoutZone, -"ISO3166Alpha2": IsISO3166Alpha2, -"ISO3166Alpha3": IsISO3166Alpha3, -``` -Validators with parameters - -```go -"range(min|max)": Range, -"length(min|max)": ByteLength, -"runelength(min|max)": RuneLength, -"stringlength(min|max)": StringLength, -"matches(pattern)": StringMatches, -"in(string1|string2|...|stringN)": IsIn, -"rsapub(keylength)" : IsRsaPub, -"minstringlength(int): MinStringLength, -"maxstringlength(int): MaxStringLength, -``` -Validators with parameters for any type - -```go -"type(type)": IsType, -``` - -And here is small example of usage: -```go -type Post struct { - Title string `valid:"alphanum,required"` - Message string `valid:"duck,ascii"` - Message2 string `valid:"animal(dog)"` - AuthorIP string `valid:"ipv4"` - Date string `valid:"-"` -} -post := &Post{ - Title: "My Example Post", - Message: "duck", - Message2: "dog", - AuthorIP: "123.234.54.3", -} - -// Add your own struct validation tags -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) - -// Add your own struct validation tags with parameter -govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool { - species := params[0] - return str == species -}) -govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$") - -result, err := govalidator.ValidateStruct(post) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338) -If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}` - -So here is small example of usage: -```go -var mapTemplate = map[string]interface{}{ - "name":"required,alpha", - "family":"required,alpha", - "email":"required,email", - "cell-phone":"numeric", - "address":map[string]interface{}{ - "line1":"required,alphanum", - "line2":"alphanum", - "postal-code":"numeric", - }, -} - -var inputMap = map[string]interface{}{ - "name":"Bob", - "family":"Smith", - "email":"foo@bar.baz", - "address":map[string]interface{}{ - "line1":"", - "line2":"", - "postal-code":"", - }, -} - -result, err := govalidator.ValidateMap(inputMap, mapTemplate) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` - -###### WhiteList -```go -// Remove all characters from string ignoring characters between "a" and "z" -println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa") -``` - -###### Custom validation functions -Custom validation using your own domain specific validators is also available - here's an example of how to use it: -```go -import "github.com/asaskevich/govalidator" - -type CustomByteArray [6]byte // custom types are supported and can be validated - -type StructWithCustomByteArray struct { - ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence - Email string `valid:"email"` - CustomMinLength int `valid:"-"` -} - -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // you can type switch on the context interface being validated - case StructWithCustomByteArray: - // you can check and validate against some other field in the context, - // return early or not validate against the context at all – your choice - case SomeOtherType: - // ... - default: - // expecting some other type? Throw/panic here or continue - } - - switch v := i.(type) { // type switch on the struct field being validated - case CustomByteArray: - for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes - if e != 0 { - return true - } - } - } - return false -}) -govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation - case StructWithCustomByteArray: - return len(v.ID) >= v.CustomMinLength - } - return false -}) -``` - -###### Loop over Error() -By default .Error() returns all errors in a single String. To access each error you can do this: -```go - if err != nil { - errs := err.(govalidator.Errors).Errors() - for _, e := range errs { - fmt.Println(e.Error()) - } - } -``` - -###### Custom error messages -Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it: -```go -type Ticket struct { - Id int64 `json:"id"` - FirstName string `json:"firstname" valid:"required~First name is blank"` -} -``` - -#### Notes -Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator). -Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator). - -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Credits -### Contributors - -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - -#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors) -* [Daniel Lohse](https://github.com/annismckenzie) -* [Attila Oláh](https://github.com/attilaolah) -* [Daniel Korner](https://github.com/Dadie) -* [Steven Wilkin](https://github.com/stevenwilkin) -* [Deiwin Sarjas](https://github.com/deiwin) -* [Noah Shibley](https://github.com/slugmobile) -* [Nathan Davies](https://github.com/nathj07) -* [Matt Sanford](https://github.com/mzsanford) -* [Simon ccl1115](https://github.com/ccl1115) - - - - -### Backers - -Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)] - - - - - - - - - - - - - - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large) diff --git a/vendor/github.com/asaskevich/govalidator/arrays.go b/vendor/github.com/asaskevich/govalidator/arrays.go deleted file mode 100644 index 3e1da7c..0000000 --- a/vendor/github.com/asaskevich/govalidator/arrays.go +++ /dev/null @@ -1,87 +0,0 @@ -package govalidator - -// Iterator is the function that accepts element of slice/array and its index -type Iterator func(interface{}, int) - -// ResultIterator is the function that accepts element of slice/array and its index and returns any result -type ResultIterator func(interface{}, int) interface{} - -// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean -type ConditionIterator func(interface{}, int) bool - -// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values -type ReduceIterator func(interface{}, interface{}) interface{} - -// Some validates that any item of array corresponds to ConditionIterator. Returns boolean. -func Some(array []interface{}, iterator ConditionIterator) bool { - res := false - for index, data := range array { - res = res || iterator(data, index) - } - return res -} - -// Every validates that every item of array corresponds to ConditionIterator. Returns boolean. -func Every(array []interface{}, iterator ConditionIterator) bool { - res := true - for index, data := range array { - res = res && iterator(data, index) - } - return res -} - -// Reduce boils down a list of values into a single value by ReduceIterator -func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} { - for _, data := range array { - initialValue = iterator(initialValue, data) - } - return initialValue -} - -// Each iterates over the slice and apply Iterator to every item -func Each(array []interface{}, iterator Iterator) { - for index, data := range array { - iterator(data, index) - } -} - -// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result. -func Map(array []interface{}, iterator ResultIterator) []interface{} { - var result = make([]interface{}, len(array)) - for index, data := range array { - result[index] = iterator(data, index) - } - return result -} - -// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise. -func Find(array []interface{}, iterator ConditionIterator) interface{} { - for index, data := range array { - if iterator(data, index) { - return data - } - } - return nil -} - -// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice. -func Filter(array []interface{}, iterator ConditionIterator) []interface{} { - var result = make([]interface{}, 0) - for index, data := range array { - if iterator(data, index) { - result = append(result, data) - } - } - return result -} - -// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator. -func Count(array []interface{}, iterator ConditionIterator) int { - count := 0 - for index, data := range array { - if iterator(data, index) { - count = count + 1 - } - } - return count -} diff --git a/vendor/github.com/asaskevich/govalidator/converter.go b/vendor/github.com/asaskevich/govalidator/converter.go deleted file mode 100644 index d68e990..0000000 --- a/vendor/github.com/asaskevich/govalidator/converter.go +++ /dev/null @@ -1,81 +0,0 @@ -package govalidator - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" -) - -// ToString convert the input to a string. -func ToString(obj interface{}) string { - res := fmt.Sprintf("%v", obj) - return res -} - -// ToJSON convert the input to a valid JSON string -func ToJSON(obj interface{}) (string, error) { - res, err := json.Marshal(obj) - if err != nil { - res = []byte("") - } - return string(res), err -} - -// ToFloat convert the input string to a float, or 0.0 if the input is not a float. -func ToFloat(value interface{}) (res float64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = float64(val.Int()) - case uint, uint8, uint16, uint32, uint64: - res = float64(val.Uint()) - case float32, float64: - res = val.Float() - case string: - res, err = strconv.ParseFloat(val.String(), 64) - if err != nil { - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer. -func ToInt(value interface{}) (res int64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = val.Int() - case uint, uint8, uint16, uint32, uint64: - res = int64(val.Uint()) - case float32, float64: - res = int64(val.Float()) - case string: - if IsInt(val.String()) { - res, err = strconv.ParseInt(val.String(), 0, 64) - if err != nil { - res = 0 - } - } else { - err = fmt.Errorf("ToInt: invalid numeric format %g", value) - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToBoolean convert the input string to a boolean. -func ToBoolean(str string) (bool, error) { - return strconv.ParseBool(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/doc.go b/vendor/github.com/asaskevich/govalidator/doc.go deleted file mode 100644 index 55dce62..0000000 --- a/vendor/github.com/asaskevich/govalidator/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package govalidator - -// A package of validators and sanitizers for strings, structures and collections. diff --git a/vendor/github.com/asaskevich/govalidator/error.go b/vendor/github.com/asaskevich/govalidator/error.go deleted file mode 100644 index 1da2336..0000000 --- a/vendor/github.com/asaskevich/govalidator/error.go +++ /dev/null @@ -1,47 +0,0 @@ -package govalidator - -import ( - "sort" - "strings" -) - -// Errors is an array of multiple errors and conforms to the error interface. -type Errors []error - -// Errors returns itself. -func (es Errors) Errors() []error { - return es -} - -func (es Errors) Error() string { - var errs []string - for _, e := range es { - errs = append(errs, e.Error()) - } - sort.Strings(errs) - return strings.Join(errs, ";") -} - -// Error encapsulates a name, an error and whether there's a custom error message or not. -type Error struct { - Name string - Err error - CustomErrorMessageExists bool - - // Validator indicates the name of the validator that failed - Validator string - Path []string -} - -func (e Error) Error() string { - if e.CustomErrorMessageExists { - return e.Err.Error() - } - - errName := e.Name - if len(e.Path) > 0 { - errName = strings.Join(append(e.Path, e.Name), ".") - } - - return errName + ": " + e.Err.Error() -} diff --git a/vendor/github.com/asaskevich/govalidator/go.mod b/vendor/github.com/asaskevich/govalidator/go.mod deleted file mode 100644 index 42d5b1f..0000000 --- a/vendor/github.com/asaskevich/govalidator/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/asaskevich/govalidator - -go 1.13 diff --git a/vendor/github.com/asaskevich/govalidator/numerics.go b/vendor/github.com/asaskevich/govalidator/numerics.go deleted file mode 100644 index 5041d9e..0000000 --- a/vendor/github.com/asaskevich/govalidator/numerics.go +++ /dev/null @@ -1,100 +0,0 @@ -package govalidator - -import ( - "math" -) - -// Abs returns absolute value of number -func Abs(value float64) float64 { - return math.Abs(value) -} - -// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise -func Sign(value float64) float64 { - if value > 0 { - return 1 - } else if value < 0 { - return -1 - } else { - return 0 - } -} - -// IsNegative returns true if value < 0 -func IsNegative(value float64) bool { - return value < 0 -} - -// IsPositive returns true if value > 0 -func IsPositive(value float64) bool { - return value > 0 -} - -// IsNonNegative returns true if value >= 0 -func IsNonNegative(value float64) bool { - return value >= 0 -} - -// IsNonPositive returns true if value <= 0 -func IsNonPositive(value float64) bool { - return value <= 0 -} - -// InRangeInt returns true if value lies between left and right border -func InRangeInt(value, left, right interface{}) bool { - value64, _ := ToInt(value) - left64, _ := ToInt(left) - right64, _ := ToInt(right) - if left64 > right64 { - left64, right64 = right64, left64 - } - return value64 >= left64 && value64 <= right64 -} - -// InRangeFloat32 returns true if value lies between left and right border -func InRangeFloat32(value, left, right float32) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRangeFloat64 returns true if value lies between left and right border -func InRangeFloat64(value, left, right float64) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string. -// All types must the same type. -// False if value doesn't lie in range or if it incompatible or not comparable -func InRange(value interface{}, left interface{}, right interface{}) bool { - switch value.(type) { - case int: - intValue, _ := ToInt(value) - intLeft, _ := ToInt(left) - intRight, _ := ToInt(right) - return InRangeInt(intValue, intLeft, intRight) - case float32, float64: - intValue, _ := ToFloat(value) - intLeft, _ := ToFloat(left) - intRight, _ := ToFloat(right) - return InRangeFloat64(intValue, intLeft, intRight) - case string: - return value.(string) >= left.(string) && value.(string) <= right.(string) - default: - return false - } -} - -// IsWhole returns true if value is whole number -func IsWhole(value float64) bool { - return math.Remainder(value, 1) == 0 -} - -// IsNatural returns true if value is natural number (positive and whole) -func IsNatural(value float64) bool { - return IsWhole(value) && IsPositive(value) -} diff --git a/vendor/github.com/asaskevich/govalidator/patterns.go b/vendor/github.com/asaskevich/govalidator/patterns.go deleted file mode 100644 index 106ed94..0000000 --- a/vendor/github.com/asaskevich/govalidator/patterns.go +++ /dev/null @@ -1,107 +0,0 @@ -package govalidator - -import "regexp" - -// Basic regular expressions for validating strings -const ( - Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$" - CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$" - ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$" - ISBN13 string = "^(?:[0-9]{13})$" - UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$" - UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - Alpha string = "^[a-zA-Z]+$" - Alphanumeric string = "^[a-zA-Z0-9]+$" - Numeric string = "^[0-9]+$" - Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" - Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" - Hexadecimal string = "^[0-9a-fA-F]+$" - Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" - RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" - ASCII string = "^[\x00-\x7F]+$" - Multibyte string = "[^\x00-\x7F]" - FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" - PrintableASCII string = "^[\x20-\x7E]+$" - DataURI string = "^data:.+\\/(.+);base64$" - MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$" - Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$" - Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" - DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` - IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` - URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)` - URLUsername string = `(\S+(:\S*)?@)` - URLPath string = `((\/|\?|#)[^\s]*)` - URLPort string = `(:(\d{1,5}))` - URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))` - URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))` - URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$` - SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` - WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixPath string = `^(/[^/\x00]*)+/?$` - Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$" - tagName string = "valid" - hasLowerCase string = ".*[[:lower:]]" - hasUpperCase string = ".*[[:upper:]]" - hasWhitespace string = ".*[[:space:]]" - hasWhitespaceOnly string = "^[[:space:]]+$" - IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$" - IMSI string = "^\\d{14,15}$" -) - -// Used by IsFilePath func -const ( - // Unknown is unresolved OS type - Unknown = iota - // Win is Windows type - Win - // Unix is *nix OS types - Unix -) - -var ( - userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$") - hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$") - userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})") - rxEmail = regexp.MustCompile(Email) - rxCreditCard = regexp.MustCompile(CreditCard) - rxISBN10 = regexp.MustCompile(ISBN10) - rxISBN13 = regexp.MustCompile(ISBN13) - rxUUID3 = regexp.MustCompile(UUID3) - rxUUID4 = regexp.MustCompile(UUID4) - rxUUID5 = regexp.MustCompile(UUID5) - rxUUID = regexp.MustCompile(UUID) - rxAlpha = regexp.MustCompile(Alpha) - rxAlphanumeric = regexp.MustCompile(Alphanumeric) - rxNumeric = regexp.MustCompile(Numeric) - rxInt = regexp.MustCompile(Int) - rxFloat = regexp.MustCompile(Float) - rxHexadecimal = regexp.MustCompile(Hexadecimal) - rxHexcolor = regexp.MustCompile(Hexcolor) - rxRGBcolor = regexp.MustCompile(RGBcolor) - rxASCII = regexp.MustCompile(ASCII) - rxPrintableASCII = regexp.MustCompile(PrintableASCII) - rxMultibyte = regexp.MustCompile(Multibyte) - rxFullWidth = regexp.MustCompile(FullWidth) - rxHalfWidth = regexp.MustCompile(HalfWidth) - rxBase64 = regexp.MustCompile(Base64) - rxDataURI = regexp.MustCompile(DataURI) - rxMagnetURI = regexp.MustCompile(MagnetURI) - rxLatitude = regexp.MustCompile(Latitude) - rxLongitude = regexp.MustCompile(Longitude) - rxDNSName = regexp.MustCompile(DNSName) - rxURL = regexp.MustCompile(URL) - rxSSN = regexp.MustCompile(SSN) - rxWinPath = regexp.MustCompile(WinPath) - rxUnixPath = regexp.MustCompile(UnixPath) - rxSemver = regexp.MustCompile(Semver) - rxHasLowerCase = regexp.MustCompile(hasLowerCase) - rxHasUpperCase = regexp.MustCompile(hasUpperCase) - rxHasWhitespace = regexp.MustCompile(hasWhitespace) - rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly) - rxIMEI = regexp.MustCompile(IMEI) - rxIMSI = regexp.MustCompile(IMSI) -) diff --git a/vendor/github.com/asaskevich/govalidator/types.go b/vendor/github.com/asaskevich/govalidator/types.go deleted file mode 100644 index 54218bf..0000000 --- a/vendor/github.com/asaskevich/govalidator/types.go +++ /dev/null @@ -1,655 +0,0 @@ -package govalidator - -import ( - "reflect" - "regexp" - "sort" - "sync" -) - -// Validator is a wrapper for a validator function that returns bool and accepts string. -type Validator func(str string) bool - -// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. -// The second parameter should be the context (in the case of validating a struct: the whole object being validated). -type CustomTypeValidator func(i interface{}, o interface{}) bool - -// ParamValidator is a wrapper for validator functions that accept additional parameters. -type ParamValidator func(str string, params ...string) bool - -// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value -type InterfaceParamValidator func(in interface{}, params ...string) bool -type tagOptionsMap map[string]tagOption - -func (t tagOptionsMap) orderedKeys() []string { - var keys []string - for k := range t { - keys = append(keys, k) - } - - sort.Slice(keys, func(a, b int) bool { - return t[keys[a]].order < t[keys[b]].order - }) - - return keys -} - -type tagOption struct { - name string - customErrorMessage string - order int -} - -// UnsupportedTypeError is a wrapper for reflect.Type -type UnsupportedTypeError struct { - Type reflect.Type -} - -// stringValues is a slice of reflect.Value holding *reflect.StringValue. -// It implements the methods to sort by string. -type stringValues []reflect.Value - -// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value -var InterfaceParamTagMap = map[string]InterfaceParamValidator{ - "type": IsType, -} - -// InterfaceParamTagRegexMap maps interface param tags to their respective regexes. -var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{ - "type": regexp.MustCompile(`^type\((.*)\)$`), -} - -// ParamTagMap is a map of functions accept variants parameters -var ParamTagMap = map[string]ParamValidator{ - "length": ByteLength, - "range": Range, - "runelength": RuneLength, - "stringlength": StringLength, - "matches": StringMatches, - "in": IsInRaw, - "rsapub": IsRsaPub, - "minstringlength": MinStringLength, - "maxstringlength": MaxStringLength, -} - -// ParamTagRegexMap maps param tags to their respective regexes. -var ParamTagRegexMap = map[string]*regexp.Regexp{ - "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), - "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), - "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), - "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), - "in": regexp.MustCompile(`^in\((.*)\)`), - "matches": regexp.MustCompile(`^matches\((.+)\)$`), - "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), - "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"), - "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"), -} - -type customTypeTagMap struct { - validators map[string]CustomTypeValidator - - sync.RWMutex -} - -func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { - tm.RLock() - defer tm.RUnlock() - v, ok := tm.validators[name] - return v, ok -} - -func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { - tm.Lock() - defer tm.Unlock() - tm.validators[name] = ctv -} - -// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. -// Use this to validate compound or custom types that need to be handled as a whole, e.g. -// `type UUID [16]byte` (this would be handled as an array of bytes). -var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} - -// TagMap is a map of functions, that can be used as tags for ValidateStruct function. -var TagMap = map[string]Validator{ - "email": IsEmail, - "url": IsURL, - "dialstring": IsDialString, - "requrl": IsRequestURL, - "requri": IsRequestURI, - "alpha": IsAlpha, - "utfletter": IsUTFLetter, - "alphanum": IsAlphanumeric, - "utfletternum": IsUTFLetterNumeric, - "numeric": IsNumeric, - "utfnumeric": IsUTFNumeric, - "utfdigit": IsUTFDigit, - "hexadecimal": IsHexadecimal, - "hexcolor": IsHexcolor, - "rgbcolor": IsRGBcolor, - "lowercase": IsLowerCase, - "uppercase": IsUpperCase, - "int": IsInt, - "float": IsFloat, - "null": IsNull, - "notnull": IsNotNull, - "uuid": IsUUID, - "uuidv3": IsUUIDv3, - "uuidv4": IsUUIDv4, - "uuidv5": IsUUIDv5, - "creditcard": IsCreditCard, - "isbn10": IsISBN10, - "isbn13": IsISBN13, - "json": IsJSON, - "multibyte": IsMultibyte, - "ascii": IsASCII, - "printableascii": IsPrintableASCII, - "fullwidth": IsFullWidth, - "halfwidth": IsHalfWidth, - "variablewidth": IsVariableWidth, - "base64": IsBase64, - "datauri": IsDataURI, - "ip": IsIP, - "port": IsPort, - "ipv4": IsIPv4, - "ipv6": IsIPv6, - "dns": IsDNSName, - "host": IsHost, - "mac": IsMAC, - "latitude": IsLatitude, - "longitude": IsLongitude, - "ssn": IsSSN, - "semver": IsSemver, - "rfc3339": IsRFC3339, - "rfc3339WithoutZone": IsRFC3339WithoutZone, - "ISO3166Alpha2": IsISO3166Alpha2, - "ISO3166Alpha3": IsISO3166Alpha3, - "ISO4217": IsISO4217, - "IMEI": IsIMEI, -} - -// ISO3166Entry stores country codes -type ISO3166Entry struct { - EnglishShortName string - FrenchShortName string - Alpha2Code string - Alpha3Code string - Numeric string -} - -//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" -var ISO3166List = []ISO3166Entry{ - {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, - {"Albania", "Albanie (l')", "AL", "ALB", "008"}, - {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, - {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, - {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, - {"Andorra", "Andorre (l')", "AD", "AND", "020"}, - {"Angola", "Angola (l')", "AO", "AGO", "024"}, - {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, - {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, - {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, - {"Australia", "Australie (l')", "AU", "AUS", "036"}, - {"Austria", "Autriche (l')", "AT", "AUT", "040"}, - {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, - {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, - {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, - {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, - {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, - {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, - {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, - {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, - {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, - {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, - {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, - {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, - {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, - {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, - {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, - {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, - {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, - {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, - {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, - {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, - {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, - {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, - {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, - {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, - {"Canada", "Canada (le)", "CA", "CAN", "124"}, - {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, - {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, - {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, - {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, - {"Chad", "Tchad (le)", "TD", "TCD", "148"}, - {"Chile", "Chili (le)", "CL", "CHL", "152"}, - {"China", "Chine (la)", "CN", "CHN", "156"}, - {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, - {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, - {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, - {"Colombia", "Colombie (la)", "CO", "COL", "170"}, - {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, - {"Mayotte", "Mayotte", "YT", "MYT", "175"}, - {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, - {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, - {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, - {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, - {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, - {"Cuba", "Cuba", "CU", "CUB", "192"}, - {"Cyprus", "Chypre", "CY", "CYP", "196"}, - {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, - {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, - {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, - {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, - {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, - {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, - {"El Salvador", "El Salvador", "SV", "SLV", "222"}, - {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, - {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, - {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, - {"Estonia", "Estonie (l')", "EE", "EST", "233"}, - {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, - {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, - {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, - {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, - {"Finland", "Finlande (la)", "FI", "FIN", "246"}, - {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, - {"France", "France (la)", "FR", "FRA", "250"}, - {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, - {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, - {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, - {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, - {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, - {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, - {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, - {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, - {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, - {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, - {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, - {"Kiribati", "Kiribati", "KI", "KIR", "296"}, - {"Greece", "Grèce (la)", "GR", "GRC", "300"}, - {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, - {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, - {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, - {"Guam", "Guam", "GU", "GUM", "316"}, - {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, - {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, - {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, - {"Haiti", "Haïti", "HT", "HTI", "332"}, - {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, - {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, - {"Honduras", "Honduras (le)", "HN", "HND", "340"}, - {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, - {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, - {"Iceland", "Islande (l')", "IS", "ISL", "352"}, - {"India", "Inde (l')", "IN", "IND", "356"}, - {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, - {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, - {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, - {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, - {"Israel", "Israël", "IL", "ISR", "376"}, - {"Italy", "Italie (l')", "IT", "ITA", "380"}, - {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, - {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, - {"Japan", "Japon (le)", "JP", "JPN", "392"}, - {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, - {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, - {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, - {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, - {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, - {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, - {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, - {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, - {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, - {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, - {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, - {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, - {"Libya", "Libye (la)", "LY", "LBY", "434"}, - {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, - {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, - {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, - {"Macao", "Macao", "MO", "MAC", "446"}, - {"Madagascar", "Madagascar", "MG", "MDG", "450"}, - {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, - {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, - {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, - {"Mali", "Mali (le)", "ML", "MLI", "466"}, - {"Malta", "Malte", "MT", "MLT", "470"}, - {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, - {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, - {"Mauritius", "Maurice", "MU", "MUS", "480"}, - {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, - {"Monaco", "Monaco", "MC", "MCO", "492"}, - {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, - {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, - {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, - {"Montserrat", "Montserrat", "MS", "MSR", "500"}, - {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, - {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, - {"Oman", "Oman", "OM", "OMN", "512"}, - {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, - {"Nauru", "Nauru", "NR", "NRU", "520"}, - {"Nepal", "Népal (le)", "NP", "NPL", "524"}, - {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, - {"Curaçao", "Curaçao", "CW", "CUW", "531"}, - {"Aruba", "Aruba", "AW", "ABW", "533"}, - {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, - {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, - {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, - {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, - {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, - {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, - {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, - {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, - {"Niue", "Niue", "NU", "NIU", "570"}, - {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, - {"Norway", "Norvège (la)", "NO", "NOR", "578"}, - {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, - {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, - {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, - {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, - {"Palau", "Palaos (les)", "PW", "PLW", "585"}, - {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, - {"Panama", "Panama (le)", "PA", "PAN", "591"}, - {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, - {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, - {"Peru", "Pérou (le)", "PE", "PER", "604"}, - {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, - {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, - {"Poland", "Pologne (la)", "PL", "POL", "616"}, - {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, - {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, - {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, - {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, - {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, - {"Réunion", "Réunion (La)", "RE", "REU", "638"}, - {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, - {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, - {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, - {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, - {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, - {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, - {"Anguilla", "Anguilla", "AI", "AIA", "660"}, - {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, - {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, - {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, - {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, - {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, - {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, - {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, - {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, - {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, - {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, - {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, - {"Singapore", "Singapour", "SG", "SGP", "702"}, - {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, - {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, - {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, - {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, - {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, - {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, - {"Spain", "Espagne (l')", "ES", "ESP", "724"}, - {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, - {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, - {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, - {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, - {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, - {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, - {"Sweden", "Suède (la)", "SE", "SWE", "752"}, - {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, - {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, - {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, - {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, - {"Togo", "Togo (le)", "TG", "TGO", "768"}, - {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, - {"Tonga", "Tonga (les)", "TO", "TON", "776"}, - {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, - {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, - {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, - {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, - {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, - {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, - {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, - {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, - {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, - {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, - {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, - {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, - {"Guernsey", "Guernesey", "GG", "GGY", "831"}, - {"Jersey", "Jersey", "JE", "JEY", "832"}, - {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, - {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, - {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, - {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, - {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, - {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, - {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, - {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, - {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, - {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, - {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, - {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, -} - -// ISO4217List is the list of ISO currency codes -var ISO4217List = []string{ - "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", - "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", - "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", - "DJF", "DKK", "DOP", "DZD", - "EGP", "ERN", "ETB", "EUR", - "FJD", "FKP", - "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", - "HKD", "HNL", "HRK", "HTG", "HUF", - "IDR", "ILS", "INR", "IQD", "IRR", "ISK", - "JMD", "JOD", "JPY", - "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", - "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", - "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", - "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", - "OMR", - "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", - "QAR", - "RON", "RSD", "RUB", "RWF", - "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL", - "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", - "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", - "VEF", "VES", "VND", "VUV", - "WST", - "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", - "YER", - "ZAR", "ZMW", "ZWL", -} - -// ISO693Entry stores ISO language codes -type ISO693Entry struct { - Alpha3bCode string - Alpha2Code string - English string -} - -//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json -var ISO693List = []ISO693Entry{ - {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, - {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, - {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, - {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, - {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, - {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, - {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, - {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, - {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, - {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, - {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, - {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, - {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, - {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, - {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, - {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, - {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, - {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, - {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, - {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, - {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, - {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, - {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, - {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, - {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, - {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, - {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, - {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, - {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, - {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, - {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, - {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, - {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, - {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, - {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, - {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, - {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, - {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, - {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, - {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, - {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, - {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, - {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, - {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, - {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, - {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, - {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, - {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, - {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, - {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, - {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, - {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, - {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, - {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, - {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, - {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, - {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, - {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, - {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, - {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, - {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, - {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, - {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, - {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, - {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, - {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, - {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, - {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, - {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, - {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, - {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, - {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, - {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, - {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, - {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, - {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, - {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, - {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, - {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, - {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, - {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, - {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, - {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, - {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, - {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, - {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, - {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, - {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, - {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, - {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, - {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, - {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, - {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, - {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, - {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, - {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, - {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, - {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, - {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, - {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, - {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, - {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, - {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, - {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, - {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, - {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, - {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, - {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, - {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, - {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, - {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, - {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, - {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, - {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, - {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, - {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, - {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, - {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, - {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, - {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, - {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, - {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, - {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, - {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, - {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, - {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, - {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, - {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, - {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, - {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, - {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, - {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, - {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, - {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, - {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, - {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, - {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, - {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, - {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, - {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, - {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, - {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, - {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, - {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, - {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, - {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, - {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, - {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, - {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, - {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, - {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, - {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, - {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, - {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, - {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, - {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, - {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, - {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, - {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, - {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, - {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, - {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, - {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, - {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, - {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, - {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, - {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, - {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, - {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, - {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, - {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, - {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, - {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, - {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, - {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, - {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, - {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, - {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, - {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, - {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, - {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, - {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, - {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, - {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, -} diff --git a/vendor/github.com/asaskevich/govalidator/utils.go b/vendor/github.com/asaskevich/govalidator/utils.go deleted file mode 100644 index f4c30f8..0000000 --- a/vendor/github.com/asaskevich/govalidator/utils.go +++ /dev/null @@ -1,270 +0,0 @@ -package govalidator - -import ( - "errors" - "fmt" - "html" - "math" - "path" - "regexp" - "strings" - "unicode" - "unicode/utf8" -) - -// Contains checks if the string contains the substring. -func Contains(str, substring string) bool { - return strings.Contains(str, substring) -} - -// Matches checks if string matches the pattern (pattern is regular expression) -// In case of error return false -func Matches(str, pattern string) bool { - match, _ := regexp.MatchString(pattern, str) - return match -} - -// LeftTrim trims characters from the left side of the input. -// If second argument is empty, it will remove leading spaces. -func LeftTrim(str, chars string) string { - if chars == "" { - return strings.TrimLeftFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("^[" + chars + "]+") - return r.ReplaceAllString(str, "") -} - -// RightTrim trims characters from the right side of the input. -// If second argument is empty, it will remove trailing spaces. -func RightTrim(str, chars string) string { - if chars == "" { - return strings.TrimRightFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("[" + chars + "]+$") - return r.ReplaceAllString(str, "") -} - -// Trim trims characters from both sides of the input. -// If second argument is empty, it will remove spaces. -func Trim(str, chars string) string { - return LeftTrim(RightTrim(str, chars), chars) -} - -// WhiteList removes characters that do not appear in the whitelist. -func WhiteList(str, chars string) string { - pattern := "[^" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// BlackList removes characters that appear in the blacklist. -func BlackList(str, chars string) string { - pattern := "[" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// StripLow removes characters with a numerical value < 32 and 127, mostly control characters. -// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). -func StripLow(str string, keepNewLines bool) string { - chars := "" - if keepNewLines { - chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F" - } else { - chars = "\x00-\x1F\x7F" - } - return BlackList(str, chars) -} - -// ReplacePattern replaces regular expression pattern in string -func ReplacePattern(str, pattern, replace string) string { - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, replace) -} - -// Escape replaces <, >, & and " with HTML entities. -var Escape = html.EscapeString - -func addSegment(inrune, segment []rune) []rune { - if len(segment) == 0 { - return inrune - } - if len(inrune) != 0 { - inrune = append(inrune, '_') - } - inrune = append(inrune, segment...) - return inrune -} - -// UnderscoreToCamelCase converts from underscore separated form to camel case form. -// Ex.: my_func => MyFunc -func UnderscoreToCamelCase(s string) string { - return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1) -} - -// CamelCaseToUnderscore converts from camel case form to underscore separated form. -// Ex.: MyFunc => my_func -func CamelCaseToUnderscore(str string) string { - var output []rune - var segment []rune - for _, r := range str { - - // not treat number as separate segment - if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) { - output = addSegment(output, segment) - segment = nil - } - segment = append(segment, unicode.ToLower(r)) - } - output = addSegment(output, segment) - return string(output) -} - -// Reverse returns reversed string -func Reverse(s string) string { - r := []rune(s) - for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { - r[i], r[j] = r[j], r[i] - } - return string(r) -} - -// GetLines splits string by "\n" and return array of lines -func GetLines(s string) []string { - return strings.Split(s, "\n") -} - -// GetLine returns specified line of multiline string -func GetLine(s string, index int) (string, error) { - lines := GetLines(s) - if index < 0 || index >= len(lines) { - return "", errors.New("line index out of bounds") - } - return lines[index], nil -} - -// RemoveTags removes all tags from HTML string -func RemoveTags(s string) string { - return ReplacePattern(s, "<[^>]*>", "") -} - -// SafeFileName returns safe string that can be used in file names -func SafeFileName(str string) string { - name := strings.ToLower(str) - name = path.Clean(path.Base(name)) - name = strings.Trim(name, " ") - separators, err := regexp.Compile(`[ &_=+:]`) - if err == nil { - name = separators.ReplaceAllString(name, "-") - } - legal, err := regexp.Compile(`[^[:alnum:]-.]`) - if err == nil { - name = legal.ReplaceAllString(name, "") - } - for strings.Contains(name, "--") { - name = strings.Replace(name, "--", "-", -1) - } - return name -} - -// NormalizeEmail canonicalize an email address. -// The local part of the email address is lowercased for all domains; the hostname is always lowercased and -// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail). -// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and -// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are -// normalized to @gmail.com. -func NormalizeEmail(str string) (string, error) { - if !IsEmail(str) { - return "", fmt.Errorf("%s is not an email", str) - } - parts := strings.Split(str, "@") - parts[0] = strings.ToLower(parts[0]) - parts[1] = strings.ToLower(parts[1]) - if parts[1] == "gmail.com" || parts[1] == "googlemail.com" { - parts[1] = "gmail.com" - parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0] - } - return strings.Join(parts, "@"), nil -} - -// Truncate a string to the closest length without breaking words. -func Truncate(str string, length int, ending string) string { - var aftstr, befstr string - if len(str) > length { - words := strings.Fields(str) - before, present := 0, 0 - for i := range words { - befstr = aftstr - before = present - aftstr = aftstr + words[i] + " " - present = len(aftstr) - if present > length && i != 0 { - if (length - before) < (present - length) { - return Trim(befstr, " /\\.,\"'#!?&@+-") + ending - } - return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending - } - } - } - - return str -} - -// PadLeft pads left side of a string if size of string is less then indicated pad length -func PadLeft(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, false) -} - -// PadRight pads right side of a string if size of string is less then indicated pad length -func PadRight(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, false, true) -} - -// PadBoth pads both sides of a string if size of string is less then indicated pad length -func PadBoth(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, true) -} - -// PadString either left, right or both sides. -// Note that padding string can be unicode and more then one character -func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string { - - // When padded length is less then the current string size - if padLen < utf8.RuneCountInString(str) { - return str - } - - padLen -= utf8.RuneCountInString(str) - - targetLen := padLen - - targetLenLeft := targetLen - targetLenRight := targetLen - if padLeft && padRight { - targetLenLeft = padLen / 2 - targetLenRight = padLen - targetLenLeft - } - - strToRepeatLen := utf8.RuneCountInString(padStr) - - repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen))) - repeatedString := strings.Repeat(padStr, repeatTimes) - - leftSide := "" - if padLeft { - leftSide = repeatedString[0:targetLenLeft] - } - - rightSide := "" - if padRight { - rightSide = repeatedString[0:targetLenRight] - } - - return leftSide + str + rightSide -} - -// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object -func TruncatingErrorf(str string, args ...interface{}) error { - n := strings.Count(str, "%s") - return fmt.Errorf(str, args[:n]...) -} diff --git a/vendor/github.com/asaskevich/govalidator/validator.go b/vendor/github.com/asaskevich/govalidator/validator.go deleted file mode 100644 index 5c918fc..0000000 --- a/vendor/github.com/asaskevich/govalidator/validator.go +++ /dev/null @@ -1,1627 +0,0 @@ -// Package govalidator is package of validators and sanitizers for strings, structs and collections. -package govalidator - -import ( - "bytes" - "crypto/rsa" - "crypto/x509" - "encoding/base64" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "net" - "net/url" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" -) - -var ( - fieldsRequiredByDefault bool - nilPtrAllowedByRequired = false - notNumberRegexp = regexp.MustCompile("[^0-9]+") - whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`) - paramsRegexp = regexp.MustCompile(`\(.*\)$`) -) - -const maxURLRuneCount = 2083 -const minURLRuneCount = 3 -const rfc3339WithoutZone = "2006-01-02T15:04:05" - -// SetFieldsRequiredByDefault causes validation to fail when struct fields -// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). -// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -// type exampleStruct struct { -// Name string `` -// Email string `valid:"email"` -// This, however, will only fail when Email is empty or an invalid email address: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email"` -// Lastly, this will only fail when Email is an invalid email address but not when it's empty: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email,optional"` -func SetFieldsRequiredByDefault(value bool) { - fieldsRequiredByDefault = value -} - -// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required. -// The validation will still reject ptr fields in their zero value state. Example with this enabled: -// type exampleStruct struct { -// Name *string `valid:"required"` -// With `Name` set to "", this will be considered invalid input and will cause a validation error. -// With `Name` set to nil, this will be considered valid by validation. -// By default this is disabled. -func SetNilPtrAllowedByRequired(value bool) { - nilPtrAllowedByRequired = value -} - -// IsEmail checks if the string is an email. -func IsEmail(str string) bool { - // TODO uppercase letters are not supported - return rxEmail.MatchString(str) -} - -// IsExistingEmail checks if the string is an email of existing domain -func IsExistingEmail(email string) bool { - - if len(email) < 6 || len(email) > 254 { - return false - } - at := strings.LastIndex(email, "@") - if at <= 0 || at > len(email)-3 { - return false - } - user := email[:at] - host := email[at+1:] - if len(user) > 64 { - return false - } - switch host { - case "localhost", "example.com": - return true - } - if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) { - return false - } - if _, err := net.LookupMX(host); err != nil { - if _, err := net.LookupIP(host); err != nil { - return false - } - } - - return true -} - -// IsURL checks if the string is an URL. -func IsURL(str string) bool { - if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") { - return false - } - strTemp := str - if strings.Contains(str, ":") && !strings.Contains(str, "://") { - // support no indicated urlscheme but with colon for port number - // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString - strTemp = "http://" + str - } - u, err := url.Parse(strTemp) - if err != nil { - return false - } - if strings.HasPrefix(u.Host, ".") { - return false - } - if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) { - return false - } - return rxURL.MatchString(str) -} - -// IsRequestURL checks if the string rawurl, assuming -// it was received in an HTTP request, is a valid -// URL confirm to RFC 3986 -func IsRequestURL(rawurl string) bool { - url, err := url.ParseRequestURI(rawurl) - if err != nil { - return false //Couldn't even parse the rawurl - } - if len(url.Scheme) == 0 { - return false //No Scheme found - } - return true -} - -// IsRequestURI checks if the string rawurl, assuming -// it was received in an HTTP request, is an -// absolute URI or an absolute path. -func IsRequestURI(rawurl string) bool { - _, err := url.ParseRequestURI(rawurl) - return err == nil -} - -// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid. -func IsAlpha(str string) bool { - if IsNull(str) { - return true - } - return rxAlpha.MatchString(str) -} - -//IsUTFLetter checks if the string contains only unicode letter characters. -//Similar to IsAlpha but for all languages. Empty string is valid. -func IsUTFLetter(str string) bool { - if IsNull(str) { - return true - } - - for _, c := range str { - if !unicode.IsLetter(c) { - return false - } - } - return true - -} - -// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid. -func IsAlphanumeric(str string) bool { - if IsNull(str) { - return true - } - return rxAlphanumeric.MatchString(str) -} - -// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid. -func IsUTFLetterNumeric(str string) bool { - if IsNull(str) { - return true - } - for _, c := range str { - if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok - return false - } - } - return true - -} - -// IsNumeric checks if the string contains only numbers. Empty string is valid. -func IsNumeric(str string) bool { - if IsNull(str) { - return true - } - return rxNumeric.MatchString(str) -} - -// IsUTFNumeric checks if the string contains only unicode numbers of any kind. -// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid. -func IsUTFNumeric(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsNumber(c) { //numbers && minus sign are ok - return false - } - } - return true - -} - -// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid. -func IsUTFDigit(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsDigit(c) { //digits && minus sign are ok - return false - } - } - return true - -} - -// IsHexadecimal checks if the string is a hexadecimal number. -func IsHexadecimal(str string) bool { - return rxHexadecimal.MatchString(str) -} - -// IsHexcolor checks if the string is a hexadecimal color. -func IsHexcolor(str string) bool { - return rxHexcolor.MatchString(str) -} - -// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB). -func IsRGBcolor(str string) bool { - return rxRGBcolor.MatchString(str) -} - -// IsLowerCase checks if the string is lowercase. Empty string is valid. -func IsLowerCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToLower(str) -} - -// IsUpperCase checks if the string is uppercase. Empty string is valid. -func IsUpperCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToUpper(str) -} - -// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid. -func HasLowerCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasLowerCase.MatchString(str) -} - -// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid. -func HasUpperCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasUpperCase.MatchString(str) -} - -// IsInt checks if the string is an integer. Empty string is valid. -func IsInt(str string) bool { - if IsNull(str) { - return true - } - return rxInt.MatchString(str) -} - -// IsFloat checks if the string is a float. -func IsFloat(str string) bool { - return str != "" && rxFloat.MatchString(str) -} - -// IsDivisibleBy checks if the string is a number that's divisible by another. -// If second argument is not valid integer or zero, it's return false. -// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero). -func IsDivisibleBy(str, num string) bool { - f, _ := ToFloat(str) - p := int64(f) - q, _ := ToInt(num) - if q == 0 { - return false - } - return (p == 0) || (p%q == 0) -} - -// IsNull checks if the string is null. -func IsNull(str string) bool { - return len(str) == 0 -} - -// IsNotNull checks if the string is not null. -func IsNotNull(str string) bool { - return !IsNull(str) -} - -// HasWhitespaceOnly checks the string only contains whitespace -func HasWhitespaceOnly(str string) bool { - return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str) -} - -// HasWhitespace checks if the string contains any whitespace -func HasWhitespace(str string) bool { - return len(str) > 0 && rxHasWhitespace.MatchString(str) -} - -// IsByteLength checks if the string's length (in bytes) falls in a range. -func IsByteLength(str string, min, max int) bool { - return len(str) >= min && len(str) <= max -} - -// IsUUIDv3 checks if the string is a UUID version 3. -func IsUUIDv3(str string) bool { - return rxUUID3.MatchString(str) -} - -// IsUUIDv4 checks if the string is a UUID version 4. -func IsUUIDv4(str string) bool { - return rxUUID4.MatchString(str) -} - -// IsUUIDv5 checks if the string is a UUID version 5. -func IsUUIDv5(str string) bool { - return rxUUID5.MatchString(str) -} - -// IsUUID checks if the string is a UUID (version 3, 4 or 5). -func IsUUID(str string) bool { - return rxUUID.MatchString(str) -} - -// IsCreditCard checks if the string is a credit card. -func IsCreditCard(str string) bool { - sanitized := notNumberRegexp.ReplaceAllString(str, "") - if !rxCreditCard.MatchString(sanitized) { - return false - } - var sum int64 - var digit string - var tmpNum int64 - var shouldDouble bool - for i := len(sanitized) - 1; i >= 0; i-- { - digit = sanitized[i:(i + 1)] - tmpNum, _ = ToInt(digit) - if shouldDouble { - tmpNum *= 2 - if tmpNum >= 10 { - sum += (tmpNum % 10) + 1 - } else { - sum += tmpNum - } - } else { - sum += tmpNum - } - shouldDouble = !shouldDouble - } - - return sum%10 == 0 -} - -// IsISBN10 checks if the string is an ISBN version 10. -func IsISBN10(str string) bool { - return IsISBN(str, 10) -} - -// IsISBN13 checks if the string is an ISBN version 13. -func IsISBN13(str string) bool { - return IsISBN(str, 13) -} - -// IsISBN checks if the string is an ISBN (version 10 or 13). -// If version value is not equal to 10 or 13, it will be checks both variants. -func IsISBN(str string, version int) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - var checksum int32 - var i int32 - if version == 10 { - if !rxISBN10.MatchString(sanitized) { - return false - } - for i = 0; i < 9; i++ { - checksum += (i + 1) * int32(sanitized[i]-'0') - } - if sanitized[9] == 'X' { - checksum += 10 * 10 - } else { - checksum += 10 * int32(sanitized[9]-'0') - } - if checksum%11 == 0 { - return true - } - return false - } else if version == 13 { - if !rxISBN13.MatchString(sanitized) { - return false - } - factor := []int32{1, 3} - for i = 0; i < 12; i++ { - checksum += factor[i%2] * int32(sanitized[i]-'0') - } - return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 - } - return IsISBN(str, 10) || IsISBN(str, 13) -} - -// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal). -func IsJSON(str string) bool { - var js json.RawMessage - return json.Unmarshal([]byte(str), &js) == nil -} - -// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid. -func IsMultibyte(str string) bool { - if IsNull(str) { - return true - } - return rxMultibyte.MatchString(str) -} - -// IsASCII checks if the string contains ASCII chars only. Empty string is valid. -func IsASCII(str string) bool { - if IsNull(str) { - return true - } - return rxASCII.MatchString(str) -} - -// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid. -func IsPrintableASCII(str string) bool { - if IsNull(str) { - return true - } - return rxPrintableASCII.MatchString(str) -} - -// IsFullWidth checks if the string contains any full-width chars. Empty string is valid. -func IsFullWidth(str string) bool { - if IsNull(str) { - return true - } - return rxFullWidth.MatchString(str) -} - -// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid. -func IsHalfWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) -} - -// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid. -func IsVariableWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str) -} - -// IsBase64 checks if a string is base64 encoded. -func IsBase64(str string) bool { - return rxBase64.MatchString(str) -} - -// IsFilePath checks is a string is Win or Unix file path and returns it's type. -func IsFilePath(str string) (bool, int) { - if rxWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false, Win - } - return true, Win - } else if rxUnixPath.MatchString(str) { - return true, Unix - } - return false, Unknown -} - -// IsDataURI checks if a string is base64 encoded data URI such as an image -func IsDataURI(str string) bool { - dataURI := strings.Split(str, ",") - if !rxDataURI.MatchString(dataURI[0]) { - return false - } - return IsBase64(dataURI[1]) -} - -// IsMagnetURI checks if a string is valid magnet URI -func IsMagnetURI(str string) bool { - return rxMagnetURI.MatchString(str) -} - -// IsISO3166Alpha2 checks if a string is valid two-letter country code -func IsISO3166Alpha2(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO3166Alpha3 checks if a string is valid three-letter country code -func IsISO3166Alpha3(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha3Code { - return true - } - } - return false -} - -// IsISO693Alpha2 checks if a string is valid two-letter language code -func IsISO693Alpha2(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO693Alpha3b checks if a string is valid three-letter language code -func IsISO693Alpha3b(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha3bCode { - return true - } - } - return false -} - -// IsDNSName will validate the given string as a DNS name -func IsDNSName(str string) bool { - if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 { - // constraints already violated - return false - } - return !IsIP(str) && rxDNSName.MatchString(str) -} - -// IsHash checks if a string is a hash of type algorithm. -// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'] -func IsHash(str string, algorithm string) bool { - var len string - algo := strings.ToLower(algorithm) - - if algo == "crc32" || algo == "crc32b" { - len = "8" - } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" { - len = "32" - } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" { - len = "40" - } else if algo == "tiger192" { - len = "48" - } else if algo == "sha256" { - len = "64" - } else if algo == "sha384" { - len = "96" - } else if algo == "sha512" { - len = "128" - } else { - return false - } - - return Matches(str, "^[a-f0-9]{"+len+"}$") -} - -// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")` -func IsSHA512(str string) bool { - return IsHash(str, "sha512") -} - -// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")` -func IsSHA384(str string) bool { - return IsHash(str, "sha384") -} - -// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")` -func IsSHA256(str string) bool { - return IsHash(str, "sha256") -} - -// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")` -func IsTiger192(str string) bool { - return IsHash(str, "tiger192") -} - -// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")` -func IsTiger160(str string) bool { - return IsHash(str, "tiger160") -} - -// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")` -func IsRipeMD160(str string) bool { - return IsHash(str, "ripemd160") -} - -// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")` -func IsSHA1(str string) bool { - return IsHash(str, "sha1") -} - -// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")` -func IsTiger128(str string) bool { - return IsHash(str, "tiger128") -} - -// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")` -func IsRipeMD128(str string) bool { - return IsHash(str, "ripemd128") -} - -// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")` -func IsCRC32(str string) bool { - return IsHash(str, "crc32") -} - -// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")` -func IsCRC32b(str string) bool { - return IsHash(str, "crc32b") -} - -// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")` -func IsMD5(str string) bool { - return IsHash(str, "md5") -} - -// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")` -func IsMD4(str string) bool { - return IsHash(str, "md4") -} - -// IsDialString validates the given string for usage with the various Dial() functions -func IsDialString(str string) bool { - if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) { - return true - } - - return false -} - -// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP` -func IsIP(str string) bool { - return net.ParseIP(str) != nil -} - -// IsPort checks if a string represents a valid port -func IsPort(str string) bool { - if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 { - return true - } - return false -} - -// IsIPv4 checks if the string is an IP version 4. -func IsIPv4(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ".") -} - -// IsIPv6 checks if the string is an IP version 6. -func IsIPv6(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ":") -} - -// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6) -func IsCIDR(str string) bool { - _, _, err := net.ParseCIDR(str) - return err == nil -} - -// IsMAC checks if a string is valid MAC address. -// Possible MAC formats: -// 01:23:45:67:89:ab -// 01:23:45:67:89:ab:cd:ef -// 01-23-45-67-89-ab -// 01-23-45-67-89-ab-cd-ef -// 0123.4567.89ab -// 0123.4567.89ab.cdef -func IsMAC(str string) bool { - _, err := net.ParseMAC(str) - return err == nil -} - -// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name -func IsHost(str string) bool { - return IsIP(str) || IsDNSName(str) -} - -// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. -func IsMongoID(str string) bool { - return rxHexadecimal.MatchString(str) && (len(str) == 24) -} - -// IsLatitude checks if a string is valid latitude. -func IsLatitude(str string) bool { - return rxLatitude.MatchString(str) -} - -// IsLongitude checks if a string is valid longitude. -func IsLongitude(str string) bool { - return rxLongitude.MatchString(str) -} - -// IsIMEI checks if a string is valid IMEI -func IsIMEI(str string) bool { - return rxIMEI.MatchString(str) -} - -// IsIMSI checks if a string is valid IMSI -func IsIMSI(str string) bool { - if !rxIMSI.MatchString(str) { - return false - } - - mcc, err := strconv.ParseInt(str[0:3], 10, 32) - if err != nil { - return false - } - - switch mcc { - case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219: - case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235: - case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257: - case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278: - case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293: - case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314: - case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346: - case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364: - case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402: - case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417: - case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428: - case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441: - case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467: - case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528: - case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545: - case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555: - case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611: - case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621: - case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631: - case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641: - case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652: - case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708: - case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736: - case 738, 740, 742, 744, 746, 748, 750, 995: - return true - default: - return false - } - return true -} - -// IsRsaPublicKey checks if a string is valid public key with provided length -func IsRsaPublicKey(str string, keylen int) bool { - bb := bytes.NewBufferString(str) - pemBytes, err := ioutil.ReadAll(bb) - if err != nil { - return false - } - block, _ := pem.Decode(pemBytes) - if block != nil && block.Type != "PUBLIC KEY" { - return false - } - var der []byte - - if block != nil { - der = block.Bytes - } else { - der, err = base64.StdEncoding.DecodeString(str) - if err != nil { - return false - } - } - - key, err := x509.ParsePKIXPublicKey(der) - if err != nil { - return false - } - pubkey, ok := key.(*rsa.PublicKey) - if !ok { - return false - } - bitlen := len(pubkey.N.Bytes()) * 8 - return bitlen == int(keylen) -} - -func toJSONName(tag string) string { - if tag == "" { - return "" - } - - // JSON name always comes first. If there's no options then split[0] is - // JSON name, if JSON name is not set, then split[0] is an empty string. - split := strings.SplitN(tag, ",", 2) - - name := split[0] - - // However it is possible that the field is skipped when - // (de-)serializing from/to JSON, in which case assume that there is no - // tag name to use - if name == "-" { - return "" - } - return name -} - -func prependPathToErrors(err error, path string) error { - switch err2 := err.(type) { - case Error: - err2.Path = append([]string{path}, err2.Path...) - return err2 - case Errors: - errors := err2.Errors() - for i, err3 := range errors { - errors[i] = prependPathToErrors(err3, path) - } - return err2 - } - return err -} - -// ValidateArray performs validation according to condition iterator that validates every element of the array -func ValidateArray(array []interface{}, iterator ConditionIterator) bool { - return Every(array, iterator) -} - -// ValidateMap use validation map for fields. -// result will be equal to `false` if there are any errors. -// s is the map containing the data to be validated. -// m is the validation map in the form: -// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}} -func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - var errs Errors - var index int - val := reflect.ValueOf(s) - for key, value := range s { - presentResult := true - validator, ok := m[key] - if !ok { - presentResult = false - var err error - err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - valueField := reflect.ValueOf(value) - mapResult := true - typeResult := true - structResult := true - resultField := true - switch subValidator := validator.(type) { - case map[string]interface{}: - var err error - if v, ok := value.(map[string]interface{}); !ok { - mapResult = false - err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } else { - mapResult, err = ValidateMap(v, subValidator) - if err != nil { - mapResult = false - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - case string: - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - subValidator != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - resultField, err = typeCheck(valueField, reflect.StructField{ - Name: key, - PkgPath: "", - Type: val.Type(), - Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)), - Offset: 0, - Index: []int{index}, - Anonymous: false, - }, val, nil) - if err != nil { - errs = append(errs, err) - } - case nil: - // already handlerd when checked before - default: - typeResult = false - err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - result = result && presentResult && typeResult && resultField && structResult && mapResult - index++ - } - // checks required keys - requiredResult := true - for key, value := range m { - if schema, ok := value.(string); ok { - tags := parseTagIntoMap(schema) - if required, ok := tags["required"]; ok { - if _, ok := s[key]; !ok { - requiredResult = false - if required.customErrorMessage != "" { - err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}} - } else { - err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}} - } - errs = append(errs, err) - } - } - } - } - - if len(errs) > 0 { - err = errs - } - return result && requiredResult, err -} - -// ValidateStruct use tags for fields. -// result will be equal to `false` if there are any errors. -// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail) -func ValidateStruct(s interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - val := reflect.ValueOf(s) - if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { - val = val.Elem() - } - // we only accept structs - if val.Kind() != reflect.Struct { - return false, fmt.Errorf("function only accepts structs; got %s", val.Kind()) - } - var errs Errors - for i := 0; i < val.NumField(); i++ { - valueField := val.Field(i) - typeField := val.Type().Field(i) - if typeField.PkgPath != "" { - continue // Private field - } - structResult := true - if valueField.Kind() == reflect.Interface { - valueField = valueField.Elem() - } - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - typeField.Tag.Get(tagName) != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, typeField.Name) - errs = append(errs, err) - } - } - resultField, err2 := typeCheck(valueField, typeField, val, nil) - if err2 != nil { - - // Replace structure name with JSON name if there is a tag on the variable - jsonTag := toJSONName(typeField.Tag.Get("json")) - if jsonTag != "" { - switch jsonError := err2.(type) { - case Error: - jsonError.Name = jsonTag - err2 = jsonError - case Errors: - for i2, err3 := range jsonError { - switch customErr := err3.(type) { - case Error: - customErr.Name = jsonTag - jsonError[i2] = customErr - } - } - - err2 = jsonError - } - } - - errs = append(errs, err2) - } - result = result && resultField && structResult - } - if len(errs) > 0 { - err = errs - } - return result, err -} - -// ValidateStructAsync performs async validation of the struct and returns results through the channels -func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateStruct(s) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// ValidateMapAsync performs async validation of the map and returns results through the channels -func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateMap(s, m) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""} -func parseTagIntoMap(tag string) tagOptionsMap { - optionsMap := make(tagOptionsMap) - options := strings.Split(tag, ",") - - for i, option := range options { - option = strings.TrimSpace(option) - - validationOptions := strings.Split(option, "~") - if !isValidTag(validationOptions[0]) { - continue - } - if len(validationOptions) == 2 { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i} - } else { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i} - } - } - return optionsMap -} - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - default: - if !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - return true -} - -// IsSSN will validate the given string as a U.S. Social Security Number -func IsSSN(str string) bool { - if str == "" || len(str) != 11 { - return false - } - return rxSSN.MatchString(str) -} - -// IsSemver checks if string is valid semantic version -func IsSemver(str string) bool { - return rxSemver.MatchString(str) -} - -// IsType checks if interface is of some type -func IsType(v interface{}, params ...string) bool { - if len(params) == 1 { - typ := params[0] - return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1) - } - return false -} - -// IsTime checks if string is valid according to given format -func IsTime(str string, format string) bool { - _, err := time.Parse(format, str) - return err == nil -} - -// IsUnixTime checks if string is valid unix timestamp value -func IsUnixTime(str string) bool { - if _, err := strconv.Atoi(str); err == nil { - return true - } - return false -} - -// IsRFC3339 checks if string is valid timestamp value according to RFC3339 -func IsRFC3339(str string) bool { - return IsTime(str, time.RFC3339) -} - -// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone. -func IsRFC3339WithoutZone(str string) bool { - return IsTime(str, rfc3339WithoutZone) -} - -// IsISO4217 checks if string is valid ISO currency code -func IsISO4217(str string) bool { - for _, currency := range ISO4217List { - if str == currency { - return true - } - } - - return false -} - -// ByteLength checks string's length -func ByteLength(str string, params ...string) bool { - if len(params) == 2 { - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return len(str) >= int(min) && len(str) <= int(max) - } - - return false -} - -// RuneLength checks string's length -// Alias for StringLength -func RuneLength(str string, params ...string) bool { - return StringLength(str, params...) -} - -// IsRsaPub checks whether string is valid RSA key -// Alias for IsRsaPublicKey -func IsRsaPub(str string, params ...string) bool { - if len(params) == 1 { - len, _ := ToInt(params[0]) - return IsRsaPublicKey(str, int(len)) - } - - return false -} - -// StringMatches checks if a string matches a given pattern. -func StringMatches(s string, params ...string) bool { - if len(params) == 1 { - pattern := params[0] - return Matches(s, pattern) - } - return false -} - -// StringLength checks string's length (including multi byte strings) -func StringLength(str string, params ...string) bool { - - if len(params) == 2 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return strLength >= int(min) && strLength <= int(max) - } - - return false -} - -// MinStringLength checks string's minimum length (including multi byte strings) -func MinStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - return strLength >= int(min) - } - - return false -} - -// MaxStringLength checks string's maximum length (including multi byte strings) -func MaxStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - max, _ := ToInt(params[0]) - return strLength <= int(max) - } - - return false -} - -// Range checks string's length -func Range(str string, params ...string) bool { - if len(params) == 2 { - value, _ := ToFloat(str) - min, _ := ToFloat(params[0]) - max, _ := ToFloat(params[1]) - return InRange(value, min, max) - } - - return false -} - -// IsInRaw checks if string is in list of allowed values -func IsInRaw(str string, params ...string) bool { - if len(params) == 1 { - rawParams := params[0] - - parsedParams := strings.Split(rawParams, "|") - - return IsIn(str, parsedParams...) - } - - return false -} - -// IsIn checks if string str is a member of the set of strings params -func IsIn(str string, params ...string) bool { - for _, param := range params { - if str == param { - return true - } - } - - return false -} - -func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) { - if nilPtrAllowedByRequired { - k := v.Kind() - if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() { - return true, nil - } - } - - if requiredOption, isRequired := options["required"]; isRequired { - if len(requiredOption.customErrorMessage) > 0 { - return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}} - } - return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}} - } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional { - return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}} - } - // not required and empty is valid - return true, nil -} - -func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) { - if !v.IsValid() { - return false, nil - } - - tag := t.Tag.Get(tagName) - - // checks if the field should be ignored - switch tag { - case "": - if v.Kind() != reflect.Slice && v.Kind() != reflect.Map { - if !fieldsRequiredByDefault { - return true, nil - } - return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}} - } - case "-": - return true, nil - } - - isRootType := false - if options == nil { - isRootType = true - options = parseTagIntoMap(tag) - } - - if isEmptyValue(v) { - // an empty value is not validated, checks only required - isValid, resultErr = checkRequired(v, t, options) - for key := range options { - delete(options, key) - } - return isValid, resultErr - } - - var customTypeErrors Errors - optionsOrder := options.orderedKeys() - for _, validatorName := range optionsOrder { - validatorStruct := options[validatorName] - if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok { - delete(options, validatorName) - - if result := validatefunc(v.Interface(), o.Interface()); !result { - if len(validatorStruct.customErrorMessage) > 0 { - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)}) - continue - } - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)}) - } - } - } - - if len(customTypeErrors.Errors()) > 0 { - return false, customTypeErrors - } - - if isRootType { - // Ensure that we've checked the value by all specified validators before report that the value is valid - defer func() { - delete(options, "optional") - delete(options, "required") - - if isValid && resultErr == nil && len(options) != 0 { - optionsOrder := options.orderedKeys() - for _, validator := range optionsOrder { - isValid = false - resultErr = Error{t.Name, fmt.Errorf( - "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}} - return - } - } - }() - } - - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for interface param validators - for key, value := range InterfaceParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := InterfaceParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - field := fmt.Sprint(v) - if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - } - } - - switch v.Kind() { - case reflect.Bool, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, - reflect.Float32, reflect.Float64, - reflect.String: - // for each tag option checks the map of validator functions - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for param validators - for key, value := range ParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := ParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - // type not yet supported, fail - return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}} - } - } - - if validatefunc, ok := TagMap[validator]; ok { - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field); !result && !negate || result && negate { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - //Not Yet Supported Types (Fail here!) - err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v) - return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}} - } - } - } - return true, nil - case reflect.Map: - if v.Type().Key().Kind() != reflect.String { - return false, &UnsupportedTypeError{v.Type()} - } - var sv stringValues - sv = v.MapKeys() - sort.Sort(sv) - result := true - for i, k := range sv { - var resultItem bool - var err error - if v.MapIndex(k).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.MapIndex(k), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.MapIndex(k).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Slice, reflect.Array: - result := true - for i := 0; i < v.Len(); i++ { - var resultItem bool - var err error - if v.Index(i).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.Index(i), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.Index(i).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Interface: - // If the value is an interface then encode its element - if v.IsNil() { - return true, nil - } - return ValidateStruct(v.Interface()) - case reflect.Ptr: - // If the value is a pointer then checks its element - if v.IsNil() { - return true, nil - } - return typeCheck(v.Elem(), t, o, options) - case reflect.Struct: - return true, nil - default: - return false, &UnsupportedTypeError{v.Type()} - } -} - -func stripParams(validatorString string) string { - return paramsRegexp.ReplaceAllString(validatorString, "") -} - -// isEmptyValue checks whether value empty or not -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.String, reflect.Array: - return v.Len() == 0 - case reflect.Map, reflect.Slice: - return v.Len() == 0 || v.IsNil() - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - - return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) -} - -// ErrorByField returns error for specified field of the struct -// validated by ValidateStruct or empty string if there are no errors -// or this field doesn't exists or doesn't have any errors. -func ErrorByField(e error, field string) string { - if e == nil { - return "" - } - return ErrorsByField(e)[field] -} - -// ErrorsByField returns map of errors of the struct validated -// by ValidateStruct or empty map if there are no errors. -func ErrorsByField(e error) map[string]string { - m := make(map[string]string) - if e == nil { - return m - } - // prototype for ValidateStruct - - switch e := e.(type) { - case Error: - m[e.Name] = e.Err.Error() - case Errors: - for _, item := range e.Errors() { - n := ErrorsByField(item) - for k, v := range n { - m[k] = v - } - } - } - - return m -} - -// Error returns string equivalent for reflect.Type -func (e *UnsupportedTypeError) Error() string { - return "validator: unsupported type: " + e.Type.String() -} - -func (sv stringValues) Len() int { return len(sv) } -func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) } -func (sv stringValues) get(i int) string { return sv[i].String() } diff --git a/vendor/github.com/asaskevich/govalidator/wercker.yml b/vendor/github.com/asaskevich/govalidator/wercker.yml deleted file mode 100644 index bc5f7b0..0000000 --- a/vendor/github.com/asaskevich/govalidator/wercker.yml +++ /dev/null @@ -1,15 +0,0 @@ -box: golang -build: - steps: - - setup-go-workspace - - - script: - name: go get - code: | - go version - go get -t ./... - - - script: - name: go test - code: | - go test -race -v ./... diff --git a/vendor/github.com/go-openapi/analysis/.codecov.yml b/vendor/github.com/go-openapi/analysis/.codecov.yml deleted file mode 100644 index 841c428..0000000 --- a/vendor/github.com/go-openapi/analysis/.codecov.yml +++ /dev/null @@ -1,5 +0,0 @@ -coverage: - status: - patch: - default: - target: 80% diff --git a/vendor/github.com/go-openapi/analysis/.gitignore b/vendor/github.com/go-openapi/analysis/.gitignore deleted file mode 100644 index 87c3bd3..0000000 --- a/vendor/github.com/go-openapi/analysis/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -secrets.yml -coverage.out -coverage.txt -*.cov -.idea diff --git a/vendor/github.com/go-openapi/analysis/.golangci.yml b/vendor/github.com/go-openapi/analysis/.golangci.yml deleted file mode 100644 index e6aafe7..0000000 --- a/vendor/github.com/go-openapi/analysis/.golangci.yml +++ /dev/null @@ -1,49 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 40 - maligned: - suggest-new: true - dupl: - threshold: 150 - goconst: - min-len: 2 - min-occurrences: 4 - -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoglobals - - gochecknoinits - # scopelint is useful, but also reports false positives - # that unfortunately can't be disabled. So we disable the - # linter rather than changing code that works. - # see: https://github.com/kyoh86/scopelint/issues/4 - - scopelint - - godox - - gocognit - - whitespace - - wsl - - funlen - - testpackage - - wrapcheck - - nlreturn - - gomnd - - goerr113 - - exhaustivestruct - - errorlint - - nestif - - gofumpt - - godot - - gci - - dogsled - - paralleltest - - tparallel - - thelper - - ifshort - - forbidigo diff --git a/vendor/github.com/go-openapi/analysis/.travis.yml b/vendor/github.com/go-openapi/analysis/.travis.yml deleted file mode 100644 index 55bdbec..0000000 --- a/vendor/github.com/go-openapi/analysis/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -arch: - - amd64 - - ppc64le -install: -- go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4= -script: -- gotestsum -f short-verbose -- -timeout=20m -coverprofile=coverage.txt -covermode=atomic -args -enable-long ./... -- gotestsum -f short-verbose -- -race -timeout=20m ./... diff --git a/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/analysis/LICENSE b/vendor/github.com/go-openapi/analysis/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/analysis/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/analysis/README.md b/vendor/github.com/go-openapi/analysis/README.md deleted file mode 100644 index 4b97f03..0000000 --- a/vendor/github.com/go-openapi/analysis/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# OpenAPI initiative analysis - -[![Build Status](https://travis-ci.org/go-openapi/analysis.svg?branch=master)](https://travis-ci.org/go-openapi/analysis) -[![Build status](https://ci.appveyor.com/api/projects/status/x377t5o9ennm847o/branch/master?svg=true)](https://ci.appveyor.com/project/casualjim/go-openapi/analysis/branch/master) -[![codecov](https://codecov.io/gh/go-openapi/analysis/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/analysis) -[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/analysis/master/LICENSE) -[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/analysis.svg)](https://pkg.go.dev/github.com/go-openapi/analysis) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/analysis.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/analysis)](https://goreportcard.com/report/github.com/go-openapi/analysis) - - -A foundational library to analyze an OAI specification document for easier reasoning about the content. - -## What's inside? - -* A analyzer providing methods to walk the functional content of a specification -* A spec flattener producing a self-contained document bundle, while preserving `$ref`s -* A spec merger ("mixin") to merge several spec documents into a primary spec -* A spec "fixer" ensuring that response descriptions are non empty - -[Documentation](https://godoc.org/github.com/go-openapi/analysis) - -## FAQ - -* Does this library support OpenAPI 3? - -> No. -> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0). -> There is no plan to make it evolve toward supporting OpenAPI 3.x. -> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story. -> diff --git a/vendor/github.com/go-openapi/analysis/analyzer.go b/vendor/github.com/go-openapi/analysis/analyzer.go deleted file mode 100644 index b34f15a..0000000 --- a/vendor/github.com/go-openapi/analysis/analyzer.go +++ /dev/null @@ -1,978 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import ( - "fmt" - slashpath "path" - "strconv" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -type referenceAnalysis struct { - schemas map[string]spec.Ref - responses map[string]spec.Ref - parameters map[string]spec.Ref - items map[string]spec.Ref - headerItems map[string]spec.Ref - parameterItems map[string]spec.Ref - allRefs map[string]spec.Ref - pathItems map[string]spec.Ref -} - -func (r *referenceAnalysis) addRef(key string, ref spec.Ref) { - r.allRefs["#"+key] = ref -} - -func (r *referenceAnalysis) addItemsRef(key string, items *spec.Items, location string) { - r.items["#"+key] = items.Ref - r.addRef(key, items.Ref) - if location == "header" { - // NOTE: in swagger 2.0, headers and parameters (but not body param schemas) are simple schemas - // and $ref are not supported here. However it is possible to analyze this. - r.headerItems["#"+key] = items.Ref - } else { - r.parameterItems["#"+key] = items.Ref - } -} - -func (r *referenceAnalysis) addSchemaRef(key string, ref SchemaRef) { - r.schemas["#"+key] = ref.Schema.Ref - r.addRef(key, ref.Schema.Ref) -} - -func (r *referenceAnalysis) addResponseRef(key string, resp *spec.Response) { - r.responses["#"+key] = resp.Ref - r.addRef(key, resp.Ref) -} - -func (r *referenceAnalysis) addParamRef(key string, param *spec.Parameter) { - r.parameters["#"+key] = param.Ref - r.addRef(key, param.Ref) -} - -func (r *referenceAnalysis) addPathItemRef(key string, pathItem *spec.PathItem) { - r.pathItems["#"+key] = pathItem.Ref - r.addRef(key, pathItem.Ref) -} - -type patternAnalysis struct { - parameters map[string]string - headers map[string]string - items map[string]string - schemas map[string]string - allPatterns map[string]string -} - -func (p *patternAnalysis) addPattern(key, pattern string) { - p.allPatterns["#"+key] = pattern -} - -func (p *patternAnalysis) addParameterPattern(key, pattern string) { - p.parameters["#"+key] = pattern - p.addPattern(key, pattern) -} - -func (p *patternAnalysis) addHeaderPattern(key, pattern string) { - p.headers["#"+key] = pattern - p.addPattern(key, pattern) -} - -func (p *patternAnalysis) addItemsPattern(key, pattern string) { - p.items["#"+key] = pattern - p.addPattern(key, pattern) -} - -func (p *patternAnalysis) addSchemaPattern(key, pattern string) { - p.schemas["#"+key] = pattern - p.addPattern(key, pattern) -} - -type enumAnalysis struct { - parameters map[string][]interface{} - headers map[string][]interface{} - items map[string][]interface{} - schemas map[string][]interface{} - allEnums map[string][]interface{} -} - -func (p *enumAnalysis) addEnum(key string, enum []interface{}) { - p.allEnums["#"+key] = enum -} - -func (p *enumAnalysis) addParameterEnum(key string, enum []interface{}) { - p.parameters["#"+key] = enum - p.addEnum(key, enum) -} - -func (p *enumAnalysis) addHeaderEnum(key string, enum []interface{}) { - p.headers["#"+key] = enum - p.addEnum(key, enum) -} - -func (p *enumAnalysis) addItemsEnum(key string, enum []interface{}) { - p.items["#"+key] = enum - p.addEnum(key, enum) -} - -func (p *enumAnalysis) addSchemaEnum(key string, enum []interface{}) { - p.schemas["#"+key] = enum - p.addEnum(key, enum) -} - -// New takes a swagger spec object and returns an analyzed spec document. -// The analyzed document contains a number of indices that make it easier to -// reason about semantics of a swagger specification for use in code generation -// or validation etc. -func New(doc *spec.Swagger) *Spec { - a := &Spec{ - spec: doc, - references: referenceAnalysis{}, - patterns: patternAnalysis{}, - enums: enumAnalysis{}, - } - a.reset() - a.initialize() - return a -} - -// Spec is an analyzed specification object. It takes a swagger spec object and turns it into a registry -// with a bunch of utility methods to act on the information in the spec. -type Spec struct { - spec *spec.Swagger - consumes map[string]struct{} - produces map[string]struct{} - authSchemes map[string]struct{} - operations map[string]map[string]*spec.Operation - references referenceAnalysis - patterns patternAnalysis - enums enumAnalysis - allSchemas map[string]SchemaRef - allOfs map[string]SchemaRef -} - -func (s *Spec) reset() { - s.consumes = make(map[string]struct{}, 150) - s.produces = make(map[string]struct{}, 150) - s.authSchemes = make(map[string]struct{}, 150) - s.operations = make(map[string]map[string]*spec.Operation, 150) - s.allSchemas = make(map[string]SchemaRef, 150) - s.allOfs = make(map[string]SchemaRef, 150) - s.references.schemas = make(map[string]spec.Ref, 150) - s.references.pathItems = make(map[string]spec.Ref, 150) - s.references.responses = make(map[string]spec.Ref, 150) - s.references.parameters = make(map[string]spec.Ref, 150) - s.references.items = make(map[string]spec.Ref, 150) - s.references.headerItems = make(map[string]spec.Ref, 150) - s.references.parameterItems = make(map[string]spec.Ref, 150) - s.references.allRefs = make(map[string]spec.Ref, 150) - s.patterns.parameters = make(map[string]string, 150) - s.patterns.headers = make(map[string]string, 150) - s.patterns.items = make(map[string]string, 150) - s.patterns.schemas = make(map[string]string, 150) - s.patterns.allPatterns = make(map[string]string, 150) - s.enums.parameters = make(map[string][]interface{}, 150) - s.enums.headers = make(map[string][]interface{}, 150) - s.enums.items = make(map[string][]interface{}, 150) - s.enums.schemas = make(map[string][]interface{}, 150) - s.enums.allEnums = make(map[string][]interface{}, 150) -} - -func (s *Spec) reload() { - s.reset() - s.initialize() -} - -func (s *Spec) initialize() { - for _, c := range s.spec.Consumes { - s.consumes[c] = struct{}{} - } - for _, c := range s.spec.Produces { - s.produces[c] = struct{}{} - } - for _, ss := range s.spec.Security { - for k := range ss { - s.authSchemes[k] = struct{}{} - } - } - for path, pathItem := range s.AllPaths() { - s.analyzeOperations(path, &pathItem) //#nosec - } - - for name, parameter := range s.spec.Parameters { - refPref := slashpath.Join("/parameters", jsonpointer.Escape(name)) - if parameter.Items != nil { - s.analyzeItems("items", parameter.Items, refPref, "parameter") - } - if parameter.In == "body" && parameter.Schema != nil { - s.analyzeSchema("schema", parameter.Schema, refPref) - } - if parameter.Pattern != "" { - s.patterns.addParameterPattern(refPref, parameter.Pattern) - } - if len(parameter.Enum) > 0 { - s.enums.addParameterEnum(refPref, parameter.Enum) - } - } - - for name, response := range s.spec.Responses { - refPref := slashpath.Join("/responses", jsonpointer.Escape(name)) - for k, v := range response.Headers { - hRefPref := slashpath.Join(refPref, "headers", k) - if v.Items != nil { - s.analyzeItems("items", v.Items, hRefPref, "header") - } - if v.Pattern != "" { - s.patterns.addHeaderPattern(hRefPref, v.Pattern) - } - if len(v.Enum) > 0 { - s.enums.addHeaderEnum(hRefPref, v.Enum) - } - } - if response.Schema != nil { - s.analyzeSchema("schema", response.Schema, refPref) - } - } - - for name := range s.spec.Definitions { - schema := s.spec.Definitions[name] - s.analyzeSchema(name, &schema, "/definitions") - } - // TODO: after analyzing all things and flattening schemas etc - // resolve all the collected references to their final representations - // best put in a separate method because this could get expensive -} - -func (s *Spec) analyzeOperations(path string, pi *spec.PathItem) { - // TODO: resolve refs here? - // Currently, operations declared via pathItem $ref are known only after expansion - op := pi - if pi.Ref.String() != "" { - key := slashpath.Join("/paths", jsonpointer.Escape(path)) - s.references.addPathItemRef(key, pi) - } - s.analyzeOperation("GET", path, op.Get) - s.analyzeOperation("PUT", path, op.Put) - s.analyzeOperation("POST", path, op.Post) - s.analyzeOperation("PATCH", path, op.Patch) - s.analyzeOperation("DELETE", path, op.Delete) - s.analyzeOperation("HEAD", path, op.Head) - s.analyzeOperation("OPTIONS", path, op.Options) - for i, param := range op.Parameters { - refPref := slashpath.Join("/paths", jsonpointer.Escape(path), "parameters", strconv.Itoa(i)) - if param.Ref.String() != "" { - s.references.addParamRef(refPref, ¶m) //#nosec - } - if param.Pattern != "" { - s.patterns.addParameterPattern(refPref, param.Pattern) - } - if len(param.Enum) > 0 { - s.enums.addParameterEnum(refPref, param.Enum) - } - if param.Items != nil { - s.analyzeItems("items", param.Items, refPref, "parameter") - } - if param.Schema != nil { - s.analyzeSchema("schema", param.Schema, refPref) - } - } -} - -func (s *Spec) analyzeItems(name string, items *spec.Items, prefix, location string) { - if items == nil { - return - } - refPref := slashpath.Join(prefix, name) - s.analyzeItems(name, items.Items, refPref, location) - if items.Ref.String() != "" { - s.references.addItemsRef(refPref, items, location) - } - if items.Pattern != "" { - s.patterns.addItemsPattern(refPref, items.Pattern) - } - if len(items.Enum) > 0 { - s.enums.addItemsEnum(refPref, items.Enum) - } -} - -func (s *Spec) analyzeOperation(method, path string, op *spec.Operation) { - if op == nil { - return - } - - for _, c := range op.Consumes { - s.consumes[c] = struct{}{} - } - for _, c := range op.Produces { - s.produces[c] = struct{}{} - } - for _, ss := range op.Security { - for k := range ss { - s.authSchemes[k] = struct{}{} - } - } - if _, ok := s.operations[method]; !ok { - s.operations[method] = make(map[string]*spec.Operation) - } - s.operations[method][path] = op - prefix := slashpath.Join("/paths", jsonpointer.Escape(path), strings.ToLower(method)) - for i, param := range op.Parameters { - refPref := slashpath.Join(prefix, "parameters", strconv.Itoa(i)) - if param.Ref.String() != "" { - s.references.addParamRef(refPref, ¶m) //#nosec - } - if param.Pattern != "" { - s.patterns.addParameterPattern(refPref, param.Pattern) - } - if len(param.Enum) > 0 { - s.enums.addParameterEnum(refPref, param.Enum) - } - s.analyzeItems("items", param.Items, refPref, "parameter") - if param.In == "body" && param.Schema != nil { - s.analyzeSchema("schema", param.Schema, refPref) - } - } - if op.Responses != nil { - if op.Responses.Default != nil { - refPref := slashpath.Join(prefix, "responses", "default") - if op.Responses.Default.Ref.String() != "" { - s.references.addResponseRef(refPref, op.Responses.Default) - } - for k, v := range op.Responses.Default.Headers { - hRefPref := slashpath.Join(refPref, "headers", k) - s.analyzeItems("items", v.Items, hRefPref, "header") - if v.Pattern != "" { - s.patterns.addHeaderPattern(hRefPref, v.Pattern) - } - } - if op.Responses.Default.Schema != nil { - s.analyzeSchema("schema", op.Responses.Default.Schema, refPref) - } - } - for k, res := range op.Responses.StatusCodeResponses { - refPref := slashpath.Join(prefix, "responses", strconv.Itoa(k)) - if res.Ref.String() != "" { - s.references.addResponseRef(refPref, &res) //#nosec - } - for k, v := range res.Headers { - hRefPref := slashpath.Join(refPref, "headers", k) - s.analyzeItems("items", v.Items, hRefPref, "header") - if v.Pattern != "" { - s.patterns.addHeaderPattern(hRefPref, v.Pattern) - } - if len(v.Enum) > 0 { - s.enums.addHeaderEnum(hRefPref, v.Enum) - } - } - if res.Schema != nil { - s.analyzeSchema("schema", res.Schema, refPref) - } - } - } -} - -func (s *Spec) analyzeSchema(name string, schema *spec.Schema, prefix string) { - refURI := slashpath.Join(prefix, jsonpointer.Escape(name)) - schRef := SchemaRef{ - Name: name, - Schema: schema, - Ref: spec.MustCreateRef("#" + refURI), - TopLevel: prefix == "/definitions", - } - - s.allSchemas["#"+refURI] = schRef - - if schema.Ref.String() != "" { - s.references.addSchemaRef(refURI, schRef) - } - if schema.Pattern != "" { - s.patterns.addSchemaPattern(refURI, schema.Pattern) - } - if len(schema.Enum) > 0 { - s.enums.addSchemaEnum(refURI, schema.Enum) - } - - for k, v := range schema.Definitions { - v := v - s.analyzeSchema(k, &v, slashpath.Join(refURI, "definitions")) - } - for k, v := range schema.Properties { - v := v - s.analyzeSchema(k, &v, slashpath.Join(refURI, "properties")) - } - for k, v := range schema.PatternProperties { - v := v - // NOTE: swagger 2.0 does not support PatternProperties. - // However it is possible to analyze this in a schema - s.analyzeSchema(k, &v, slashpath.Join(refURI, "patternProperties")) - } - for i := range schema.AllOf { - v := &schema.AllOf[i] - s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "allOf")) - } - if len(schema.AllOf) > 0 { - s.allOfs["#"+refURI] = schRef - } - for i := range schema.AnyOf { - v := &schema.AnyOf[i] - // NOTE: swagger 2.0 does not support anyOf constructs. - // However it is possible to analyze this in a schema - s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "anyOf")) - } - for i := range schema.OneOf { - v := &schema.OneOf[i] - // NOTE: swagger 2.0 does not support oneOf constructs. - // However it is possible to analyze this in a schema - s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "oneOf")) - } - if schema.Not != nil { - // NOTE: swagger 2.0 does not support "not" constructs. - // However it is possible to analyze this in a schema - s.analyzeSchema("not", schema.Not, refURI) - } - if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { - s.analyzeSchema("additionalProperties", schema.AdditionalProperties.Schema, refURI) - } - if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { - // NOTE: swagger 2.0 does not support AdditionalItems. - // However it is possible to analyze this in a schema - s.analyzeSchema("additionalItems", schema.AdditionalItems.Schema, refURI) - } - if schema.Items != nil { - if schema.Items.Schema != nil { - s.analyzeSchema("items", schema.Items.Schema, refURI) - } - for i := range schema.Items.Schemas { - sch := &schema.Items.Schemas[i] - s.analyzeSchema(strconv.Itoa(i), sch, slashpath.Join(refURI, "items")) - } - } -} - -// SecurityRequirement is a representation of a security requirement for an operation -type SecurityRequirement struct { - Name string - Scopes []string -} - -// SecurityRequirementsFor gets the security requirements for the operation -func (s *Spec) SecurityRequirementsFor(operation *spec.Operation) [][]SecurityRequirement { - if s.spec.Security == nil && operation.Security == nil { - return nil - } - - schemes := s.spec.Security - if operation.Security != nil { - schemes = operation.Security - } - - result := [][]SecurityRequirement{} - for _, scheme := range schemes { - if len(scheme) == 0 { - // append a zero object for anonymous - result = append(result, []SecurityRequirement{{}}) - continue - } - var reqs []SecurityRequirement - for k, v := range scheme { - if v == nil { - v = []string{} - } - reqs = append(reqs, SecurityRequirement{Name: k, Scopes: v}) - } - result = append(result, reqs) - } - return result -} - -// SecurityDefinitionsForRequirements gets the matching security definitions for a set of requirements -func (s *Spec) SecurityDefinitionsForRequirements(requirements []SecurityRequirement) map[string]spec.SecurityScheme { - result := make(map[string]spec.SecurityScheme) - - for _, v := range requirements { - if definition, ok := s.spec.SecurityDefinitions[v.Name]; ok { - if definition != nil { - result[v.Name] = *definition - } - } - } - return result -} - -// SecurityDefinitionsFor gets the matching security definitions for a set of requirements -func (s *Spec) SecurityDefinitionsFor(operation *spec.Operation) map[string]spec.SecurityScheme { - requirements := s.SecurityRequirementsFor(operation) - if len(requirements) == 0 { - return nil - } - - result := make(map[string]spec.SecurityScheme) - for _, reqs := range requirements { - for _, v := range reqs { - if v.Name == "" { - // optional requirement - continue - } - if _, ok := result[v.Name]; ok { - // duplicate requirement - continue - } - if definition, ok := s.spec.SecurityDefinitions[v.Name]; ok { - if definition != nil { - result[v.Name] = *definition - } - } - } - } - return result -} - -// ConsumesFor gets the mediatypes for the operation -func (s *Spec) ConsumesFor(operation *spec.Operation) []string { - - if len(operation.Consumes) == 0 { - cons := make(map[string]struct{}, len(s.spec.Consumes)) - for _, k := range s.spec.Consumes { - cons[k] = struct{}{} - } - return s.structMapKeys(cons) - } - - cons := make(map[string]struct{}, len(operation.Consumes)) - for _, c := range operation.Consumes { - cons[c] = struct{}{} - } - return s.structMapKeys(cons) -} - -// ProducesFor gets the mediatypes for the operation -func (s *Spec) ProducesFor(operation *spec.Operation) []string { - if len(operation.Produces) == 0 { - prod := make(map[string]struct{}, len(s.spec.Produces)) - for _, k := range s.spec.Produces { - prod[k] = struct{}{} - } - return s.structMapKeys(prod) - } - - prod := make(map[string]struct{}, len(operation.Produces)) - for _, c := range operation.Produces { - prod[c] = struct{}{} - } - return s.structMapKeys(prod) -} - -func mapKeyFromParam(param *spec.Parameter) string { - return fmt.Sprintf("%s#%s", param.In, fieldNameFromParam(param)) -} - -func fieldNameFromParam(param *spec.Parameter) string { - // TODO: this should be x-go-name - if nm, ok := param.Extensions.GetString("go-name"); ok { - return nm - } - return swag.ToGoName(param.Name) -} - -// ErrorOnParamFunc is a callback function to be invoked -// whenever an error is encountered while resolving references -// on parameters. -// -// This function takes as input the spec.Parameter which triggered the -// error and the error itself. -// -// If the callback function returns false, the calling function should bail. -// -// If it returns true, the calling function should continue evaluating parameters. -// A nil ErrorOnParamFunc must be evaluated as equivalent to panic(). -type ErrorOnParamFunc func(spec.Parameter, error) bool - -func (s *Spec) paramsAsMap(parameters []spec.Parameter, res map[string]spec.Parameter, callmeOnError ErrorOnParamFunc) { - for _, param := range parameters { - pr := param - if pr.Ref.String() != "" { - obj, _, err := pr.Ref.GetPointer().Get(s.spec) - if err != nil { - if callmeOnError != nil { - if callmeOnError(param, fmt.Errorf("invalid reference: %q", pr.Ref.String())) { - continue - } - break - } else { - panic(fmt.Sprintf("invalid reference: %q", pr.Ref.String())) - } - } - if objAsParam, ok := obj.(spec.Parameter); ok { - pr = objAsParam - } else { - if callmeOnError != nil { - if callmeOnError(param, fmt.Errorf("resolved reference is not a parameter: %q", pr.Ref.String())) { - continue - } - break - } else { - panic(fmt.Sprintf("resolved reference is not a parameter: %q", pr.Ref.String())) - } - } - } - res[mapKeyFromParam(&pr)] = pr - } -} - -// ParametersFor the specified operation id. -// -// Assumes parameters properly resolve references if any and that -// such references actually resolve to a parameter object. -// Otherwise, panics. -func (s *Spec) ParametersFor(operationID string) []spec.Parameter { - return s.SafeParametersFor(operationID, nil) -} - -// SafeParametersFor the specified operation id. -// -// Does not assume parameters properly resolve references or that -// such references actually resolve to a parameter object. -// -// Upon error, invoke a ErrorOnParamFunc callback with the erroneous -// parameters. If the callback is set to nil, panics upon errors. -func (s *Spec) SafeParametersFor(operationID string, callmeOnError ErrorOnParamFunc) []spec.Parameter { - gatherParams := func(pi *spec.PathItem, op *spec.Operation) []spec.Parameter { - bag := make(map[string]spec.Parameter) - s.paramsAsMap(pi.Parameters, bag, callmeOnError) - s.paramsAsMap(op.Parameters, bag, callmeOnError) - - var res []spec.Parameter - for _, v := range bag { - res = append(res, v) - } - return res - } - for _, pi := range s.spec.Paths.Paths { - if pi.Get != nil && pi.Get.ID == operationID { - return gatherParams(&pi, pi.Get) //#nosec - } - if pi.Head != nil && pi.Head.ID == operationID { - return gatherParams(&pi, pi.Head) //#nosec - } - if pi.Options != nil && pi.Options.ID == operationID { - return gatherParams(&pi, pi.Options) //#nosec - } - if pi.Post != nil && pi.Post.ID == operationID { - return gatherParams(&pi, pi.Post) //#nosec - } - if pi.Patch != nil && pi.Patch.ID == operationID { - return gatherParams(&pi, pi.Patch) //#nosec - } - if pi.Put != nil && pi.Put.ID == operationID { - return gatherParams(&pi, pi.Put) //#nosec - } - if pi.Delete != nil && pi.Delete.ID == operationID { - return gatherParams(&pi, pi.Delete) //#nosec - } - } - return nil -} - -// ParamsFor the specified method and path. Aggregates them with the defaults etc, so it's all the params that -// apply for the method and path. -// -// Assumes parameters properly resolve references if any and that -// such references actually resolve to a parameter object. -// Otherwise, panics. -func (s *Spec) ParamsFor(method, path string) map[string]spec.Parameter { - return s.SafeParamsFor(method, path, nil) -} - -// SafeParamsFor the specified method and path. Aggregates them with the defaults etc, so it's all the params that -// apply for the method and path. -// -// Does not assume parameters properly resolve references or that -// such references actually resolve to a parameter object. -// -// Upon error, invoke a ErrorOnParamFunc callback with the erroneous -// parameters. If the callback is set to nil, panics upon errors. -func (s *Spec) SafeParamsFor(method, path string, callmeOnError ErrorOnParamFunc) map[string]spec.Parameter { - res := make(map[string]spec.Parameter) - if pi, ok := s.spec.Paths.Paths[path]; ok { - s.paramsAsMap(pi.Parameters, res, callmeOnError) - s.paramsAsMap(s.operations[strings.ToUpper(method)][path].Parameters, res, callmeOnError) - } - return res -} - -// OperationForName gets the operation for the given id -func (s *Spec) OperationForName(operationID string) (string, string, *spec.Operation, bool) { - for method, pathItem := range s.operations { - for path, op := range pathItem { - if operationID == op.ID { - return method, path, op, true - } - } - } - return "", "", nil, false -} - -// OperationFor the given method and path -func (s *Spec) OperationFor(method, path string) (*spec.Operation, bool) { - if mp, ok := s.operations[strings.ToUpper(method)]; ok { - op, fn := mp[path] - return op, fn - } - return nil, false -} - -// Operations gathers all the operations specified in the spec document -func (s *Spec) Operations() map[string]map[string]*spec.Operation { - return s.operations -} - -func (s *Spec) structMapKeys(mp map[string]struct{}) []string { - if len(mp) == 0 { - return nil - } - - result := make([]string, 0, len(mp)) - for k := range mp { - result = append(result, k) - } - return result -} - -// AllPaths returns all the paths in the swagger spec -func (s *Spec) AllPaths() map[string]spec.PathItem { - if s.spec == nil || s.spec.Paths == nil { - return nil - } - return s.spec.Paths.Paths -} - -// OperationIDs gets all the operation ids based on method an dpath -func (s *Spec) OperationIDs() []string { - if len(s.operations) == 0 { - return nil - } - result := make([]string, 0, len(s.operations)) - for method, v := range s.operations { - for p, o := range v { - if o.ID != "" { - result = append(result, o.ID) - } else { - result = append(result, fmt.Sprintf("%s %s", strings.ToUpper(method), p)) - } - } - } - return result -} - -// OperationMethodPaths gets all the operation ids based on method an dpath -func (s *Spec) OperationMethodPaths() []string { - if len(s.operations) == 0 { - return nil - } - result := make([]string, 0, len(s.operations)) - for method, v := range s.operations { - for p := range v { - result = append(result, fmt.Sprintf("%s %s", strings.ToUpper(method), p)) - } - } - return result -} - -// RequiredConsumes gets all the distinct consumes that are specified in the specification document -func (s *Spec) RequiredConsumes() []string { - return s.structMapKeys(s.consumes) -} - -// RequiredProduces gets all the distinct produces that are specified in the specification document -func (s *Spec) RequiredProduces() []string { - return s.structMapKeys(s.produces) -} - -// RequiredSecuritySchemes gets all the distinct security schemes that are specified in the swagger spec -func (s *Spec) RequiredSecuritySchemes() []string { - return s.structMapKeys(s.authSchemes) -} - -// SchemaRef is a reference to a schema -type SchemaRef struct { - Name string - Ref spec.Ref - Schema *spec.Schema - TopLevel bool -} - -// SchemasWithAllOf returns schema references to all schemas that are defined -// with an allOf key -func (s *Spec) SchemasWithAllOf() (result []SchemaRef) { - for _, v := range s.allOfs { - result = append(result, v) - } - return -} - -// AllDefinitions returns schema references for all the definitions that were discovered -func (s *Spec) AllDefinitions() (result []SchemaRef) { - for _, v := range s.allSchemas { - result = append(result, v) - } - return -} - -// AllDefinitionReferences returns json refs for all the discovered schemas -func (s *Spec) AllDefinitionReferences() (result []string) { - for _, v := range s.references.schemas { - result = append(result, v.String()) - } - return -} - -// AllParameterReferences returns json refs for all the discovered parameters -func (s *Spec) AllParameterReferences() (result []string) { - for _, v := range s.references.parameters { - result = append(result, v.String()) - } - return -} - -// AllResponseReferences returns json refs for all the discovered responses -func (s *Spec) AllResponseReferences() (result []string) { - for _, v := range s.references.responses { - result = append(result, v.String()) - } - return -} - -// AllPathItemReferences returns the references for all the items -func (s *Spec) AllPathItemReferences() (result []string) { - for _, v := range s.references.pathItems { - result = append(result, v.String()) - } - return -} - -// AllItemsReferences returns the references for all the items in simple schemas (parameters or headers). -// -// NOTE: since Swagger 2.0 forbids $ref in simple params, this should always yield an empty slice for a valid -// Swagger 2.0 spec. -func (s *Spec) AllItemsReferences() (result []string) { - for _, v := range s.references.items { - result = append(result, v.String()) - } - return -} - -// AllReferences returns all the references found in the document, with possible duplicates -func (s *Spec) AllReferences() (result []string) { - for _, v := range s.references.allRefs { - result = append(result, v.String()) - } - return -} - -// AllRefs returns all the unique references found in the document -func (s *Spec) AllRefs() (result []spec.Ref) { - set := make(map[string]struct{}) - for _, v := range s.references.allRefs { - a := v.String() - if a == "" { - continue - } - if _, ok := set[a]; !ok { - set[a] = struct{}{} - result = append(result, v) - } - } - return -} - -func cloneStringMap(source map[string]string) map[string]string { - res := make(map[string]string, len(source)) - for k, v := range source { - res[k] = v - } - return res -} - -func cloneEnumMap(source map[string][]interface{}) map[string][]interface{} { - res := make(map[string][]interface{}, len(source)) - for k, v := range source { - res[k] = v - } - return res -} - -// ParameterPatterns returns all the patterns found in parameters -// the map is cloned to avoid accidental changes -func (s *Spec) ParameterPatterns() map[string]string { - return cloneStringMap(s.patterns.parameters) -} - -// HeaderPatterns returns all the patterns found in response headers -// the map is cloned to avoid accidental changes -func (s *Spec) HeaderPatterns() map[string]string { - return cloneStringMap(s.patterns.headers) -} - -// ItemsPatterns returns all the patterns found in simple array items -// the map is cloned to avoid accidental changes -func (s *Spec) ItemsPatterns() map[string]string { - return cloneStringMap(s.patterns.items) -} - -// SchemaPatterns returns all the patterns found in schemas -// the map is cloned to avoid accidental changes -func (s *Spec) SchemaPatterns() map[string]string { - return cloneStringMap(s.patterns.schemas) -} - -// AllPatterns returns all the patterns found in the spec -// the map is cloned to avoid accidental changes -func (s *Spec) AllPatterns() map[string]string { - return cloneStringMap(s.patterns.allPatterns) -} - -// ParameterEnums returns all the enums found in parameters -// the map is cloned to avoid accidental changes -func (s *Spec) ParameterEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.parameters) -} - -// HeaderEnums returns all the enums found in response headers -// the map is cloned to avoid accidental changes -func (s *Spec) HeaderEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.headers) -} - -// ItemsEnums returns all the enums found in simple array items -// the map is cloned to avoid accidental changes -func (s *Spec) ItemsEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.items) -} - -// SchemaEnums returns all the enums found in schemas -// the map is cloned to avoid accidental changes -func (s *Spec) SchemaEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.schemas) -} - -// AllEnums returns all the enums found in the spec -// the map is cloned to avoid accidental changes -func (s *Spec) AllEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.allEnums) -} diff --git a/vendor/github.com/go-openapi/analysis/appveyor.yml b/vendor/github.com/go-openapi/analysis/appveyor.yml deleted file mode 100644 index a3574f8..0000000 --- a/vendor/github.com/go-openapi/analysis/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: "0.1.{build}" - -clone_folder: C:\go-openapi\analysis -shallow_clone: true # for startup speed -pull_requests: - do_not_increment_build_number: true - -#skip_tags: true -#skip_branch_with_pr: true - -# appveyor.yml -build: off - -environment: - GOPATH: c:\gopath - -stack: go 1.15 - -test_script: - - go test -v -timeout 20m ./... - -deploy: off - -notifications: - - provider: Slack - incoming_webhook: https://hooks.slack.com/services/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 - auth_token: - secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4= - channel: bots - on_build_success: false - on_build_failure: true - on_build_status_changed: true diff --git a/vendor/github.com/go-openapi/analysis/debug.go b/vendor/github.com/go-openapi/analysis/debug.go deleted file mode 100644 index 84cc4e5..0000000 --- a/vendor/github.com/go-openapi/analysis/debug.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import ( - "fmt" - "log" - "os" - "path/filepath" - "runtime" -) - -var ( - // Debug is true when the SWAGGER_DEBUG env var is not empty. - // It enables a more verbose logging of the spec analyzer. - Debug = os.Getenv("SWAGGER_DEBUG") != "" - // analysisLogger is a debug logger for this package - analysisLogger *log.Logger -) - -func init() { - debugOptions() -} - -func debugOptions() { - analysisLogger = log.New(os.Stdout, "analysis:", log.LstdFlags) -} - -func debugLog(msg string, args ...interface{}) { - // A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog() - if Debug { - _, file1, pos1, _ := runtime.Caller(1) - analysisLogger.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...)) - } -} diff --git a/vendor/github.com/go-openapi/analysis/doc.go b/vendor/github.com/go-openapi/analysis/doc.go deleted file mode 100644 index d5294c0..0000000 --- a/vendor/github.com/go-openapi/analysis/doc.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* -Package analysis provides methods to work with a Swagger specification document from -package go-openapi/spec. - -Analyzing a specification - -An analysed specification object (type Spec) provides methods to work with swagger definition. - -Flattening or expanding a specification - -Flattening a specification bundles all remote $ref in the main spec document. -Depending on flattening options, additional preprocessing may take place: - - full flattening: replacing all inline complex constructs by a named entry in #/definitions - - expand: replace all $ref's in the document by their expanded content - -Merging several specifications - -Mixin several specifications merges all Swagger constructs, and warns about found conflicts. - -Fixing a specification - -Unmarshalling a specification with golang json unmarshalling may lead to -some unwanted result on present but empty fields. - -Analyzing a Swagger schema - -Swagger schemas are analyzed to determine their complexity and qualify their content. -*/ -package analysis diff --git a/vendor/github.com/go-openapi/analysis/fixer.go b/vendor/github.com/go-openapi/analysis/fixer.go deleted file mode 100644 index 286922b..0000000 --- a/vendor/github.com/go-openapi/analysis/fixer.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import "github.com/go-openapi/spec" - -// FixEmptyResponseDescriptions replaces empty ("") response -// descriptions in the input with "(empty)" to ensure that the -// resulting Swagger is stays valid. The problem appears to arise -// from reading in valid specs that have a explicit response -// description of "" (valid, response.description is required), but -// due to zero values being omitted upon re-serializing (omitempty) we -// lose them unless we stick some chars in there. -func FixEmptyResponseDescriptions(s *spec.Swagger) { - if s.Paths != nil { - for _, v := range s.Paths.Paths { - if v.Get != nil { - FixEmptyDescs(v.Get.Responses) - } - if v.Put != nil { - FixEmptyDescs(v.Put.Responses) - } - if v.Post != nil { - FixEmptyDescs(v.Post.Responses) - } - if v.Delete != nil { - FixEmptyDescs(v.Delete.Responses) - } - if v.Options != nil { - FixEmptyDescs(v.Options.Responses) - } - if v.Head != nil { - FixEmptyDescs(v.Head.Responses) - } - if v.Patch != nil { - FixEmptyDescs(v.Patch.Responses) - } - } - } - for k, v := range s.Responses { - FixEmptyDesc(&v) //#nosec - s.Responses[k] = v - } -} - -// FixEmptyDescs adds "(empty)" as the description for any Response in -// the given Responses object that doesn't already have one. -func FixEmptyDescs(rs *spec.Responses) { - FixEmptyDesc(rs.Default) - for k, v := range rs.StatusCodeResponses { - FixEmptyDesc(&v) //#nosec - rs.StatusCodeResponses[k] = v - } -} - -// FixEmptyDesc adds "(empty)" as the description to the given -// Response object if it doesn't already have one and isn't a -// ref. No-op on nil input. -func FixEmptyDesc(rs *spec.Response) { - if rs == nil || rs.Description != "" || rs.Ref.Ref.GetURL() != nil { - return - } - rs.Description = "(empty)" -} diff --git a/vendor/github.com/go-openapi/analysis/flatten.go b/vendor/github.com/go-openapi/analysis/flatten.go deleted file mode 100644 index 51245f1..0000000 --- a/vendor/github.com/go-openapi/analysis/flatten.go +++ /dev/null @@ -1,1773 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import ( - "fmt" - "log" - "net/http" - "net/url" - slashpath "path" - "path/filepath" - "sort" - "strings" - - "strconv" - - "github.com/go-openapi/analysis/internal" - "github.com/go-openapi/jsonpointer" - swspec "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -// FlattenOpts configuration for flattening a swagger specification. -// -// The BasePath parameter is used to locate remote relative $ref found in the specification. -// This path is a file: it points to the location of the root document and may be either a local -// file path or a URL. -// -// If none specified, relative references (e.g. "$ref": "folder/schema.yaml#/definitions/...") -// found in the spec are searched from the current working directory. -type FlattenOpts struct { - Spec *Spec // The analyzed spec to work with - flattenContext *context // Internal context to track flattening activity - - BasePath string // The location of the root document for this spec to resolve relative $ref - - // Flattening options - Expand bool // When true, skip flattening the spec and expand it instead (if Minimal is false) - Minimal bool // When true, do not decompose complex structures such as allOf - Verbose bool // enable some reporting on possible name conflicts detected - RemoveUnused bool // When true, remove unused parameters, responses and definitions after expansion/flattening - ContinueOnError bool // Continue when spec expansion issues are found - - /* Extra keys */ - _ struct{} // require keys -} - -// ExpandOpts creates a spec.ExpandOptions to configure expanding a specification document. -func (f *FlattenOpts) ExpandOpts(skipSchemas bool) *swspec.ExpandOptions { - return &swspec.ExpandOptions{RelativeBase: f.BasePath, SkipSchemas: skipSchemas} -} - -// Swagger gets the swagger specification for this flatten operation -func (f *FlattenOpts) Swagger() *swspec.Swagger { - return f.Spec.spec -} - -// newRef stores information about refs created during the flattening process -type newRef struct { - key string - newName string - path string - isOAIGen bool - resolved bool - schema *swspec.Schema - parents []string -} - -// context stores intermediary results from flatten -type context struct { - newRefs map[string]*newRef - warnings []string - resolved map[string]string -} - -func newContext() *context { - return &context{ - newRefs: make(map[string]*newRef, 150), - warnings: make([]string, 0), - resolved: make(map[string]string, 50), - } -} - -// Flatten an analyzed spec and produce a self-contained spec bundle. -// -// There is a minimal and a full flattening mode. -// -// -// Minimally flattening a spec means: -// - Expanding parameters, responses, path items, parameter items and header items (references to schemas are left -// unscathed) -// - Importing external (http, file) references so they become internal to the document -// - Moving every JSON pointer to a $ref to a named definition (i.e. the reworked spec does not contain pointers -// like "$ref": "#/definitions/myObject/allOfs/1") -// -// A minimally flattened spec thus guarantees the following properties: -// - all $refs point to a local definition (i.e. '#/definitions/...') -// - definitions are unique -// -// NOTE: arbitrary JSON pointers (other than $refs to top level definitions) are rewritten as definitions if they -// represent a complex schema or express commonality in the spec. -// Otherwise, they are simply expanded. -// Self-referencing JSON pointers cannot resolve to a type and trigger an error. -// -// -// Minimal flattening is necessary and sufficient for codegen rendering using go-swagger. -// -// Fully flattening a spec means: -// - Moving every complex inline schema to be a definition with an auto-generated name in a depth-first fashion. -// -// By complex, we mean every JSON object with some properties. -// Arrays, when they do not define a tuple, -// or empty objects with or without additionalProperties, are not considered complex and remain inline. -// -// NOTE: rewritten schemas get a vendor extension x-go-gen-location so we know from which part of the spec definitions -// have been created. -// -// Available flattening options: -// - Minimal: stops flattening after minimal $ref processing, leaving schema constructs untouched -// - Expand: expand all $ref's in the document (inoperant if Minimal set to true) -// - Verbose: croaks about name conflicts detected -// - RemoveUnused: removes unused parameters, responses and definitions after expansion/flattening -// -// NOTE: expansion removes all $ref save circular $ref, which remain in place -// -// TODO: additional options -// - ProgagateNameExtensions: ensure that created entries properly follow naming rules when their parent have set a -// x-go-name extension -// - LiftAllOfs: -// - limit the flattening of allOf members when simple objects -// - merge allOf with validation only -// - merge allOf with extensions only -// - ... -// -func Flatten(opts FlattenOpts) error { - debugLog("FlattenOpts: %#v", opts) - opts.flattenContext = newContext() - - // recursively expand responses, parameters, path items and items in simple schemas. - // This simplifies the spec and leaves $ref only into schema objects. - expandOpts := opts.ExpandOpts(!opts.Expand) - expandOpts.ContinueOnError = opts.ContinueOnError - if err := swspec.ExpandSpec(opts.Swagger(), expandOpts); err != nil { - return err - } - - opts.Spec.reload() // re-analyze - - // strip current file from $ref's, so we can recognize them as proper definitions - // In particular, this works around for issue go-openapi/spec#76: leading absolute file in $ref is stripped - if err := normalizeRef(&opts); err != nil { - return err - } - - if opts.RemoveUnused { - // optionally removes shared parameters and responses already expanded (now unused) - // default parameters (i.e. under paths) remain. - opts.Swagger().Parameters = nil - opts.Swagger().Responses = nil - } - - opts.Spec.reload() // re-analyze - - // at this point there are no references left but in schemas - - for imported := false; !imported; { - // iteratively import remote references until none left. - // This inlining deals with name conflicts by introducing auto-generated names ("OAIGen") - var err error - if imported, err = importExternalReferences(&opts); err != nil { - debugLog("error in importExternalReferences: %v", err) - return err - } - opts.Spec.reload() // re-analyze - } - - if !opts.Minimal && !opts.Expand { - // full flattening: rewrite inline schemas (schemas that aren't simple types or arrays or maps) - if err := nameInlinedSchemas(&opts); err != nil { - return err - } - - opts.Spec.reload() // re-analyze - } - - // rewrite JSON pointers other than $ref to named definitions - // and attempt to resolve conflicting names whenever possible. - if err := stripPointersAndOAIGen(&opts); err != nil { - return err - } - - if opts.RemoveUnused { - // remove unused definitions - expected := make(map[string]struct{}) - for k := range opts.Swagger().Definitions { - expected[slashpath.Join(definitionsPath, jsonpointer.Escape(k))] = struct{}{} - } - for _, k := range opts.Spec.AllDefinitionReferences() { - delete(expected, k) - } - for k := range expected { - debugLog("removing unused definition %s", slashpath.Base(k)) - if opts.Verbose { - log.Printf("info: removing unused definition: %s", slashpath.Base(k)) - } - delete(opts.Swagger().Definitions, slashpath.Base(k)) - } - opts.Spec.reload() // re-analyze - } - - // TODO: simplify known schema patterns to flat objects with properties - // examples: - // - lift simple allOf object, - // - empty allOf with validation only or extensions only - // - rework allOf arrays - // - rework allOf additionalProperties - - if opts.Verbose { - // issue notifications - croak(&opts) - } - return nil -} - -// isAnalyzedAsComplex determines if an analyzed schema is eligible to flattening (i.e. it is "complex"). -// -// Complex means the schema is any of: -// - a simple type (primitive) -// - an array of something (items are possibly complex ; if this is the case, items will generate a definition) -// - a map of something (additionalProperties are possibly complex ; if this is the case, additionalProperties will -// generate a definition) -func isAnalyzedAsComplex(asch *AnalyzedSchema) bool { - if !asch.IsSimpleSchema && !asch.IsArray && !asch.IsMap { - return true - } - return false -} - -// nameInlinedSchemas replaces every complex inline construct by a named definition. -func nameInlinedSchemas(opts *FlattenOpts) error { - debugLog("nameInlinedSchemas") - namer := &inlineSchemaNamer{ - Spec: opts.Swagger(), - Operations: opRefsByRef(gatherOperations(opts.Spec, nil)), - flattenContext: opts.flattenContext, - opts: opts, - } - depthFirst := sortDepthFirst(opts.Spec.allSchemas) - for _, key := range depthFirst { - sch := opts.Spec.allSchemas[key] - if sch.Schema != nil && sch.Schema.Ref.String() == "" && !sch.TopLevel { // inline schema - asch, err := Schema(SchemaOpts{Schema: sch.Schema, Root: opts.Swagger(), BasePath: opts.BasePath}) - if err != nil { - return fmt.Errorf("schema analysis [%s]: %v", key, err) - } - - if isAnalyzedAsComplex(asch) { // move complex schemas to definitions - if err := namer.Name(key, sch.Schema, asch); err != nil { - return err - } - } - } - } - return nil -} - -var depthGroupOrder = []string{ - "sharedParam", "sharedResponse", "sharedOpParam", "opParam", "codeResponse", "defaultResponse", "definition", -} - -func sortDepthFirst(data map[string]SchemaRef) []string { - // group by category (shared params, op param, statuscode response, default response, definitions) - // sort groups internally by number of parts in the key and lexical names - // flatten groups into a single list of keys - sorted := make([]string, 0, len(data)) - grouped := make(map[string]keys, len(data)) - for k := range data { - split := keyParts(k) - var pk string - if split.IsSharedOperationParam() { - pk = "sharedOpParam" - } - if split.IsOperationParam() { - pk = "opParam" - } - if split.IsStatusCodeResponse() { - pk = "codeResponse" - } - if split.IsDefaultResponse() { - pk = "defaultResponse" - } - if split.IsDefinition() { - pk = "definition" - } - if split.IsSharedParam() { - pk = "sharedParam" - } - if split.IsSharedResponse() { - pk = "sharedResponse" - } - grouped[pk] = append(grouped[pk], key{Segments: len(split), Key: k}) - } - - for _, pk := range depthGroupOrder { - res := grouped[pk] - sort.Sort(res) - for _, v := range res { - sorted = append(sorted, v.Key) - } - } - return sorted -} - -type key struct { - Segments int - Key string -} -type keys []key - -func (k keys) Len() int { return len(k) } -func (k keys) Swap(i, j int) { k[i], k[j] = k[j], k[i] } -func (k keys) Less(i, j int) bool { - return k[i].Segments > k[j].Segments || (k[i].Segments == k[j].Segments && k[i].Key < k[j].Key) -} - -type inlineSchemaNamer struct { - Spec *swspec.Swagger - Operations map[string]opRef - flattenContext *context - opts *FlattenOpts -} - -func opRefsByRef(oprefs map[string]opRef) map[string]opRef { - result := make(map[string]opRef, len(oprefs)) - for _, v := range oprefs { - result[v.Ref.String()] = v - } - return result -} - -func (isn *inlineSchemaNamer) Name(key string, schema *swspec.Schema, aschema *AnalyzedSchema) error { - debugLog("naming inlined schema at %s", key) - - parts := keyParts(key) - for _, name := range namesFromKey(parts, aschema, isn.Operations) { - if name != "" { - // create unique name - newName, isOAIGen := uniqifyName(isn.Spec.Definitions, swag.ToJSONName(name)) - - // clone schema - sch, err := cloneSchema(schema) - if err != nil { - return err - } - - // replace values on schema - if err := rewriteSchemaToRef(isn.Spec, key, - swspec.MustCreateRef(slashpath.Join(definitionsPath, newName))); err != nil { - return fmt.Errorf("error while creating definition %q from inline schema: %v", newName, err) - } - - // rewrite any dependent $ref pointing to this place, - // when not already pointing to a top-level definition. - // - // NOTE: this is important if such referers use arbitrary JSON pointers. - an := New(isn.Spec) - for k, v := range an.references.allRefs { - r, _, erd := deepestRef(isn.opts, v) - if erd != nil { - return fmt.Errorf("at %s, %v", k, erd) - } - if r.String() == key || - r.String() == slashpath.Join(definitionsPath, newName) && - slashpath.Dir(v.String()) != definitionsPath { - debugLog("found a $ref to a rewritten schema: %s points to %s", k, v.String()) - - // rewrite $ref to the new target - if err := updateRef(isn.Spec, k, - swspec.MustCreateRef(slashpath.Join(definitionsPath, newName))); err != nil { - return err - } - } - } - - // NOTE: this extension is currently not used by go-swagger (provided for information only) - sch.AddExtension("x-go-gen-location", genLocation(parts)) - - // save cloned schema to definitions - saveSchema(isn.Spec, newName, sch) - - // keep track of created refs - if isn.flattenContext != nil { - debugLog("track created ref: key=%s, newName=%s, isOAIGen=%t", key, newName, isOAIGen) - resolved := false - if _, ok := isn.flattenContext.newRefs[key]; ok { - resolved = isn.flattenContext.newRefs[key].resolved - } - isn.flattenContext.newRefs[key] = &newRef{ - key: key, - newName: newName, - path: slashpath.Join(definitionsPath, newName), - isOAIGen: isOAIGen, - resolved: resolved, - schema: sch, - } - } - } - } - return nil -} - -// genLocation indicates from which section of the specification (models or operations) a definition has been created. -// -// This is reflected in the output spec with a "x-go-gen-location" extension. At the moment, this is is provided -// for information only. -func genLocation(parts splitKey) string { - if parts.IsOperation() { - return "operations" - } - if parts.IsDefinition() { - return "models" - } - return "" -} - -// uniqifyName yields a unique name for a definition -func uniqifyName(definitions swspec.Definitions, name string) (string, bool) { - isOAIGen := false - if name == "" { - name = "oaiGen" - isOAIGen = true - } - if len(definitions) == 0 { - return name, isOAIGen - } - - unq := true - for k := range definitions { - if strings.EqualFold(k, name) { - unq = false - break - } - } - - if unq { - return name, isOAIGen - } - - name += "OAIGen" - isOAIGen = true - var idx int - unique := name - _, known := definitions[unique] - for known { - idx++ - unique = fmt.Sprintf("%s%d", name, idx) - _, known = definitions[unique] - } - return unique, isOAIGen -} - -func namesFromKey(parts splitKey, aschema *AnalyzedSchema, operations map[string]opRef) []string { - var baseNames [][]string - var startIndex int - if parts.IsOperation() { - // params - if parts.IsOperationParam() || parts.IsSharedOperationParam() { - piref := parts.PathItemRef() - if piref.String() != "" && parts.IsOperationParam() { - if op, ok := operations[piref.String()]; ok { - startIndex = 5 - baseNames = append(baseNames, []string{op.ID, "params", "body"}) - } - } else if parts.IsSharedOperationParam() { - pref := parts.PathRef() - for k, v := range operations { - if strings.HasPrefix(k, pref.String()) { - startIndex = 4 - baseNames = append(baseNames, []string{v.ID, "params", "body"}) - } - } - } - } - // responses - if parts.IsOperationResponse() { - piref := parts.PathItemRef() - if piref.String() != "" { - if op, ok := operations[piref.String()]; ok { - startIndex = 6 - baseNames = append(baseNames, []string{op.ID, parts.ResponseName(), "body"}) - } - } - } - } - - // definitions - if parts.IsDefinition() { - nm := parts.DefinitionName() - if nm != "" { - startIndex = 2 - baseNames = append(baseNames, []string{parts.DefinitionName()}) - } - } - - var result []string - for _, segments := range baseNames { - nm := parts.BuildName(segments, startIndex, aschema) - if nm != "" { - result = append(result, nm) - } - } - sort.Strings(result) - return result -} - -const ( - paths = "paths" - responses = "responses" - parameters = "parameters" - definitions = "definitions" - definitionsPath = "#/definitions" -) - -var ( - ignoredKeys map[string]struct{} - validMethods map[string]struct{} -) - -func init() { - ignoredKeys = map[string]struct{}{ - "schema": {}, - "properties": {}, - "not": {}, - "anyOf": {}, - "oneOf": {}, - } - - validMethods = map[string]struct{}{ - "GET": {}, - "HEAD": {}, - "OPTIONS": {}, - "PATCH": {}, - "POST": {}, - "PUT": {}, - "DELETE": {}, - } -} - -type splitKey []string - -func (s splitKey) IsDefinition() bool { - return len(s) > 1 && s[0] == definitions -} - -func (s splitKey) DefinitionName() string { - if !s.IsDefinition() { - return "" - } - return s[1] -} - -func (s splitKey) isKeyName(i int) bool { - if i <= 0 { - return false - } - count := 0 - for idx := i - 1; idx > 0; idx-- { - if s[idx] != "properties" { - break - } - count++ - } - - return count%2 != 0 -} - -func (s splitKey) BuildName(segments []string, startIndex int, aschema *AnalyzedSchema) string { - for i, part := range s[startIndex:] { - if _, ignored := ignoredKeys[part]; !ignored || s.isKeyName(startIndex+i) { - if part == "items" || part == "additionalItems" { - if aschema.IsTuple || aschema.IsTupleWithExtra { - segments = append(segments, "tuple") - } else { - segments = append(segments, "items") - } - if part == "additionalItems" { - segments = append(segments, part) - } - continue - } - segments = append(segments, part) - } - } - return strings.Join(segments, " ") -} - -func (s splitKey) IsOperation() bool { - return len(s) > 1 && s[0] == paths -} - -func (s splitKey) IsSharedOperationParam() bool { - return len(s) > 2 && s[0] == paths && s[2] == parameters -} - -func (s splitKey) IsSharedParam() bool { - return len(s) > 1 && s[0] == parameters -} - -func (s splitKey) IsOperationParam() bool { - return len(s) > 3 && s[0] == paths && s[3] == parameters -} - -func (s splitKey) IsOperationResponse() bool { - return len(s) > 3 && s[0] == paths && s[3] == responses -} - -func (s splitKey) IsSharedResponse() bool { - return len(s) > 1 && s[0] == responses -} - -func (s splitKey) IsDefaultResponse() bool { - return len(s) > 4 && s[0] == paths && s[3] == responses && s[4] == "default" -} - -func (s splitKey) IsStatusCodeResponse() bool { - isInt := func() bool { - _, err := strconv.Atoi(s[4]) - return err == nil - } - return len(s) > 4 && s[0] == paths && s[3] == responses && isInt() -} - -func (s splitKey) ResponseName() string { - if s.IsStatusCodeResponse() { - code, _ := strconv.Atoi(s[4]) - return http.StatusText(code) - } - if s.IsDefaultResponse() { - return "Default" - } - return "" -} - -func (s splitKey) PathItemRef() swspec.Ref { - if len(s) < 3 { - return swspec.Ref{} - } - pth, method := s[1], s[2] - if _, isValidMethod := validMethods[strings.ToUpper(method)]; !isValidMethod && !strings.HasPrefix(method, "x-") { - return swspec.Ref{} - } - return swspec.MustCreateRef("#" + slashpath.Join("/", paths, jsonpointer.Escape(pth), strings.ToUpper(method))) -} - -func (s splitKey) PathRef() swspec.Ref { - if !s.IsOperation() { - return swspec.Ref{} - } - return swspec.MustCreateRef("#" + slashpath.Join("/", paths, jsonpointer.Escape(s[1]))) -} - -func keyParts(key string) splitKey { - var res []string - for _, part := range strings.Split(key[1:], "/") { - if part != "" { - res = append(res, jsonpointer.Unescape(part)) - } - } - return res -} - -func rewriteSchemaToRef(spec *swspec.Swagger, key string, ref swspec.Ref) error { - debugLog("rewriting schema to ref for %s with %s", key, ref.String()) - _, value, err := getPointerFromKey(spec, key) - if err != nil { - return err - } - - switch refable := value.(type) { - case *swspec.Schema: - return rewriteParentRef(spec, key, ref) - - case swspec.Schema: - return rewriteParentRef(spec, key, ref) - - case *swspec.SchemaOrArray: - if refable.Schema != nil { - refable.Schema = &swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - } - - case *swspec.SchemaOrBool: - if refable.Schema != nil { - refable.Schema = &swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - } - default: - return fmt.Errorf("no schema with ref found at %s for %T", key, value) - } - - return nil -} - -func rewriteParentRef(spec *swspec.Swagger, key string, ref swspec.Ref) error { - parent, entry, pvalue, err := getParentFromKey(spec, key) - if err != nil { - return err - } - - debugLog("rewriting holder for %T", pvalue) - switch container := pvalue.(type) { - case swspec.Response: - if err := rewriteParentRef(spec, "#"+parent, ref); err != nil { - return err - } - - case *swspec.Response: - container.Schema = &swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case *swspec.Responses: - statusCode, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %v", key[1:], err) - } - resp := container.StatusCodeResponses[statusCode] - resp.Schema = &swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - container.StatusCodeResponses[statusCode] = resp - - case map[string]swspec.Response: - resp := container[entry] - resp.Schema = &swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - container[entry] = resp - - case swspec.Parameter: - if err := rewriteParentRef(spec, "#"+parent, ref); err != nil { - return err - } - - case map[string]swspec.Parameter: - param := container[entry] - param.Schema = &swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - container[entry] = param - - case []swspec.Parameter: - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %v", key[1:], err) - } - param := container[idx] - param.Schema = &swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - container[idx] = param - - case swspec.Definitions: - container[entry] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case map[string]swspec.Schema: - container[entry] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case []swspec.Schema: - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %v", key[1:], err) - } - container[idx] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case *swspec.SchemaOrArray: - // NOTE: this is necessarily an array - otherwise, the parent would be *Schema - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %v", key[1:], err) - } - container.Schemas[idx] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case swspec.SchemaProperties: - container[entry] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - // NOTE: can't have case *swspec.SchemaOrBool = parent in this case is *Schema - - default: - return fmt.Errorf("unhandled parent schema rewrite %s (%T)", key, pvalue) - } - return nil -} - -func cloneSchema(schema *swspec.Schema) (*swspec.Schema, error) { - var sch swspec.Schema - if err := swag.FromDynamicJSON(schema, &sch); err != nil { - return nil, fmt.Errorf("cannot clone schema: %v", err) - } - return &sch, nil -} - -// importExternalReferences iteratively digs remote references and imports them into the main schema. -// -// At every iteration, new remotes may be found when digging deeper: they are rebased to the current schema before being imported. -// -// This returns true when no more remote references can be found. -func importExternalReferences(opts *FlattenOpts) (bool, error) { - debugLog("importExternalReferences") - - groupedRefs := reverseIndexForSchemaRefs(opts) - sortedRefStr := make([]string, 0, len(groupedRefs)) - if opts.flattenContext == nil { - opts.flattenContext = newContext() - } - - // sort $ref resolution to ensure deterministic name conflict resolution - for refStr := range groupedRefs { - sortedRefStr = append(sortedRefStr, refStr) - } - sort.Strings(sortedRefStr) - - complete := true - - for _, refStr := range sortedRefStr { - entry := groupedRefs[refStr] - if entry.Ref.HasFragmentOnly { - continue - } - complete = false - var isOAIGen bool - - newName := opts.flattenContext.resolved[refStr] - if newName != "" { - // rewrite ref with already resolved external ref (useful for cyclical refs): - // rewrite external refs to local ones - debugLog("resolving known ref [%s] to %s", refStr, newName) - for _, key := range entry.Keys { - if err := updateRef(opts.Swagger(), key, - swspec.MustCreateRef(slashpath.Join(definitionsPath, newName))); err != nil { - return false, err - } - } - } else { - // resolve schemas - debugLog("resolving schema from remote $ref [%s]", refStr) - sch, err := swspec.ResolveRefWithBase(opts.Swagger(), &entry.Ref, opts.ExpandOpts(false)) - if err != nil { - return false, fmt.Errorf("could not resolve schema: %v", err) - } - - // at this stage only $ref analysis matters - partialAnalyzer := &Spec{ - references: referenceAnalysis{}, - patterns: patternAnalysis{}, - enums: enumAnalysis{}, - } - partialAnalyzer.reset() - partialAnalyzer.analyzeSchema("", sch, "/") - - // now rewrite those refs with rebase - for key, ref := range partialAnalyzer.references.allRefs { - if err := updateRef(sch, key, swspec.MustCreateRef(rebaseRef(entry.Ref.String(), ref.String()))); err != nil { - return false, fmt.Errorf("failed to rewrite ref for key %q at %s: %v", key, entry.Ref.String(), err) - } - } - - // generate a unique name - isOAIGen means that a naming conflict was resolved by changing the name - newName, isOAIGen = uniqifyName(opts.Swagger().Definitions, nameFromRef(entry.Ref)) - debugLog("new name for [%s]: %s - with name conflict:%t", - strings.Join(entry.Keys, ", "), newName, isOAIGen) - - opts.flattenContext.resolved[refStr] = newName - - // rewrite the external refs to local ones - for _, key := range entry.Keys { - if err := updateRef(opts.Swagger(), key, - swspec.MustCreateRef(slashpath.Join(definitionsPath, newName))); err != nil { - return false, err - } - - // keep track of created refs - resolved := false - if _, ok := opts.flattenContext.newRefs[key]; ok { - resolved = opts.flattenContext.newRefs[key].resolved - } - debugLog("keeping track of ref: %s (%s), resolved: %t", key, newName, resolved) - opts.flattenContext.newRefs[key] = &newRef{ - key: key, - newName: newName, - path: slashpath.Join(definitionsPath, newName), - isOAIGen: isOAIGen, - resolved: resolved, - schema: sch, - } - } - - // add the resolved schema to the definitions - saveSchema(opts.Swagger(), newName, sch) - } - } - // maintains ref index entries - for k := range opts.flattenContext.newRefs { - r := opts.flattenContext.newRefs[k] - - // update tracking with resolved schemas - if r.schema.Ref.String() != "" { - ref := swspec.MustCreateRef(r.path) - sch, err := swspec.ResolveRefWithBase(opts.Swagger(), &ref, opts.ExpandOpts(false)) - if err != nil { - return false, fmt.Errorf("could not resolve schema: %v", err) - } - r.schema = sch - } - // update tracking with renamed keys: got a cascade of refs - if r.path != k { - renamed := *r - renamed.key = r.path - opts.flattenContext.newRefs[renamed.path] = &renamed - - // indirect ref - r.newName = slashpath.Base(k) - r.schema = swspec.RefSchema(r.path) - r.path = k - r.isOAIGen = strings.Contains(k, "OAIGen") - } - } - - return complete, nil -} - -type refRevIdx struct { - Ref swspec.Ref - Keys []string -} - -// rebaseRef rebase a remote ref relative to a base ref. -// -// NOTE: does not support JSONschema ID for $ref (we assume we are working with swagger specs here). -// -// NOTE(windows): -// * refs are assumed to have been normalized with drive letter lower cased (from go-openapi/spec) -// * "/ in paths may appear as escape sequences -func rebaseRef(baseRef string, ref string) string { - debugLog("rebasing ref: %s onto %s", ref, baseRef) - baseRef, _ = url.PathUnescape(baseRef) - ref, _ = url.PathUnescape(ref) - if baseRef == "" || baseRef == "." || strings.HasPrefix(baseRef, "#") { - return ref - } - - parts := strings.Split(ref, "#") - - baseParts := strings.Split(baseRef, "#") - baseURL, _ := url.Parse(baseParts[0]) - if strings.HasPrefix(ref, "#") { - if baseURL.Host == "" { - return strings.Join([]string{baseParts[0], parts[1]}, "#") - } - return strings.Join([]string{baseParts[0], parts[1]}, "#") - } - - refURL, _ := url.Parse(parts[0]) - if refURL.Host != "" || filepath.IsAbs(parts[0]) { - // not rebasing an absolute path - return ref - } - - // there is a relative path - var basePath string - if baseURL.Host != "" { - // when there is a host, standard URI rules apply (with "/") - baseURL.Path = slashpath.Dir(baseURL.Path) - baseURL.Path = slashpath.Join(baseURL.Path, "/"+parts[0]) - return baseURL.String() - } - - // this is a local relative path - // basePart[0] and parts[0] are local filesystem directories/files - basePath = filepath.Dir(baseParts[0]) - relPath := filepath.Join(basePath, string(filepath.Separator)+parts[0]) - if len(parts) > 1 { - return strings.Join([]string{relPath, parts[1]}, "#") - } - return relPath -} - -// normalizePath renders absolute path on remote file refs -// -// NOTE(windows): -// * refs are assumed to have been normalized with drive letter lower cased (from go-openapi/spec) -// * "/ in paths may appear as escape sequences -func normalizePath(ref swspec.Ref, opts *FlattenOpts) (normalizedPath string) { - uri, _ := url.PathUnescape(ref.String()) - if ref.HasFragmentOnly || filepath.IsAbs(uri) { - normalizedPath = uri - return - } - - refURL, _ := url.Parse(uri) - if refURL.Host != "" { - normalizedPath = uri - return - } - - parts := strings.Split(uri, "#") - // BasePath, parts[0] are local filesystem directories, guaranteed to be absolute at this stage - parts[0] = filepath.Join(filepath.Dir(opts.BasePath), parts[0]) - normalizedPath = strings.Join(parts, "#") - return -} - -func reverseIndexForSchemaRefs(opts *FlattenOpts) map[string]refRevIdx { - collected := make(map[string]refRevIdx) - for key, schRef := range opts.Spec.references.schemas { - // normalize paths before sorting, - // so we get together keys in same external file - normalizedPath := normalizePath(schRef, opts) - if entry, ok := collected[normalizedPath]; ok { - entry.Keys = append(entry.Keys, key) - collected[normalizedPath] = entry - } else { - collected[normalizedPath] = refRevIdx{ - Ref: schRef, - Keys: []string{key}, - } - } - } - return collected -} - -func nameFromRef(ref swspec.Ref) string { - u := ref.GetURL() - if u.Fragment != "" { - return swag.ToJSONName(slashpath.Base(u.Fragment)) - } - if u.Path != "" { - bn := slashpath.Base(u.Path) - if bn != "" && bn != "/" { - ext := slashpath.Ext(bn) - if ext != "" { - return swag.ToJSONName(bn[:len(bn)-len(ext)]) - } - return swag.ToJSONName(bn) - } - } - return swag.ToJSONName(strings.ReplaceAll(u.Host, ".", " ")) -} - -func saveSchema(spec *swspec.Swagger, name string, schema *swspec.Schema) { - if schema == nil { - return - } - if spec.Definitions == nil { - spec.Definitions = make(map[string]swspec.Schema, 150) - } - spec.Definitions[name] = *schema -} - -// getPointerFromKey retrieves the content of the JSON pointer "key" -func getPointerFromKey(spec interface{}, key string) (string, interface{}, error) { - switch spec.(type) { - case *swspec.Schema: - case *swspec.Swagger: - default: - panic("unexpected type used in getPointerFromKey") - } - if key == "#/" { - return "", spec, nil - } - // unescape chars in key, e.g. "{}" from path params - pth, _ := internal.PathUnescape(key[1:]) - ptr, err := jsonpointer.New(pth) - if err != nil { - return "", nil, err - } - - value, _, err := ptr.Get(spec) - if err != nil { - debugLog("error when getting key: %s with path: %s", key, pth) - return "", nil, err - } - return pth, value, nil -} - -// getParentFromKey retrieves the container of the JSON pointer "key" -func getParentFromKey(spec interface{}, key string) (string, string, interface{}, error) { - switch spec.(type) { - case *swspec.Schema: - case *swspec.Swagger: - default: - panic("unexpected type used in getPointerFromKey") - } - // unescape chars in key, e.g. "{}" from path params - pth, _ := internal.PathUnescape(key[1:]) - - parent, entry := slashpath.Dir(pth), slashpath.Base(pth) - debugLog("getting schema holder at: %s, with entry: %s", parent, entry) - - pptr, err := jsonpointer.New(parent) - if err != nil { - return "", "", nil, err - } - pvalue, _, err := pptr.Get(spec) - if err != nil { - return "", "", nil, fmt.Errorf("can't get parent for %s: %v", parent, err) - } - return parent, entry, pvalue, nil -} - -// updateRef replaces a ref by another one -func updateRef(spec interface{}, key string, ref swspec.Ref) error { - switch spec.(type) { - case *swspec.Schema: - case *swspec.Swagger: - default: - panic("unexpected type used in getPointerFromKey") - } - debugLog("updating ref for %s with %s", key, ref.String()) - pth, value, err := getPointerFromKey(spec, key) - if err != nil { - return err - } - - switch refable := value.(type) { - case *swspec.Schema: - refable.Ref = ref - case *swspec.SchemaOrArray: - if refable.Schema != nil { - refable.Schema.Ref = ref - } - case *swspec.SchemaOrBool: - if refable.Schema != nil { - refable.Schema.Ref = ref - } - case swspec.Schema: - debugLog("rewriting holder for %T", refable) - _, entry, pvalue, erp := getParentFromKey(spec, key) - if erp != nil { - return err - } - switch container := pvalue.(type) { - case swspec.Definitions: - container[entry] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case map[string]swspec.Schema: - container[entry] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case []swspec.Schema: - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %v", pth, err) - } - container[idx] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case *swspec.SchemaOrArray: - // NOTE: this is necessarily an array - otherwise, the parent would be *Schema - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %v", pth, err) - } - container.Schemas[idx] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - case swspec.SchemaProperties: - container[entry] = swspec.Schema{SchemaProps: swspec.SchemaProps{Ref: ref}} - - // NOTE: can't have case *swspec.SchemaOrBool = parent in this case is *Schema - - default: - return fmt.Errorf("unhandled container type at %s: %T", key, value) - } - - default: - return fmt.Errorf("no schema with ref found at %s for %T", key, value) - } - - return nil -} - -// updateRefWithSchema replaces a ref with a schema (i.e. re-inline schema) -func updateRefWithSchema(spec *swspec.Swagger, key string, sch *swspec.Schema) error { - debugLog("updating ref for %s with schema", key) - pth, value, err := getPointerFromKey(spec, key) - if err != nil { - return err - } - - switch refable := value.(type) { - case *swspec.Schema: - *refable = *sch - case swspec.Schema: - _, entry, pvalue, erp := getParentFromKey(spec, key) - if erp != nil { - return err - } - switch container := pvalue.(type) { - case swspec.Definitions: - container[entry] = *sch - - case map[string]swspec.Schema: - container[entry] = *sch - - case []swspec.Schema: - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %v", pth, err) - } - container[idx] = *sch - - case *swspec.SchemaOrArray: - // NOTE: this is necessarily an array - otherwise, the parent would be *Schema - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %v", pth, err) - } - container.Schemas[idx] = *sch - - case swspec.SchemaProperties: - container[entry] = *sch - - // NOTE: can't have case *swspec.SchemaOrBool = parent in this case is *Schema - - default: - return fmt.Errorf("unhandled type for parent of [%s]: %T", key, value) - } - case *swspec.SchemaOrArray: - *refable.Schema = *sch - // NOTE: can't have case *swspec.SchemaOrBool = parent in this case is *Schema - case *swspec.SchemaOrBool: - *refable.Schema = *sch - default: - return fmt.Errorf("no schema with ref found at %s for %T", key, value) - } - - return nil -} - -func containsString(names []string, name string) bool { - for _, nm := range names { - if nm == name { - return true - } - } - return false -} - -type opRef struct { - Method string - Path string - Key string - ID string - Op *swspec.Operation - Ref swspec.Ref -} - -type opRefs []opRef - -func (o opRefs) Len() int { return len(o) } -func (o opRefs) Swap(i, j int) { o[i], o[j] = o[j], o[i] } -func (o opRefs) Less(i, j int) bool { return o[i].Key < o[j].Key } - -func gatherOperations(specDoc *Spec, operationIDs []string) map[string]opRef { - var oprefs opRefs - - for method, pathItem := range specDoc.Operations() { - for pth, operation := range pathItem { - vv := *operation - oprefs = append(oprefs, opRef{ - Key: swag.ToGoName(strings.ToLower(method) + " " + pth), - Method: method, - Path: pth, - ID: vv.ID, - Op: &vv, - Ref: swspec.MustCreateRef("#" + slashpath.Join("/paths", jsonpointer.Escape(pth), method)), - }) - } - } - - sort.Sort(oprefs) - - operations := make(map[string]opRef) - for _, opr := range oprefs { - nm := opr.ID - if nm == "" { - nm = opr.Key - } - - oo, found := operations[nm] - if found && oo.Method != opr.Method && oo.Path != opr.Path { - nm = opr.Key - } - if len(operationIDs) == 0 || containsString(operationIDs, opr.ID) || containsString(operationIDs, nm) { - opr.ID = nm - opr.Op.ID = nm - operations[nm] = opr - } - } - return operations -} - -// stripPointersAndOAIGen removes anonymous JSON pointers from spec and chain with name conflicts handler. -// This loops until the spec has no such pointer and all name conflicts have been reduced as much as possible. -func stripPointersAndOAIGen(opts *FlattenOpts) error { - // name all JSON pointers to anonymous documents - if err := namePointers(opts); err != nil { - return err - } - - // remove unnecessary OAIGen ref (created when flattening external refs creates name conflicts) - hasIntroducedPointerOrInline, ers := stripOAIGen(opts) - if ers != nil { - return ers - } - - // iterate as pointer or OAIGen resolution may introduce inline schemas or pointers - for hasIntroducedPointerOrInline { - if !opts.Minimal { - opts.Spec.reload() // re-analyze - if err := nameInlinedSchemas(opts); err != nil { - return err - } - } - - if err := namePointers(opts); err != nil { - return err - } - - // restrip and re-analyze - if hasIntroducedPointerOrInline, ers = stripOAIGen(opts); ers != nil { - return ers - } - } - return nil -} - -func updateRefParents(opts *FlattenOpts, r *newRef) { - if !r.isOAIGen || r.resolved { // bail on already resolved entries (avoid looping) - return - } - for k, v := range opts.Spec.references.allRefs { - if r.path != v.String() { - continue - } - found := false - for _, p := range r.parents { - if p == k { - found = true - break - } - } - if !found { - r.parents = append(r.parents, k) - } - } -} - -// topMostRefs is able to sort refs by hierarchical then lexicographic order, -// yielding refs ordered breadth-first. -type topmostRefs []string - -func (k topmostRefs) Len() int { return len(k) } -func (k topmostRefs) Swap(i, j int) { k[i], k[j] = k[j], k[i] } -func (k topmostRefs) Less(i, j int) bool { - li, lj := len(strings.Split(k[i], "/")), len(strings.Split(k[j], "/")) - if li == lj { - return k[i] < k[j] - } - return li < lj -} - -func topmostFirst(refs []string) []string { - res := topmostRefs(refs) - sort.Sort(res) - return res -} - -// stripOAIGen strips the spec from unnecessary OAIGen constructs, initially created to dedupe flattened definitions. -// -// A dedupe is deemed unnecessary whenever: -// - the only conflict is with its (single) parent: OAIGen is merged into its parent (reinlining) -// - there is a conflict with multiple parents: merge OAIGen in first parent, the rewrite other parents to point to -// the first parent. -// -// This function returns true whenever it re-inlined a complex schema, so the caller may chose to iterate -// pointer and name resolution again. -func stripOAIGen(opts *FlattenOpts) (bool, error) { - debugLog("stripOAIGen") - replacedWithComplex := false - - // figure out referers of OAIGen definitions (doing it before the ref start mutating) - for _, r := range opts.flattenContext.newRefs { - updateRefParents(opts, r) - } - for k := range opts.flattenContext.newRefs { - r := opts.flattenContext.newRefs[k] - debugLog("newRefs[%s]: isOAIGen: %t, resolved: %t, name: %s, path:%s, #parents: %d, parents: %v, ref: %s", - k, r.isOAIGen, r.resolved, r.newName, r.path, len(r.parents), r.parents, r.schema.Ref.String()) - if r.isOAIGen && len(r.parents) >= 1 { - pr := topmostFirst(r.parents) - - // rewrite first parent schema in hierarchical then lexicographical order - debugLog("rewrite first parent %s with schema", pr[0]) - if err := updateRefWithSchema(opts.Swagger(), pr[0], r.schema); err != nil { - return false, err - } - if pa, ok := opts.flattenContext.newRefs[pr[0]]; ok && pa.isOAIGen { - // update parent in ref index entry - debugLog("update parent entry: %s", pr[0]) - pa.schema = r.schema - pa.resolved = false - replacedWithComplex = true - } - - // rewrite other parents to point to first parent - if len(pr) > 1 { - for _, p := range pr[1:] { - replacingRef := swspec.MustCreateRef(pr[0]) - - // set complex when replacing ref is an anonymous jsonpointer: further processing may be required - replacedWithComplex = replacedWithComplex || - slashpath.Dir(replacingRef.String()) != definitionsPath - debugLog("rewrite parent with ref: %s", replacingRef.String()) - - // NOTE: it is possible at this stage to introduce json pointers (to non-definitions places). - // Those are stripped later on. - if err := updateRef(opts.Swagger(), p, replacingRef); err != nil { - return false, err - } - - if pa, ok := opts.flattenContext.newRefs[p]; ok && pa.isOAIGen { - // update parent in ref index - debugLog("update parent entry: %s", p) - pa.schema = r.schema - pa.resolved = false - replacedWithComplex = true - } - } - } - - // remove OAIGen definition - debugLog("removing definition %s", slashpath.Base(r.path)) - delete(opts.Swagger().Definitions, slashpath.Base(r.path)) - - // propagate changes in ref index for keys which have this one as a parent - for kk, value := range opts.flattenContext.newRefs { - if kk == k || !value.isOAIGen || value.resolved { - continue - } - found := false - newParents := make([]string, 0, len(value.parents)) - for _, parent := range value.parents { - switch { - case parent == r.path: - found = true - parent = pr[0] - case strings.HasPrefix(parent, r.path+"/"): - found = true - parent = slashpath.Join(pr[0], strings.TrimPrefix(parent, r.path)) - } - newParents = append(newParents, parent) - } - if found { - value.parents = newParents - } - } - - // mark naming conflict as resolved - debugLog("marking naming conflict resolved for key: %s", r.key) - opts.flattenContext.newRefs[r.key].isOAIGen = false - opts.flattenContext.newRefs[r.key].resolved = true - - // determine if the previous substitution did inline a complex schema - if r.schema != nil && r.schema.Ref.String() == "" { // inline schema - asch, err := Schema(SchemaOpts{Schema: r.schema, Root: opts.Swagger(), BasePath: opts.BasePath}) - if err != nil { - return false, err - } - debugLog("re-inlined schema: parent: %s, %t", pr[0], isAnalyzedAsComplex(asch)) - replacedWithComplex = replacedWithComplex || - !(slashpath.Dir(pr[0]) == definitionsPath) && isAnalyzedAsComplex(asch) - } - } - } - - debugLog("replacedWithComplex: %t", replacedWithComplex) - opts.Spec.reload() // re-analyze - return replacedWithComplex, nil -} - -// croak logs notifications and warnings about valid, but possibly unwanted constructs resulting -// from flattening a spec -func croak(opts *FlattenOpts) { - reported := make(map[string]bool, len(opts.flattenContext.newRefs)) - for _, v := range opts.Spec.references.allRefs { - // warns about duplicate handling - for _, r := range opts.flattenContext.newRefs { - if r.isOAIGen && r.path == v.String() { - reported[r.newName] = true - } - } - } - for k := range reported { - log.Printf("warning: duplicate flattened definition name resolved as %s", k) - } - // warns about possible type mismatches - uniqueMsg := make(map[string]bool) - for _, msg := range opts.flattenContext.warnings { - if _, ok := uniqueMsg[msg]; ok { - continue - } - log.Printf("warning: %s", msg) - uniqueMsg[msg] = true - } -} - -// namePointers replaces all JSON pointers to anonymous documents by a $ref to a new named definitions. -// -// This is carried on depth-first. Pointers to $refs which are top level definitions are replaced by the $ref itself. -// Pointers to simple types are expanded, unless they express commonality (i.e. several such $ref are used). -func namePointers(opts *FlattenOpts) error { - debugLog("name pointers") - refsToReplace := make(map[string]SchemaRef, len(opts.Spec.references.schemas)) - for k, ref := range opts.Spec.references.allRefs { - if slashpath.Dir(ref.String()) == definitionsPath { - // this a ref to a top-level definition: ok - continue - } - replacingRef, sch, erd := deepestRef(opts, ref) - if erd != nil { - return fmt.Errorf("at %s, %v", k, erd) - } - debugLog("planning pointer to replace at %s: %s, resolved to: %s", k, ref.String(), replacingRef.String()) - refsToReplace[k] = SchemaRef{ - Name: k, // caller - Ref: replacingRef, // callee - Schema: sch, - TopLevel: slashpath.Dir(replacingRef.String()) == definitionsPath, - } - } - depthFirst := sortDepthFirst(refsToReplace) - namer := &inlineSchemaNamer{ - Spec: opts.Swagger(), - Operations: opRefsByRef(gatherOperations(opts.Spec, nil)), - flattenContext: opts.flattenContext, - opts: opts, - } - - for _, key := range depthFirst { - v := refsToReplace[key] - // update current replacement, which may have been updated by previous changes of deeper elements - replacingRef, sch, erd := deepestRef(opts, v.Ref) - if erd != nil { - return fmt.Errorf("at %s, %v", key, erd) - } - v.Ref = replacingRef - v.Schema = sch - v.TopLevel = slashpath.Dir(replacingRef.String()) == definitionsPath - debugLog("replacing pointer at %s: resolved to: %s", key, v.Ref.String()) - - if v.TopLevel { - debugLog("replace pointer %s by canonical definition: %s", key, v.Ref.String()) - // if the schema is a $ref to a top level definition, just rewrite the pointer to this $ref - if err := updateRef(opts.Swagger(), key, v.Ref); err != nil { - return err - } - } else { - // this is a JSON pointer to an anonymous document (internal or external): - // create a definition for this schema when: - // - it is a complex schema - // - or it is pointed by more than one $ref (i.e. expresses commonality) - // otherwise, expand the pointer (single reference to a simple type) - // - // The named definition for this follows the target's key, not the caller's - debugLog("namePointers at %s for %s", key, v.Ref.String()) - - // qualify the expanded schema - /* - if key == "#/paths/~1some~1where~1{id}/get/parameters/1/items" { - // DEBUG - //func getPointerFromKey(spec interface{}, key string) (string, interface{}, error) { - k, res, err := getPointerFromKey(namer.Spec, key) - debugLog("k = %s, res=%#v, err=%v", k, res, err) - } - */ - asch, ers := Schema(SchemaOpts{Schema: v.Schema, Root: opts.Swagger(), BasePath: opts.BasePath}) - if ers != nil { - return fmt.Errorf("schema analysis [%s]: %v", key, ers) - } - callers := make([]string, 0, 64) - - debugLog("looking for callers") - an := New(opts.Swagger()) - for k, w := range an.references.allRefs { - r, _, erd := deepestRef(opts, w) - if erd != nil { - return fmt.Errorf("at %s, %v", key, erd) - } - if r.String() == v.Ref.String() { - callers = append(callers, k) - } - } - debugLog("callers for %s: %d", v.Ref.String(), len(callers)) - if len(callers) == 0 { - // has already been updated and resolved - continue - } - - parts := keyParts(v.Ref.String()) - debugLog("number of callers for %s: %d", v.Ref.String(), len(callers)) - // identifying edge case when the namer did nothing because we point to a non-schema object - // no definition is created and we expand the $ref for all callers - if (!asch.IsSimpleSchema || len(callers) > 1) && !parts.IsSharedParam() && !parts.IsSharedResponse() { - debugLog("replace JSON pointer at [%s] by definition: %s", key, v.Ref.String()) - if err := namer.Name(v.Ref.String(), v.Schema, asch); err != nil { - return err - } - - // regular case: we named the $ref as a definition, and we move all callers to this new $ref - for _, caller := range callers { - if caller != key { - // move $ref for next to resolve - debugLog("identified caller of %s at [%s]", v.Ref.String(), caller) - c := refsToReplace[caller] - c.Ref = v.Ref - refsToReplace[caller] = c - } - } - } else { - debugLog("expand JSON pointer for key=%s", key) - if err := updateRefWithSchema(opts.Swagger(), key, v.Schema); err != nil { - return err - } - // NOTE: there is no other caller to update - } - } - } - opts.Spec.reload() // re-analyze - return nil -} - -// deepestRef finds the first definition ref, from a cascade of nested refs which are not definitions. -// - if no definition is found, returns the deepest ref. -// - pointers to external files are expanded -// -// NOTE: all external $ref's are assumed to be already expanded at this stage. -func deepestRef(opts *FlattenOpts, ref swspec.Ref) (swspec.Ref, *swspec.Schema, error) { - if !ref.HasFragmentOnly { - // we found an external $ref, which is odd - // does nothing on external $refs - return ref, nil, nil - } - currentRef := ref - visited := make(map[string]bool, 64) -DOWNREF: - for currentRef.String() != "" { - if slashpath.Dir(currentRef.String()) == definitionsPath { - // this is a top-level definition: stop here and return this ref - return currentRef, nil, nil - } - if _, beenThere := visited[currentRef.String()]; beenThere { - return swspec.Ref{}, nil, - fmt.Errorf("cannot resolve cyclic chain of pointers under %s", currentRef.String()) - } - visited[currentRef.String()] = true - value, _, err := currentRef.GetPointer().Get(opts.Swagger()) - if err != nil { - return swspec.Ref{}, nil, err - } - switch refable := value.(type) { - case *swspec.Schema: - if refable.Ref.String() == "" { - break DOWNREF - } - currentRef = refable.Ref - - case swspec.Schema: - if refable.Ref.String() == "" { - break DOWNREF - } - currentRef = refable.Ref - - case *swspec.SchemaOrArray: - if refable.Schema == nil || refable.Schema != nil && refable.Schema.Ref.String() == "" { - break DOWNREF - } - currentRef = refable.Schema.Ref - - case *swspec.SchemaOrBool: - if refable.Schema == nil || refable.Schema != nil && refable.Schema.Ref.String() == "" { - break DOWNREF - } - currentRef = refable.Schema.Ref - - case swspec.Response: - // a pointer points to a schema initially marshalled in responses section... - // Attempt to convert this to a schema. If this fails, the spec is invalid - asJSON, _ := refable.MarshalJSON() - var asSchema swspec.Schema - err := asSchema.UnmarshalJSON(asJSON) - if err != nil { - return swspec.Ref{}, nil, - fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T", - currentRef.String(), value) - - } - opts.flattenContext.warnings = append(opts.flattenContext.warnings, - fmt.Sprintf("found $ref %q (response) interpreted as schema", currentRef.String())) - - if asSchema.Ref.String() == "" { - break DOWNREF - } - currentRef = asSchema.Ref - - case swspec.Parameter: - // a pointer points to a schema initially marshalled in parameters section... - // Attempt to convert this to a schema. If this fails, the spec is invalid - asJSON, _ := refable.MarshalJSON() - var asSchema swspec.Schema - err := asSchema.UnmarshalJSON(asJSON) - if err != nil { - return swspec.Ref{}, nil, - fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T", - currentRef.String(), value) - - } - opts.flattenContext.warnings = append(opts.flattenContext.warnings, - fmt.Sprintf("found $ref %q (parameter) interpreted as schema", currentRef.String())) - - if asSchema.Ref.String() == "" { - break DOWNREF - } - currentRef = asSchema.Ref - - default: - return swspec.Ref{}, nil, - fmt.Errorf("unhandled type to resolve JSON pointer %s. Expected a Schema, got: %T", - currentRef.String(), value) - - } - } - // assess what schema we're ending with - sch, erv := swspec.ResolveRefWithBase(opts.Swagger(), ¤tRef, opts.ExpandOpts(false)) - if erv != nil { - return swspec.Ref{}, nil, erv - } - if sch == nil { - return swspec.Ref{}, nil, fmt.Errorf("no schema found at %s", currentRef.String()) - } - return currentRef, sch, nil -} - -// normalizeRef strips the current file from any $ref. This works around issue go-openapi/spec#76: -// leading absolute file in $ref is stripped -func normalizeRef(opts *FlattenOpts) error { - debugLog("normalizeRef") - altered := false - for k, w := range opts.Spec.references.allRefs { - if !strings.HasPrefix(w.String(), opts.BasePath+definitionsPath) { // may be a mix of / and \, depending on OS - continue - } - altered = true - // strip base path from definition - debugLog("stripping absolute path for: %s", w.String()) - if err := updateRef(opts.Swagger(), k, - swspec.MustCreateRef(slashpath.Join(definitionsPath, slashpath.Base(w.String())))); err != nil { - return err - } - } - if altered { - opts.Spec.reload() // re-analyze - } - return nil -} diff --git a/vendor/github.com/go-openapi/analysis/go.mod b/vendor/github.com/go-openapi/analysis/go.mod deleted file mode 100644 index be9584c..0000000 --- a/vendor/github.com/go-openapi/analysis/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module github.com/go-openapi/analysis - -require ( - github.com/go-openapi/jsonpointer v0.19.5 - github.com/go-openapi/loads v0.20.2 - github.com/go-openapi/spec v0.20.3 - github.com/go-openapi/strfmt v0.20.0 - github.com/go-openapi/swag v0.19.14 - github.com/stretchr/testify v1.7.0 -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/analysis/go.sum b/vendor/github.com/go-openapi/analysis/go.sum deleted file mode 100644 index 2045bc0..0000000 --- a/vendor/github.com/go-openapi/analysis/go.sum +++ /dev/null @@ -1,344 +0,0 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/analysis v0.19.16/go.mod h1:GLInF007N83Ad3m8a/CbQ5TPzdnGT7workfHwuVjNVk= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3 h1:7MGZI1ibQDLasvAz8HuhvYk9eNJbJkCOXWsSjjMS+Zc= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9 h1:9SnKdGhiPZHF3ttwFMiCBEb8jQ4IDdrK+5+a0oTygA4= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0 h1:wCOBNscACI8L93tt5tvB2zOMkJ098XCw3fP0BY2ybDA= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/loads v0.19.6 h1:6IAtnx22MNSjPocZZ2sV7EjgF6wW5rDC9r6ZkNxjiN8= -github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.20.0 h1:Pymw1O8zDmWeNv4kVsHd0W3cvgdp8juRa4U/U/8D/Pk= -github.com/go-openapi/loads v0.20.0/go.mod h1:2LhKquiE513rN5xC6Aan6lYOSddlL8Mp20AW9kpviM4= -github.com/go-openapi/loads v0.20.2 h1:z5p5Xf5wujMxS1y8aP+vxwW5qYT2zdJBbXKmQUG3lcc= -github.com/go-openapi/loads v0.20.2/go.mod h1:hTVUotJ+UonAMMZsvakEgmWKgtulweO9vYP2bQYKA/o= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.16 h1:tQMAY5s5BfmmCC31+ufDCsGrr8iO1A8UIdYfDo5ADvs= -github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= -github.com/go-openapi/runtime v0.19.24 h1:TqagMVlRAOTwllE/7hNKx6rQ10O6T8ZzeJdMjSTKaD4= -github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.15/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.1/go.mod h1:93x7oh+d+FQsmsieroS4cmR3u0p/ywH649a3qwC9OsQ= -github.com/go-openapi/spec v0.20.3 h1:uH9RQ6vdyPSs2pSy9fL8QPspDF2AMIMPtmK5coSSjtQ= -github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2 h1:clPGfBnJohokno0e+d7hs6Yocrzjlgz6EsQSDncCRnE= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3 h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4 h1:eRvaqAhpL0IL6Trh5fDsGnGhiXndzHFuA05w6sXH6/g= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.11 h1:0+YvbNh05rmBkgztd6zHp4OCFn7Mtu30bn46NQo2ZRw= -github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= -github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7 h1:VRuXN2EnMSsZdauzdss6JBC29YotDqG59BZ+tdlIL1s= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.12 h1:Bc0bnY2c3AoF7Gc+IMIAQQsD8fLHjHpc19wXvYuayQI= -github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= -github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= -github.com/go-openapi/validate v0.19.12 h1:mPLM/bfbd00PGOCJlU0yJL7IulkZ+q9VjPv7U11RMQQ= -github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= -github.com/go-openapi/validate v0.19.15 h1:oUHZO8jD7p5oRLANlXF0U8ic9ePBUkDQyRZdN0EhL6M= -github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= -github.com/go-openapi/validate v0.20.1 h1:QGQ5CvK74E28t3DkegGweKR+auemUi5IdpMc4x3UW6s= -github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -go.mongodb.org/mongo-driver v1.0.3 h1:GKoji1ld3tw2aC+GX1wbr/J2fX13yNacEYoJ8Nhr0yU= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1 h1:Sq1fR+0c58RME5EoqKdjkiQAmPjmfHlZOoRI6fTUOcs= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0 h1:ew6uUIeJOo+qdUUv7LxFCUhtWmVv7ZV/Xuy4FAUsw2E= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4 h1:zs/dKNwX0gYUtzwrN9lLiR15hCO0nDwQj5xXx+vjCdE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8= -go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.4 h1:bsPHfODES+/yx2PCWzUYMH8xj6PVniPI8DQrsJuSXSs= -go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.6 h1:rh7GdYmDrb8AQSkF8yteAus8qYOgOASWDOv1BWqBXkU= -go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/go-openapi/analysis/internal/post_go18.go b/vendor/github.com/go-openapi/analysis/internal/post_go18.go deleted file mode 100644 index f96f55c..0000000 --- a/vendor/github.com/go-openapi/analysis/internal/post_go18.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build go1.8 - -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import "net/url" - -// PathUnescape provides url.PathUnescape(), with seamless -// go version support for pre-go1.8 -// -// TODO: this function is currently defined in go-openapi/swag, -// but unexported. We might chose to export it, or simple phase -// out pre-go1.8 support. -func PathUnescape(path string) (string, error) { - return url.PathUnescape(path) -} diff --git a/vendor/github.com/go-openapi/analysis/internal/pre_go18.go b/vendor/github.com/go-openapi/analysis/internal/pre_go18.go deleted file mode 100644 index 4cc6441..0000000 --- a/vendor/github.com/go-openapi/analysis/internal/pre_go18.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build !go1.8 - -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import "net/url" - -// PathUnescape provides url.PathUnescape(), with seamless -// go version support for pre-go1.8 -// -// TODO: this function is currently defined in go-openapi/swag, -// but unexported. We might chose to export it, or simple phase -// out pre-go1.8 support. -func PathUnescape(path string) (string, error) { - return url.QueryUnescape(path) -} diff --git a/vendor/github.com/go-openapi/analysis/mixin.go b/vendor/github.com/go-openapi/analysis/mixin.go deleted file mode 100644 index d579704..0000000 --- a/vendor/github.com/go-openapi/analysis/mixin.go +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import ( - "fmt" - "reflect" - - "github.com/go-openapi/spec" -) - -// Mixin modifies the primary swagger spec by adding the paths and -// definitions from the mixin specs. Top level parameters and -// responses from the mixins are also carried over. Operation id -// collisions are avoided by appending "Mixin" but only if -// needed. -// -// The following parts of primary are subject to merge, filling empty details -// - Info -// - BasePath -// - Host -// - ExternalDocs -// -// Consider calling FixEmptyResponseDescriptions() on the modified primary -// if you read them from storage and they are valid to start with. -// -// Entries in "paths", "definitions", "parameters" and "responses" are -// added to the primary in the order of the given mixins. If the entry -// already exists in primary it is skipped with a warning message. -// -// The count of skipped entries (from collisions) is returned so any -// deviation from the number expected can flag a warning in your build -// scripts. Carefully review the collisions before accepting them; -// consider renaming things if possible. -// -// No key normalization takes place (paths, type defs, -// etc). Ensure they are canonical if your downstream tools do -// key normalization of any form. -// -// Merging schemes (http, https), and consumers/producers do not account for -// collisions. -func Mixin(primary *spec.Swagger, mixins ...*spec.Swagger) []string { - skipped := make([]string, 0, len(mixins)) - opIds := getOpIds(primary) - initPrimary(primary) - - for i, m := range mixins { - skipped = append(skipped, mergeSwaggerProps(primary, m)...) - - skipped = append(skipped, mergeConsumes(primary, m)...) - - skipped = append(skipped, mergeProduces(primary, m)...) - - skipped = append(skipped, mergeTags(primary, m)...) - - skipped = append(skipped, mergeSchemes(primary, m)...) - - skipped = append(skipped, mergeSecurityDefinitions(primary, m)...) - - skipped = append(skipped, mergeSecurityRequirements(primary, m)...) - - skipped = append(skipped, mergeDefinitions(primary, m)...) - - // merging paths requires a map of operationIDs to work with - skipped = append(skipped, mergePaths(primary, m, opIds, i)...) - - skipped = append(skipped, mergeParameters(primary, m)...) - - skipped = append(skipped, mergeResponses(primary, m)...) - } - return skipped -} - -// getOpIds extracts all the paths..operationIds from the given -// spec and returns them as the keys in a map with 'true' values. -func getOpIds(s *spec.Swagger) map[string]bool { - rv := make(map[string]bool) - if s.Paths == nil { - return rv - } - for _, v := range s.Paths.Paths { - piops := pathItemOps(v) - for _, op := range piops { - rv[op.ID] = true - } - } - return rv -} - -func pathItemOps(p spec.PathItem) []*spec.Operation { - var rv []*spec.Operation - rv = appendOp(rv, p.Get) - rv = appendOp(rv, p.Put) - rv = appendOp(rv, p.Post) - rv = appendOp(rv, p.Delete) - rv = appendOp(rv, p.Head) - rv = appendOp(rv, p.Patch) - return rv -} - -func appendOp(ops []*spec.Operation, op *spec.Operation) []*spec.Operation { - if op == nil { - return ops - } - return append(ops, op) -} - -func mergeSecurityDefinitions(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for k, v := range m.SecurityDefinitions { - if _, exists := primary.SecurityDefinitions[k]; exists { - warn := fmt.Sprintf( - "SecurityDefinitions entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - continue - } - primary.SecurityDefinitions[k] = v - } - return -} - -func mergeSecurityRequirements(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for _, v := range m.Security { - found := false - for _, vv := range primary.Security { - if reflect.DeepEqual(v, vv) { - found = true - break - } - } - if found { - warn := fmt.Sprintf( - "Security requirement: '%v' already exists in primary or higher priority mixin, skipping\n", v) - skipped = append(skipped, warn) - continue - } - primary.Security = append(primary.Security, v) - } - return -} - -func mergeDefinitions(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for k, v := range m.Definitions { - // assume name collisions represent IDENTICAL type. careful. - if _, exists := primary.Definitions[k]; exists { - warn := fmt.Sprintf( - "definitions entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - continue - } - primary.Definitions[k] = v - } - return -} - -func mergePaths(primary *spec.Swagger, m *spec.Swagger, opIds map[string]bool, mixIndex int) (skipped []string) { - if m.Paths != nil { - for k, v := range m.Paths.Paths { - if _, exists := primary.Paths.Paths[k]; exists { - warn := fmt.Sprintf( - "paths entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - continue - } - - // Swagger requires that operationIds be - // unique within a spec. If we find a - // collision we append "Mixin0" to the - // operatoinId we are adding, where 0 is mixin - // index. We assume that operationIds with - // all the proivded specs are already unique. - piops := pathItemOps(v) - for _, piop := range piops { - if opIds[piop.ID] { - piop.ID = fmt.Sprintf("%v%v%v", piop.ID, "Mixin", mixIndex) - } - opIds[piop.ID] = true - } - primary.Paths.Paths[k] = v - } - } - return -} - -func mergeParameters(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for k, v := range m.Parameters { - // could try to rename on conflict but would - // have to fix $refs in the mixin. Complain - // for now - if _, exists := primary.Parameters[k]; exists { - warn := fmt.Sprintf( - "top level parameters entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - continue - } - primary.Parameters[k] = v - } - return -} - -func mergeResponses(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for k, v := range m.Responses { - // could try to rename on conflict but would - // have to fix $refs in the mixin. Complain - // for now - if _, exists := primary.Responses[k]; exists { - warn := fmt.Sprintf( - "top level responses entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - continue - } - primary.Responses[k] = v - } - return skipped -} - -func mergeConsumes(primary *spec.Swagger, m *spec.Swagger) []string { - for _, v := range m.Consumes { - found := false - for _, vv := range primary.Consumes { - if v == vv { - found = true - break - } - } - if found { - // no warning here: we just skip it - continue - } - primary.Consumes = append(primary.Consumes, v) - } - return []string{} -} - -func mergeProduces(primary *spec.Swagger, m *spec.Swagger) []string { - for _, v := range m.Produces { - found := false - for _, vv := range primary.Produces { - if v == vv { - found = true - break - } - } - if found { - // no warning here: we just skip it - continue - } - primary.Produces = append(primary.Produces, v) - } - return []string{} -} - -func mergeTags(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for _, v := range m.Tags { - found := false - for _, vv := range primary.Tags { - if v.Name == vv.Name { - found = true - break - } - } - if found { - warn := fmt.Sprintf( - "top level tags entry with name '%v' already exists in primary or higher priority mixin, skipping\n", v.Name) - skipped = append(skipped, warn) - continue - } - primary.Tags = append(primary.Tags, v) - } - return -} - -func mergeSchemes(primary *spec.Swagger, m *spec.Swagger) []string { - for _, v := range m.Schemes { - found := false - for _, vv := range primary.Schemes { - if v == vv { - found = true - break - } - } - if found { - // no warning here: we just skip it - continue - } - primary.Schemes = append(primary.Schemes, v) - } - return []string{} -} - -func mergeSwaggerProps(primary *spec.Swagger, m *spec.Swagger) []string { - var skipped []string - primary.Extensions, skipped = mergeExtensions(primary.Extensions, m.Extensions) - - // merging details in swagger top properties - if primary.Host == "" { - primary.Host = m.Host - } - if primary.BasePath == "" { - primary.BasePath = m.BasePath - } - if primary.Info == nil { - primary.Info = m.Info - } else if m.Info != nil { - var sk []string - primary.Info.Extensions, sk = mergeExtensions(primary.Info.Extensions, m.Info.Extensions) - skipped = append(skipped, sk...) - if primary.Info.Description == "" { - primary.Info.Description = m.Info.Description - } - if primary.Info.Title == "" { - primary.Info.Description = m.Info.Description - } - if primary.Info.TermsOfService == "" { - primary.Info.TermsOfService = m.Info.TermsOfService - } - if primary.Info.Version == "" { - primary.Info.Version = m.Info.Version - } - - if primary.Info.Contact == nil { - primary.Info.Contact = m.Info.Contact - } else if m.Info.Contact != nil { - var csk []string - primary.Info.Contact.Extensions, csk = mergeExtensions(primary.Info.Contact.Extensions, m.Info.Contact.Extensions) - skipped = append(skipped, csk...) - if primary.Info.Contact.Name == "" { - primary.Info.Contact.Name = m.Info.Contact.Name - } - if primary.Info.Contact.URL == "" { - primary.Info.Contact.URL = m.Info.Contact.URL - } - if primary.Info.Contact.Email == "" { - primary.Info.Contact.Email = m.Info.Contact.Email - } - } - - if primary.Info.License == nil { - primary.Info.License = m.Info.License - } else if m.Info.License != nil { - var lsk []string - primary.Info.License.Extensions, lsk = mergeExtensions(primary.Info.License.Extensions, m.Info.License.Extensions) - skipped = append(skipped, lsk...) - if primary.Info.License.Name == "" { - primary.Info.License.Name = m.Info.License.Name - } - if primary.Info.License.URL == "" { - primary.Info.License.URL = m.Info.License.URL - } - } - - } - if primary.ExternalDocs == nil { - primary.ExternalDocs = m.ExternalDocs - } else if m.ExternalDocs != nil { - if primary.ExternalDocs.Description == "" { - primary.ExternalDocs.Description = m.ExternalDocs.Description - } - if primary.ExternalDocs.URL == "" { - primary.ExternalDocs.URL = m.ExternalDocs.URL - } - } - return skipped -} - -func mergeExtensions(primary spec.Extensions, m spec.Extensions) (result spec.Extensions, skipped []string) { - if primary == nil { - result = m - return - } - if m == nil { - result = primary - return - } - result = primary - for k, v := range m { - if _, found := primary[k]; found { - skipped = append(skipped, k) - continue - } - primary[k] = v - } - return -} - -func initPrimary(primary *spec.Swagger) { - if primary.SecurityDefinitions == nil { - primary.SecurityDefinitions = make(map[string]*spec.SecurityScheme) - } - if primary.Security == nil { - primary.Security = make([]map[string][]string, 0, 10) - } - if primary.Produces == nil { - primary.Produces = make([]string, 0, 10) - } - if primary.Consumes == nil { - primary.Consumes = make([]string, 0, 10) - } - if primary.Tags == nil { - primary.Tags = make([]spec.Tag, 0, 10) - } - if primary.Schemes == nil { - primary.Schemes = make([]string, 0, 10) - } - if primary.Paths == nil { - primary.Paths = &spec.Paths{Paths: make(map[string]spec.PathItem)} - } - if primary.Paths.Paths == nil { - primary.Paths.Paths = make(map[string]spec.PathItem) - } - if primary.Definitions == nil { - primary.Definitions = make(spec.Definitions) - } - if primary.Parameters == nil { - primary.Parameters = make(map[string]spec.Parameter) - } - if primary.Responses == nil { - primary.Responses = make(map[string]spec.Response) - } -} diff --git a/vendor/github.com/go-openapi/analysis/schema.go b/vendor/github.com/go-openapi/analysis/schema.go deleted file mode 100644 index ceb4e56..0000000 --- a/vendor/github.com/go-openapi/analysis/schema.go +++ /dev/null @@ -1,234 +0,0 @@ -package analysis - -import ( - "fmt" - - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" -) - -// SchemaOpts configures the schema analyzer -type SchemaOpts struct { - Schema *spec.Schema - Root interface{} - BasePath string - _ struct{} -} - -// Schema analysis, will classify the schema according to known -// patterns. -func Schema(opts SchemaOpts) (*AnalyzedSchema, error) { - if opts.Schema == nil { - return nil, fmt.Errorf("no schema to analyze") - } - - a := &AnalyzedSchema{ - schema: opts.Schema, - root: opts.Root, - basePath: opts.BasePath, - } - - a.initializeFlags() - a.inferKnownType() - a.inferEnum() - a.inferBaseType() - - if err := a.inferMap(); err != nil { - return nil, err - } - if err := a.inferArray(); err != nil { - return nil, err - } - - a.inferTuple() - - if err := a.inferFromRef(); err != nil { - return nil, err - } - - a.inferSimpleSchema() - return a, nil -} - -// AnalyzedSchema indicates what the schema represents -type AnalyzedSchema struct { - schema *spec.Schema - root interface{} - basePath string - - hasProps bool - hasAllOf bool - hasItems bool - hasAdditionalProps bool - hasAdditionalItems bool - hasRef bool - - IsKnownType bool - IsSimpleSchema bool - IsArray bool - IsSimpleArray bool - IsMap bool - IsSimpleMap bool - IsExtendedObject bool - IsTuple bool - IsTupleWithExtra bool - IsBaseType bool - IsEnum bool -} - -// Inherits copies value fields from other onto this schema -func (a *AnalyzedSchema) inherits(other *AnalyzedSchema) { - if other == nil { - return - } - a.hasProps = other.hasProps - a.hasAllOf = other.hasAllOf - a.hasItems = other.hasItems - a.hasAdditionalItems = other.hasAdditionalItems - a.hasAdditionalProps = other.hasAdditionalProps - a.hasRef = other.hasRef - - a.IsKnownType = other.IsKnownType - a.IsSimpleSchema = other.IsSimpleSchema - a.IsArray = other.IsArray - a.IsSimpleArray = other.IsSimpleArray - a.IsMap = other.IsMap - a.IsSimpleMap = other.IsSimpleMap - a.IsExtendedObject = other.IsExtendedObject - a.IsTuple = other.IsTuple - a.IsTupleWithExtra = other.IsTupleWithExtra - a.IsBaseType = other.IsBaseType - a.IsEnum = other.IsEnum -} - -func (a *AnalyzedSchema) inferFromRef() error { - if a.hasRef { - sch := new(spec.Schema) - sch.Ref = a.schema.Ref - err := spec.ExpandSchema(sch, a.root, nil) - if err != nil { - return err - } - rsch, err := Schema(SchemaOpts{ - Schema: sch, - Root: a.root, - BasePath: a.basePath, - }) - if err != nil { - // NOTE(fredbi): currently the only cause for errors is - // unresolved ref. Since spec.ExpandSchema() expands the - // schema recursively, there is no chance to get there, - // until we add more causes for error in this schema analysis. - return err - } - a.inherits(rsch) - } - return nil -} - -func (a *AnalyzedSchema) inferSimpleSchema() { - a.IsSimpleSchema = a.IsKnownType || a.IsSimpleArray || a.IsSimpleMap -} - -func (a *AnalyzedSchema) inferKnownType() { - tpe := a.schema.Type - format := a.schema.Format - a.IsKnownType = tpe.Contains("boolean") || - tpe.Contains("integer") || - tpe.Contains("number") || - tpe.Contains("string") || - (format != "" && strfmt.Default.ContainsName(format)) || - (a.isObjectType() && !a.hasProps && !a.hasAllOf && !a.hasAdditionalProps && !a.hasAdditionalItems) -} - -func (a *AnalyzedSchema) inferMap() error { - if a.isObjectType() { - hasExtra := a.hasProps || a.hasAllOf - a.IsMap = a.hasAdditionalProps && !hasExtra - a.IsExtendedObject = a.hasAdditionalProps && hasExtra - if a.IsMap { - if a.schema.AdditionalProperties.Schema != nil { - msch, err := Schema(SchemaOpts{ - Schema: a.schema.AdditionalProperties.Schema, - Root: a.root, - BasePath: a.basePath, - }) - if err != nil { - return err - } - a.IsSimpleMap = msch.IsSimpleSchema - } else if a.schema.AdditionalProperties.Allows { - a.IsSimpleMap = true - } - } - } - return nil -} - -func (a *AnalyzedSchema) inferArray() error { - // an array has Items defined as an object schema, otherwise we qualify this JSON array as a tuple - // (yes, even if the Items array contains only one element). - // arrays in JSON schema may be unrestricted (i.e no Items specified). - // Note that arrays in Swagger MUST have Items. Nonetheless, we analyze unrestricted arrays. - // - // NOTE: the spec package misses the distinction between: - // items: [] and items: {}, so we consider both arrays here. - a.IsArray = a.isArrayType() && (a.schema.Items == nil || a.schema.Items.Schemas == nil) - if a.IsArray && a.hasItems { - if a.schema.Items.Schema != nil { - itsch, err := Schema(SchemaOpts{ - Schema: a.schema.Items.Schema, - Root: a.root, - BasePath: a.basePath, - }) - if err != nil { - return err - } - a.IsSimpleArray = itsch.IsSimpleSchema - } - } - if a.IsArray && !a.hasItems { - a.IsSimpleArray = true - } - return nil -} - -func (a *AnalyzedSchema) inferTuple() { - tuple := a.hasItems && a.schema.Items.Schemas != nil - a.IsTuple = tuple && !a.hasAdditionalItems - a.IsTupleWithExtra = tuple && a.hasAdditionalItems -} - -func (a *AnalyzedSchema) inferBaseType() { - if a.isObjectType() { - a.IsBaseType = a.schema.Discriminator != "" - } -} - -func (a *AnalyzedSchema) inferEnum() { - a.IsEnum = len(a.schema.Enum) > 0 -} - -func (a *AnalyzedSchema) initializeFlags() { - a.hasProps = len(a.schema.Properties) > 0 - a.hasAllOf = len(a.schema.AllOf) > 0 - a.hasRef = a.schema.Ref.String() != "" - - a.hasItems = a.schema.Items != nil && - (a.schema.Items.Schema != nil || len(a.schema.Items.Schemas) > 0) - - a.hasAdditionalProps = a.schema.AdditionalProperties != nil && - (a.schema.AdditionalProperties.Schema != nil || a.schema.AdditionalProperties.Allows) - - a.hasAdditionalItems = a.schema.AdditionalItems != nil && - (a.schema.AdditionalItems.Schema != nil || a.schema.AdditionalItems.Allows) - -} - -func (a *AnalyzedSchema) isObjectType() bool { - return !a.hasRef && (a.schema.Type == nil || a.schema.Type.Contains("") || a.schema.Type.Contains("object")) -} - -func (a *AnalyzedSchema) isArrayType() bool { - return !a.hasRef && (a.schema.Type != nil && a.schema.Type.Contains("array")) -} diff --git a/vendor/github.com/go-openapi/errors/.gitignore b/vendor/github.com/go-openapi/errors/.gitignore deleted file mode 100644 index dd91ed6..0000000 --- a/vendor/github.com/go-openapi/errors/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets.yml -coverage.out diff --git a/vendor/github.com/go-openapi/errors/.golangci.yml b/vendor/github.com/go-openapi/errors/.golangci.yml deleted file mode 100644 index ee3b326..0000000 --- a/vendor/github.com/go-openapi/errors/.golangci.yml +++ /dev/null @@ -1,43 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 30 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoglobals - - godox - - gocognit - - whitespace - - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - - testpackage - - gci - - gofumpt - - goerr113 - - gomnd - - tparallel - - nestif - - godot - - errorlint - - paralleltest - - tparallel diff --git a/vendor/github.com/go-openapi/errors/.travis.yml b/vendor/github.com/go-openapi/errors/.travis.yml deleted file mode 100644 index e4a01bf..0000000 --- a/vendor/github.com/go-openapi/errors/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -arch: - - amd64 -jobs: - include: - # only run fast tests on ppc64le - - go: 1.x - arch: ppc64le - script: - - gotestsum -f short-verbose -- ./... - - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: gZGp9NaHxi7zawlXJXKY92BGeDR1x0tbIcTyU5nMKLq0fhIaiEBJEeALwZ4VgqsSv3DytSSF5mLH8fevAM3ixE6hxjKQ+lQuf7V/w3btCN1CSWgoua5LOh1kTnqZQtJuRvO4pzoJcT3bJWBsVZ07VGNVzzJEy/zAKCHFqBUCXShw7QemlLBcYWFNqveTlvDIfCzvouoLnPoXwxEpkjxe9uz/ZKZgAnup/fXjC8RFctmgCnkCyvJTk0Y/fZCsufixJrJhshBWTnlrFCzRmgNkz2d+i1Ls3+MJ5EJJ2Tx/A5S63dL49J1f9Kr0AKHADmulSy8JNzIckKwbyFMYUecrsW+Lsu9DhnVMy1jj5pKsJDLRi2iIU3fXTMWbcyQbXjbbnBO2mPdP3Tzme75y4D9fc8hUPeyqVv2BU26NEbQ7EF2pKJ93OXvci7HlwRBgdJa8j6mP2LEDClcPQW00g7N/OZe0cTOMa8L5AwiBlbArwqt9wv6YLJoTG0wpDhzWsFvbCg5bJxe28Yn3fIDD0Lk1I7iSnBbp/5gzF19jmxqvcT8tHRkDL4xfjbENFTZjA5uB4Z4pj4WSyWQILLV/Jwhe3fi9uQwdviFHfj5pnVrmNUiGSOQL672K5wl2c3E9mGwejvsu2dfEz28n7Y/FUnOpY3/cBS0n27JJaerS0zMKNLE= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/errors/LICENSE b/vendor/github.com/go-openapi/errors/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/errors/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/errors/README.md b/vendor/github.com/go-openapi/errors/README.md deleted file mode 100644 index 4aac049..0000000 --- a/vendor/github.com/go-openapi/errors/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# OpenAPI errors - -[![Build Status](https://travis-ci.org/go-openapi/errors.svg?branch=master)](https://travis-ci.org/go-openapi/errors) -[![codecov](https://codecov.io/gh/go-openapi/errors/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/errors) -[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/errors/master/LICENSE) -[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/errors.svg)](https://pkg.go.dev/github.com/go-openapi/errors) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/errors.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/errors)](https://goreportcard.com/report/github.com/go-openapi/errors) - -Shared errors and error interface used throughout the various libraries found in the go-openapi toolkit. diff --git a/vendor/github.com/go-openapi/errors/api.go b/vendor/github.com/go-openapi/errors/api.go deleted file mode 100644 index 854d6ee..0000000 --- a/vendor/github.com/go-openapi/errors/api.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "encoding/json" - "fmt" - "net/http" - "reflect" - "strings" -) - -// DefaultHTTPCode is used when the error Code cannot be used as an HTTP code. -var DefaultHTTPCode = http.StatusUnprocessableEntity - -// Error represents a error interface all swagger framework errors implement -type Error interface { - error - Code() int32 -} - -type apiError struct { - code int32 - message string -} - -func (a *apiError) Error() string { - return a.message -} - -func (a *apiError) Code() int32 { - return a.code -} - -// MarshalJSON implements the JSON encoding interface -func (a apiError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ - "code": a.code, - "message": a.message, - }) -} - -// New creates a new API error with a code and a message -func New(code int32, message string, args ...interface{}) Error { - if len(args) > 0 { - return &apiError{code, fmt.Sprintf(message, args...)} - } - return &apiError{code, message} -} - -// NotFound creates a new not found error -func NotFound(message string, args ...interface{}) Error { - if message == "" { - message = "Not found" - } - return New(http.StatusNotFound, fmt.Sprintf(message, args...)) -} - -// NotImplemented creates a new not implemented error -func NotImplemented(message string) Error { - return New(http.StatusNotImplemented, message) -} - -// MethodNotAllowedError represents an error for when the path matches but the method doesn't -type MethodNotAllowedError struct { - code int32 - Allowed []string - message string -} - -func (m *MethodNotAllowedError) Error() string { - return m.message -} - -// Code the error code -func (m *MethodNotAllowedError) Code() int32 { - return m.code -} - -// MarshalJSON implements the JSON encoding interface -func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ - "code": m.code, - "message": m.message, - "allowed": m.Allowed, - }) -} - -func errorAsJSON(err Error) []byte { - b, _ := json.Marshal(struct { - Code int32 `json:"code"` - Message string `json:"message"` - }{err.Code(), err.Error()}) - return b -} - -func flattenComposite(errs *CompositeError) *CompositeError { - var res []error - for _, er := range errs.Errors { - switch e := er.(type) { - case *CompositeError: - if len(e.Errors) > 0 { - flat := flattenComposite(e) - if len(flat.Errors) > 0 { - res = append(res, flat.Errors...) - } - } - default: - if e != nil { - res = append(res, e) - } - } - } - return CompositeValidationError(res...) -} - -// MethodNotAllowed creates a new method not allowed error -func MethodNotAllowed(requested string, allow []string) Error { - msg := fmt.Sprintf("method %s is not allowed, but [%s] are", requested, strings.Join(allow, ",")) - return &MethodNotAllowedError{code: http.StatusMethodNotAllowed, Allowed: allow, message: msg} -} - -// ServeError the error handler interface implementation -func ServeError(rw http.ResponseWriter, r *http.Request, err error) { - rw.Header().Set("Content-Type", "application/json") - switch e := err.(type) { - case *CompositeError: - er := flattenComposite(e) - // strips composite errors to first element only - if len(er.Errors) > 0 { - ServeError(rw, r, er.Errors[0]) - } else { - // guard against empty CompositeError (invalid construct) - ServeError(rw, r, nil) - } - case *MethodNotAllowedError: - rw.Header().Add("Allow", strings.Join(err.(*MethodNotAllowedError).Allowed, ",")) - rw.WriteHeader(asHTTPCode(int(e.Code()))) - if r == nil || r.Method != http.MethodHead { - _, _ = rw.Write(errorAsJSON(e)) - } - case Error: - value := reflect.ValueOf(e) - if value.Kind() == reflect.Ptr && value.IsNil() { - rw.WriteHeader(http.StatusInternalServerError) - _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "Unknown error"))) - return - } - rw.WriteHeader(asHTTPCode(int(e.Code()))) - if r == nil || r.Method != http.MethodHead { - _, _ = rw.Write(errorAsJSON(e)) - } - case nil: - rw.WriteHeader(http.StatusInternalServerError) - _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "Unknown error"))) - default: - rw.WriteHeader(http.StatusInternalServerError) - if r == nil || r.Method != http.MethodHead { - _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, err.Error()))) - } - } -} - -func asHTTPCode(input int) int { - if input >= 600 { - return DefaultHTTPCode - } - return input -} diff --git a/vendor/github.com/go-openapi/errors/auth.go b/vendor/github.com/go-openapi/errors/auth.go deleted file mode 100644 index 0545b50..0000000 --- a/vendor/github.com/go-openapi/errors/auth.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import "net/http" - -// Unauthenticated returns an unauthenticated error -func Unauthenticated(scheme string) Error { - return New(http.StatusUnauthorized, "unauthenticated for %s", scheme) -} diff --git a/vendor/github.com/go-openapi/errors/doc.go b/vendor/github.com/go-openapi/errors/doc.go deleted file mode 100644 index 963d427..0000000 --- a/vendor/github.com/go-openapi/errors/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* - -Package errors provides an Error interface and several concrete types -implementing this interface to manage API errors and JSON-schema validation -errors. - -A middleware handler ServeError() is provided to serve the errors types -it defines. - -It is used throughout the various go-openapi toolkit libraries -(https://github.com/go-openapi). - -*/ -package errors diff --git a/vendor/github.com/go-openapi/errors/go.mod b/vendor/github.com/go-openapi/errors/go.mod deleted file mode 100644 index d7a9030..0000000 --- a/vendor/github.com/go-openapi/errors/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module github.com/go-openapi/errors - -go 1.14 - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/stretchr/testify v1.6.1 - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c // indirect -) diff --git a/vendor/github.com/go-openapi/errors/go.sum b/vendor/github.com/go-openapi/errors/go.sum deleted file mode 100644 index ecd91c7..0000000 --- a/vendor/github.com/go-openapi/errors/go.sum +++ /dev/null @@ -1,26 +0,0 @@ -github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/go-openapi/errors/headers.go b/vendor/github.com/go-openapi/errors/headers.go deleted file mode 100644 index f7b8bf1..0000000 --- a/vendor/github.com/go-openapi/errors/headers.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// Validation represents a failure of a precondition -type Validation struct { - code int32 - Name string - In string - Value interface{} - message string - Values []interface{} -} - -func (e *Validation) Error() string { - return e.message -} - -// Code the error code -func (e *Validation) Code() int32 { - return e.code -} - -// MarshalJSON implements the JSON encoding interface -func (e Validation) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ - "code": e.code, - "message": e.message, - "in": e.In, - "name": e.Name, - "value": e.Value, - "values": e.Values, - }) -} - -// ValidateName produces an error message name for an aliased property -func (e *Validation) ValidateName(name string) *Validation { - if e.Name == "" && name != "" { - e.Name = name - e.message = name + e.message - } - return e -} - -const ( - contentTypeFail = `unsupported media type %q, only %v are allowed` - responseFormatFail = `unsupported media type requested, only %v are available` -) - -// InvalidContentType error for an invalid content type -func InvalidContentType(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) - for _, v := range allowed { - values = append(values, v) - } - return &Validation{ - code: http.StatusUnsupportedMediaType, - Name: "Content-Type", - In: "header", - Value: value, - Values: values, - message: fmt.Sprintf(contentTypeFail, value, allowed), - } -} - -// InvalidResponseFormat error for an unacceptable response format request -func InvalidResponseFormat(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) - for _, v := range allowed { - values = append(values, v) - } - return &Validation{ - code: http.StatusNotAcceptable, - Name: "Accept", - In: "header", - Value: value, - Values: values, - message: fmt.Sprintf(responseFormatFail, allowed), - } -} diff --git a/vendor/github.com/go-openapi/errors/middleware.go b/vendor/github.com/go-openapi/errors/middleware.go deleted file mode 100644 index c26ad48..0000000 --- a/vendor/github.com/go-openapi/errors/middleware.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "bytes" - "fmt" - "strings" -) - -// APIVerificationFailed is an error that contains all the missing info for a mismatched section -// between the api registrations and the api spec -type APIVerificationFailed struct { - Section string `json:"section,omitempty"` - MissingSpecification []string `json:"missingSpecification,omitempty"` - MissingRegistration []string `json:"missingRegistration,omitempty"` -} - -// -func (v *APIVerificationFailed) Error() string { - buf := bytes.NewBuffer(nil) - - hasRegMissing := len(v.MissingRegistration) > 0 - hasSpecMissing := len(v.MissingSpecification) > 0 - - if hasRegMissing { - buf.WriteString(fmt.Sprintf("missing [%s] %s registrations", strings.Join(v.MissingRegistration, ", "), v.Section)) - } - - if hasRegMissing && hasSpecMissing { - buf.WriteString("\n") - } - - if hasSpecMissing { - buf.WriteString(fmt.Sprintf("missing from spec file [%s] %s", strings.Join(v.MissingSpecification, ", "), v.Section)) - } - - return buf.String() -} diff --git a/vendor/github.com/go-openapi/errors/parsing.go b/vendor/github.com/go-openapi/errors/parsing.go deleted file mode 100644 index 5096e1e..0000000 --- a/vendor/github.com/go-openapi/errors/parsing.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "encoding/json" - "fmt" -) - -// ParseError represents a parsing error -type ParseError struct { - code int32 - Name string - In string - Value string - Reason error - message string -} - -func (e *ParseError) Error() string { - return e.message -} - -// Code returns the http status code for this error -func (e *ParseError) Code() int32 { - return e.code -} - -// MarshalJSON implements the JSON encoding interface -func (e ParseError) MarshalJSON() ([]byte, error) { - var reason string - if e.Reason != nil { - reason = e.Reason.Error() - } - return json.Marshal(map[string]interface{}{ - "code": e.code, - "message": e.message, - "in": e.In, - "name": e.Name, - "value": e.Value, - "reason": reason, - }) -} - -const ( - parseErrorTemplContent = `parsing %s %s from %q failed, because %s` - parseErrorTemplContentNoIn = `parsing %s from %q failed, because %s` -) - -// NewParseError creates a new parse error -func NewParseError(name, in, value string, reason error) *ParseError { - var msg string - if in == "" { - msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason) - } else { - msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason) - } - return &ParseError{ - code: 400, - Name: name, - In: in, - Value: value, - Reason: reason, - message: msg, - } -} diff --git a/vendor/github.com/go-openapi/errors/schema.go b/vendor/github.com/go-openapi/errors/schema.go deleted file mode 100644 index bf335cb..0000000 --- a/vendor/github.com/go-openapi/errors/schema.go +++ /dev/null @@ -1,598 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "encoding/json" - "fmt" - "strings" -) - -const ( - invalidType = "%s is an invalid type name" - typeFail = "%s in %s must be of type %s" - typeFailWithData = "%s in %s must be of type %s: %q" - typeFailWithError = "%s in %s must be of type %s, because: %s" - requiredFail = "%s in %s is required" - readOnlyFail = "%s in %s is readOnly" - tooLongMessage = "%s in %s should be at most %d chars long" - tooShortMessage = "%s in %s should be at least %d chars long" - patternFail = "%s in %s should match '%s'" - enumFail = "%s in %s should be one of %v" - multipleOfFail = "%s in %s should be a multiple of %v" - maxIncFail = "%s in %s should be less than or equal to %v" - maxExcFail = "%s in %s should be less than %v" - minIncFail = "%s in %s should be greater than or equal to %v" - minExcFail = "%s in %s should be greater than %v" - uniqueFail = "%s in %s shouldn't contain duplicates" - maxItemsFail = "%s in %s should have at most %d items" - minItemsFail = "%s in %s should have at least %d items" - typeFailNoIn = "%s must be of type %s" - typeFailWithDataNoIn = "%s must be of type %s: %q" - typeFailWithErrorNoIn = "%s must be of type %s, because: %s" - requiredFailNoIn = "%s is required" - readOnlyFailNoIn = "%s is readOnly" - tooLongMessageNoIn = "%s should be at most %d chars long" - tooShortMessageNoIn = "%s should be at least %d chars long" - patternFailNoIn = "%s should match '%s'" - enumFailNoIn = "%s should be one of %v" - multipleOfFailNoIn = "%s should be a multiple of %v" - maxIncFailNoIn = "%s should be less than or equal to %v" - maxExcFailNoIn = "%s should be less than %v" - minIncFailNoIn = "%s should be greater than or equal to %v" - minExcFailNoIn = "%s should be greater than %v" - uniqueFailNoIn = "%s shouldn't contain duplicates" - maxItemsFailNoIn = "%s should have at most %d items" - minItemsFailNoIn = "%s should have at least %d items" - noAdditionalItems = "%s in %s can't have additional items" - noAdditionalItemsNoIn = "%s can't have additional items" - tooFewProperties = "%s in %s should have at least %d properties" - tooFewPropertiesNoIn = "%s should have at least %d properties" - tooManyProperties = "%s in %s should have at most %d properties" - tooManyPropertiesNoIn = "%s should have at most %d properties" - unallowedProperty = "%s.%s in %s is a forbidden property" - unallowedPropertyNoIn = "%s.%s is a forbidden property" - failedAllPatternProps = "%s.%s in %s failed all pattern properties" - failedAllPatternPropsNoIn = "%s.%s failed all pattern properties" - multipleOfMustBePositive = "factor MultipleOf declared for %s must be positive: %v" -) - -// All code responses can be used to differentiate errors for different handling -// by the consuming program -const ( - // CompositeErrorCode remains 422 for backwards-compatibility - // and to separate it from validation errors with cause - CompositeErrorCode = 422 - // InvalidTypeCode is used for any subclass of invalid types - InvalidTypeCode = 600 + iota - RequiredFailCode - TooLongFailCode - TooShortFailCode - PatternFailCode - EnumFailCode - MultipleOfFailCode - MaxFailCode - MinFailCode - UniqueFailCode - MaxItemsFailCode - MinItemsFailCode - NoAdditionalItemsCode - TooFewPropertiesCode - TooManyPropertiesCode - UnallowedPropertyCode - FailedAllPatternPropsCode - MultipleOfMustBePositiveCode - ReadOnlyFailCode -) - -// CompositeError is an error that groups several errors together -type CompositeError struct { - Errors []error - code int32 - message string -} - -// Code for this error -func (c *CompositeError) Code() int32 { - return c.code -} - -func (c *CompositeError) Error() string { - if len(c.Errors) > 0 { - msgs := []string{c.message + ":"} - for _, e := range c.Errors { - msgs = append(msgs, e.Error()) - } - return strings.Join(msgs, "\n") - } - return c.message -} - -// MarshalJSON implements the JSON encoding interface -func (c CompositeError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ - "code": c.code, - "message": c.message, - "errors": c.Errors, - }) -} - -// CompositeValidationError an error to wrap a bunch of other errors -func CompositeValidationError(errors ...error) *CompositeError { - return &CompositeError{ - code: CompositeErrorCode, - Errors: append([]error{}, errors...), - message: "validation failure list", - } -} - -// FailedAllPatternProperties an error for when the property doesn't match a pattern -func FailedAllPatternProperties(name, in, key string) *Validation { - msg := fmt.Sprintf(failedAllPatternProps, name, key, in) - if in == "" { - msg = fmt.Sprintf(failedAllPatternPropsNoIn, name, key) - } - return &Validation{ - code: FailedAllPatternPropsCode, - Name: name, - In: in, - Value: key, - message: msg, - } -} - -// PropertyNotAllowed an error for when the property doesn't match a pattern -func PropertyNotAllowed(name, in, key string) *Validation { - msg := fmt.Sprintf(unallowedProperty, name, key, in) - if in == "" { - msg = fmt.Sprintf(unallowedPropertyNoIn, name, key) - } - return &Validation{ - code: UnallowedPropertyCode, - Name: name, - In: in, - Value: key, - message: msg, - } -} - -// TooFewProperties an error for an object with too few properties -func TooFewProperties(name, in string, n int64) *Validation { - msg := fmt.Sprintf(tooFewProperties, name, in, n) - if in == "" { - msg = fmt.Sprintf(tooFewPropertiesNoIn, name, n) - } - return &Validation{ - code: TooFewPropertiesCode, - Name: name, - In: in, - Value: n, - message: msg, - } -} - -// TooManyProperties an error for an object with too many properties -func TooManyProperties(name, in string, n int64) *Validation { - msg := fmt.Sprintf(tooManyProperties, name, in, n) - if in == "" { - msg = fmt.Sprintf(tooManyPropertiesNoIn, name, n) - } - return &Validation{ - code: TooManyPropertiesCode, - Name: name, - In: in, - Value: n, - message: msg, - } -} - -// AdditionalItemsNotAllowed an error for invalid additional items -func AdditionalItemsNotAllowed(name, in string) *Validation { - msg := fmt.Sprintf(noAdditionalItems, name, in) - if in == "" { - msg = fmt.Sprintf(noAdditionalItemsNoIn, name) - } - return &Validation{ - code: NoAdditionalItemsCode, - Name: name, - In: in, - message: msg, - } -} - -// InvalidCollectionFormat another flavor of invalid type error -func InvalidCollectionFormat(name, in, format string) *Validation { - return &Validation{ - code: InvalidTypeCode, - Name: name, - In: in, - Value: format, - message: fmt.Sprintf("the collection format %q is not supported for the %s param %q", format, in, name), - } -} - -// InvalidTypeName an error for when the type is invalid -func InvalidTypeName(typeName string) *Validation { - return &Validation{ - code: InvalidTypeCode, - Value: typeName, - message: fmt.Sprintf(invalidType, typeName), - } -} - -// InvalidType creates an error for when the type is invalid -func InvalidType(name, in, typeName string, value interface{}) *Validation { - var message string - - if in != "" { - switch value.(type) { - case string: - message = fmt.Sprintf(typeFailWithData, name, in, typeName, value) - case error: - message = fmt.Sprintf(typeFailWithError, name, in, typeName, value) - default: - message = fmt.Sprintf(typeFail, name, in, typeName) - } - } else { - switch value.(type) { - case string: - message = fmt.Sprintf(typeFailWithDataNoIn, name, typeName, value) - case error: - message = fmt.Sprintf(typeFailWithErrorNoIn, name, typeName, value) - default: - message = fmt.Sprintf(typeFailNoIn, name, typeName) - } - } - - return &Validation{ - code: InvalidTypeCode, - Name: name, - In: in, - Value: value, - message: message, - } - -} - -// DuplicateItems error for when an array contains duplicates -func DuplicateItems(name, in string) *Validation { - msg := fmt.Sprintf(uniqueFail, name, in) - if in == "" { - msg = fmt.Sprintf(uniqueFailNoIn, name) - } - return &Validation{ - code: UniqueFailCode, - Name: name, - In: in, - message: msg, - } -} - -// TooManyItems error for when an array contains too many items -func TooManyItems(name, in string, max int64, value interface{}) *Validation { - msg := fmt.Sprintf(maxItemsFail, name, in, max) - if in == "" { - msg = fmt.Sprintf(maxItemsFailNoIn, name, max) - } - - return &Validation{ - code: MaxItemsFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// TooFewItems error for when an array contains too few items -func TooFewItems(name, in string, min int64, value interface{}) *Validation { - msg := fmt.Sprintf(minItemsFail, name, in, min) - if in == "" { - msg = fmt.Sprintf(minItemsFailNoIn, name, min) - } - return &Validation{ - code: MinItemsFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// ExceedsMaximumInt error for when maximum validation fails -func ExceedsMaximumInt(name, in string, max int64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := maxIncFailNoIn - if exclusive { - m = maxExcFailNoIn - } - message = fmt.Sprintf(m, name, max) - } else { - m := maxIncFail - if exclusive { - m = maxExcFail - } - message = fmt.Sprintf(m, name, in, max) - } - return &Validation{ - code: MaxFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMaximumUint error for when maximum validation fails -func ExceedsMaximumUint(name, in string, max uint64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := maxIncFailNoIn - if exclusive { - m = maxExcFailNoIn - } - message = fmt.Sprintf(m, name, max) - } else { - m := maxIncFail - if exclusive { - m = maxExcFail - } - message = fmt.Sprintf(m, name, in, max) - } - return &Validation{ - code: MaxFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMaximum error for when maximum validation fails -func ExceedsMaximum(name, in string, max float64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := maxIncFailNoIn - if exclusive { - m = maxExcFailNoIn - } - message = fmt.Sprintf(m, name, max) - } else { - m := maxIncFail - if exclusive { - m = maxExcFail - } - message = fmt.Sprintf(m, name, in, max) - } - return &Validation{ - code: MaxFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMinimumInt error for when minimum validation fails -func ExceedsMinimumInt(name, in string, min int64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := minIncFailNoIn - if exclusive { - m = minExcFailNoIn - } - message = fmt.Sprintf(m, name, min) - } else { - m := minIncFail - if exclusive { - m = minExcFail - } - message = fmt.Sprintf(m, name, in, min) - } - return &Validation{ - code: MinFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMinimumUint error for when minimum validation fails -func ExceedsMinimumUint(name, in string, min uint64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := minIncFailNoIn - if exclusive { - m = minExcFailNoIn - } - message = fmt.Sprintf(m, name, min) - } else { - m := minIncFail - if exclusive { - m = minExcFail - } - message = fmt.Sprintf(m, name, in, min) - } - return &Validation{ - code: MinFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMinimum error for when minimum validation fails -func ExceedsMinimum(name, in string, min float64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := minIncFailNoIn - if exclusive { - m = minExcFailNoIn - } - message = fmt.Sprintf(m, name, min) - } else { - m := minIncFail - if exclusive { - m = minExcFail - } - message = fmt.Sprintf(m, name, in, min) - } - return &Validation{ - code: MinFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// NotMultipleOf error for when multiple of validation fails -func NotMultipleOf(name, in string, multiple, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(multipleOfFailNoIn, name, multiple) - } else { - msg = fmt.Sprintf(multipleOfFail, name, in, multiple) - } - return &Validation{ - code: MultipleOfFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// EnumFail error for when an enum validation fails -func EnumFail(name, in string, value interface{}, values []interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(enumFailNoIn, name, values) - } else { - msg = fmt.Sprintf(enumFail, name, in, values) - } - - return &Validation{ - code: EnumFailCode, - Name: name, - In: in, - Value: value, - Values: values, - message: msg, - } -} - -// Required error for when a value is missing -func Required(name, in string, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(requiredFailNoIn, name) - } else { - msg = fmt.Sprintf(requiredFail, name, in) - } - return &Validation{ - code: RequiredFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// ReadOnly error for when a value is present in request -func ReadOnly(name, in string, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(readOnlyFailNoIn, name) - } else { - msg = fmt.Sprintf(readOnlyFail, name, in) - } - return &Validation{ - code: ReadOnlyFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// TooLong error for when a string is too long -func TooLong(name, in string, max int64, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(tooLongMessageNoIn, name, max) - } else { - msg = fmt.Sprintf(tooLongMessage, name, in, max) - } - return &Validation{ - code: TooLongFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// TooShort error for when a string is too short -func TooShort(name, in string, min int64, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(tooShortMessageNoIn, name, min) - } else { - msg = fmt.Sprintf(tooShortMessage, name, in, min) - } - - return &Validation{ - code: TooShortFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// FailedPattern error for when a string fails a regex pattern match -// the pattern that is returned is the ECMA syntax version of the pattern not the golang version. -func FailedPattern(name, in, pattern string, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(patternFailNoIn, name, pattern) - } else { - msg = fmt.Sprintf(patternFail, name, in, pattern) - } - - return &Validation{ - code: PatternFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// MultipleOfMustBePositive error for when a -// multipleOf factor is negative -func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation { - return &Validation{ - code: MultipleOfMustBePositiveCode, - Name: name, - In: in, - Value: factor, - message: fmt.Sprintf(multipleOfMustBePositive, name, factor), - } -} diff --git a/vendor/github.com/go-openapi/jsonpointer/.editorconfig b/vendor/github.com/go-openapi/jsonpointer/.editorconfig deleted file mode 100644 index 3152da6..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/jsonpointer/.gitignore b/vendor/github.com/go-openapi/jsonpointer/.gitignore deleted file mode 100644 index 769c244..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.yml diff --git a/vendor/github.com/go-openapi/jsonpointer/.travis.yml b/vendor/github.com/go-openapi/jsonpointer/.travis.yml deleted file mode 100644 index 03a22fe..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.15.x -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -env: -- GO111MODULE=on -language: go -notifications: - slack: - secure: a5VgoiwB1G/AZqzmephPZIhEB9avMlsWSlVnM1dSAtYAwdrQHGTQxAmpOxYIoSPDhWNN5bfZmjd29++UlTwLcHSR+e0kJhH6IfDlsHj/HplNCJ9tyI0zYc7XchtdKgeMxMzBKCzgwFXGSbQGydXTliDNBo0HOzmY3cou/daMFTP60K+offcjS+3LRAYb1EroSRXZqrk1nuF/xDL3792DZUdPMiFR/L/Df6y74D6/QP4sTkTDFQitz4Wy/7jbsfj8dG6qK2zivgV6/l+w4OVjFkxVpPXogDWY10vVXNVynqxfJ7to2d1I9lNCHE2ilBCkWMIPdyJF7hjF8pKW+82yP4EzRh0vu8Xn0HT5MZpQxdRY/YMxNrWaG7SxsoEaO4q5uhgdzAqLYY3TRa7MjIK+7Ur+aqOeTXn6OKwVi0CjvZ6mIU3WUKSwiwkFZMbjRAkSb5CYwMEfGFO/z964xz83qGt6WAtBXNotqCQpTIiKtDHQeLOMfksHImCg6JLhQcWBVxamVgu0G3Pdh8Y6DyPnxraXY95+QDavbjqv7TeYT9T/FNnrkXaTTK0s4iWE5H4ACU0Qvz0wUYgfQrZv0/Hp7V17+rabUwnzYySHCy9SWX/7OV9Cfh31iMp9ZIffr76xmmThtOEqs8TrTtU6BWI3rWwvA9cXQipZTVtL0oswrGw= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/jsonpointer/LICENSE b/vendor/github.com/go-openapi/jsonpointer/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md deleted file mode 100644 index 813788a..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# gojsonpointer [![Build Status](https://travis-ci.org/go-openapi/jsonpointer.svg?branch=master)](https://travis-ci.org/go-openapi/jsonpointer) [![codecov](https://codecov.io/gh/go-openapi/jsonpointer/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonpointer) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonpointer?status.svg)](http://godoc.org/github.com/go-openapi/jsonpointer) -An implementation of JSON Pointer - Go language - -## Status -Completed YES - -Tested YES - -## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 - -### Note -The 4.Evaluation part of the previous reference, starting with 'If the currently referenced value is a JSON array, the reference token MUST contain either...' is not implemented. diff --git a/vendor/github.com/go-openapi/jsonpointer/go.mod b/vendor/github.com/go-openapi/jsonpointer/go.mod deleted file mode 100644 index 3e45e22..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/go-openapi/jsonpointer - -require ( - github.com/go-openapi/swag v0.19.5 - github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect - github.com/stretchr/testify v1.3.0 -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/jsonpointer/go.sum b/vendor/github.com/go-openapi/jsonpointer/go.sum deleted file mode 100644 index 953d4f3..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/go.sum +++ /dev/null @@ -1,24 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go deleted file mode 100644 index 7df9853..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonpointer -// repository-desc An implementation of JSON Pointer - Go language -// -// description Main and unique file. -// -// created 25-02-2013 - -package jsonpointer - -import ( - "errors" - "fmt" - "reflect" - "strconv" - "strings" - - "github.com/go-openapi/swag" -) - -const ( - emptyPointer = `` - pointerSeparator = `/` - - invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator -) - -var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem() -var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem() - -// JSONPointable is an interface for structs to implement when they need to customize the -// json pointer process -type JSONPointable interface { - JSONLookup(string) (interface{}, error) -} - -// JSONSetable is an interface for structs to implement when they need to customize the -// json pointer process -type JSONSetable interface { - JSONSet(string, interface{}) error -} - -// New creates a new json pointer for the given string -func New(jsonPointerString string) (Pointer, error) { - - var p Pointer - err := p.parse(jsonPointerString) - return p, err - -} - -// Pointer the json pointer reprsentation -type Pointer struct { - referenceTokens []string -} - -// "Constructor", parses the given string JSON pointer -func (p *Pointer) parse(jsonPointerString string) error { - - var err error - - if jsonPointerString != emptyPointer { - if !strings.HasPrefix(jsonPointerString, pointerSeparator) { - err = errors.New(invalidStart) - } else { - referenceTokens := strings.Split(jsonPointerString, pointerSeparator) - for _, referenceToken := range referenceTokens[1:] { - p.referenceTokens = append(p.referenceTokens, referenceToken) - } - } - } - - return err -} - -// Get uses the pointer to retrieve a value from a JSON document -func (p *Pointer) Get(document interface{}) (interface{}, reflect.Kind, error) { - return p.get(document, swag.DefaultJSONNameProvider) -} - -// Set uses the pointer to set a value from a JSON document -func (p *Pointer) Set(document interface{}, value interface{}) (interface{}, error) { - return document, p.set(document, value, swag.DefaultJSONNameProvider) -} - -// GetForToken gets a value for a json pointer token 1 level deep -func GetForToken(document interface{}, decodedToken string) (interface{}, reflect.Kind, error) { - return getSingleImpl(document, decodedToken, swag.DefaultJSONNameProvider) -} - -// SetForToken gets a value for a json pointer token 1 level deep -func SetForToken(document interface{}, decodedToken string, value interface{}) (interface{}, error) { - return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider) -} - -func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) { - rValue := reflect.Indirect(reflect.ValueOf(node)) - kind := rValue.Kind() - - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return nil, kind, err - } - return r, kind, nil - } - - switch kind { - case reflect.Struct: - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return nil, kind, fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - return fld.Interface(), kind, nil - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - mv := rValue.MapIndex(kv) - - if mv.IsValid() { - return mv.Interface(), kind, nil - } - return nil, kind, fmt.Errorf("object has no key %q", decodedToken) - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return nil, kind, err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - return elem.Interface(), kind, nil - - default: - return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken) - } - -} - -func setSingleImpl(node, data interface{}, decodedToken string, nameProvider *swag.NameProvider) error { - rValue := reflect.Indirect(reflect.ValueOf(node)) - - if ns, ok := node.(JSONSetable); ok { // pointer impl - return ns.JSONSet(decodedToken, data) - } - - if rValue.Type().Implements(jsonSetableType) { - return node.(JSONSetable).JSONSet(decodedToken, data) - } - - switch rValue.Kind() { - case reflect.Struct: - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - if fld.IsValid() { - fld.Set(reflect.ValueOf(data)) - } - return nil - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - rValue.SetMapIndex(kv, reflect.ValueOf(data)) - return nil - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - if !elem.CanSet() { - return fmt.Errorf("can't set slice index %s to %v", decodedToken, data) - } - elem.Set(reflect.ValueOf(data)) - return nil - - default: - return fmt.Errorf("invalid token reference %q", decodedToken) - } - -} - -func (p *Pointer) get(node interface{}, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) { - - if nameProvider == nil { - nameProvider = swag.DefaultJSONNameProvider - } - - kind := reflect.Invalid - - // Full document when empty - if len(p.referenceTokens) == 0 { - return node, kind, nil - } - - for _, token := range p.referenceTokens { - - decodedToken := Unescape(token) - - r, knd, err := getSingleImpl(node, decodedToken, nameProvider) - if err != nil { - return nil, knd, err - } - node, kind = r, knd - - } - - rValue := reflect.ValueOf(node) - kind = rValue.Kind() - - return node, kind, nil -} - -func (p *Pointer) set(node, data interface{}, nameProvider *swag.NameProvider) error { - knd := reflect.ValueOf(node).Kind() - - if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array { - return fmt.Errorf("only structs, pointers, maps and slices are supported for setting values") - } - - if nameProvider == nil { - nameProvider = swag.DefaultJSONNameProvider - } - - // Full document when empty - if len(p.referenceTokens) == 0 { - return nil - } - - lastI := len(p.referenceTokens) - 1 - for i, token := range p.referenceTokens { - isLastToken := i == lastI - decodedToken := Unescape(token) - - if isLastToken { - - return setSingleImpl(node, data, decodedToken, nameProvider) - } - - rValue := reflect.Indirect(reflect.ValueOf(node)) - kind := rValue.Kind() - - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return err - } - fld := reflect.ValueOf(r) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = r - continue - } - - switch kind { - case reflect.Struct: - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = fld.Interface() - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - mv := rValue.MapIndex(kv) - - if !mv.IsValid() { - return fmt.Errorf("object has no key %q", decodedToken) - } - if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr { - node = mv.Addr().Interface() - continue - } - node = mv.Interface() - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - if elem.CanAddr() && elem.Kind() != reflect.Interface && elem.Kind() != reflect.Map && elem.Kind() != reflect.Slice && elem.Kind() != reflect.Ptr { - node = elem.Addr().Interface() - continue - } - node = elem.Interface() - - default: - return fmt.Errorf("invalid token reference %q", decodedToken) - } - - } - - return nil -} - -// DecodedTokens returns the decoded tokens -func (p *Pointer) DecodedTokens() []string { - result := make([]string, 0, len(p.referenceTokens)) - for _, t := range p.referenceTokens { - result = append(result, Unescape(t)) - } - return result -} - -// IsEmpty returns true if this is an empty json pointer -// this indicates that it points to the root document -func (p *Pointer) IsEmpty() bool { - return len(p.referenceTokens) == 0 -} - -// Pointer to string representation function -func (p *Pointer) String() string { - - if len(p.referenceTokens) == 0 { - return emptyPointer - } - - pointerString := pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator) - - return pointerString -} - -// Specific JSON pointer encoding here -// ~0 => ~ -// ~1 => / -// ... and vice versa - -const ( - encRefTok0 = `~0` - encRefTok1 = `~1` - decRefTok0 = `~` - decRefTok1 = `/` -) - -// Unescape unescapes a json pointer reference token string to the original representation -func Unescape(token string) string { - step1 := strings.Replace(token, encRefTok1, decRefTok1, -1) - step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1) - return step2 -} - -// Escape escapes a pointer reference token string -func Escape(token string) string { - step1 := strings.Replace(token, decRefTok0, encRefTok0, -1) - step2 := strings.Replace(step1, decRefTok1, encRefTok1, -1) - return step2 -} diff --git a/vendor/github.com/go-openapi/jsonreference/.gitignore b/vendor/github.com/go-openapi/jsonreference/.gitignore deleted file mode 100644 index 769c244..0000000 --- a/vendor/github.com/go-openapi/jsonreference/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.yml diff --git a/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/vendor/github.com/go-openapi/jsonreference/.golangci.yml deleted file mode 100644 index f9381ae..0000000 --- a/vendor/github.com/go-openapi/jsonreference/.golangci.yml +++ /dev/null @@ -1,41 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 30 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoglobals - - godox - - gocognit - - whitespace - - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - - testpackage - - gci - - gofumpt - - goerr113 - - gomnd - - tparallel - - nestif - - godot - - errorlint diff --git a/vendor/github.com/go-openapi/jsonreference/.travis.yml b/vendor/github.com/go-openapi/jsonreference/.travis.yml deleted file mode 100644 index 05482f4..0000000 --- a/vendor/github.com/go-openapi/jsonreference/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -install: -- go get gotest.tools/gotestsum -jobs: - include: - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -env: -- GO111MODULE=on -language: go -notifications: - slack: - secure: OpQG/36F7DSF00HLm9WZMhyqFCYYyYTsVDObW226cWiR8PWYiNfLZiSEvIzT1Gx4dDjhigKTIqcLhG34CkL5iNXDjm9Yyo2RYhQPlK8NErNqUEXuBqn4RqYHW48VGhEhOyDd4Ei0E2FN5ZbgpvHgtpkdZ6XDi64r3Ac89isP9aPHXQTuv2Jog6b4/OKKiUTftLcTIst0p4Cp3gqOJWf1wnoj+IadWiECNVQT6zb47IYjtyw6+uV8iUjTzdKcRB6Zc6b4Dq7JAg1Zd7Jfxkql3hlKp4PNlRf9Cy7y5iA3G7MLyg3FcPX5z2kmcyPt2jOTRMBWUJ5zIQpOxizAcN8WsT3WWBL5KbuYK6k0PzujrIDLqdxGpNmjkkMfDBT9cKmZpm2FdW+oZgPFJP+oKmAo4u4KJz/vjiPTXgQlN5bmrLuRMCp+AwC5wkIohTqWZVPE2TK6ZSnMYcg/W39s+RP/9mJoyryAvPSpBOLTI+biCgaUCTOAZxNTWpMFc3tPYntc41WWkdKcooZ9JA5DwfcaVFyTGQ3YXz+HvX6G1z/gW0Q/A4dBi9mj2iE1xm7tRTT+4VQ2AXFvSEI1HJpfPgYnwAtwOD1v3Qm2EUHk9sCdtEDR4wVGEPIVn44GnwFMnGKx9JWppMPYwFu3SVDdHt+E+LOlhZUply11Aa+IVrT2KUQ= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/jsonreference/LICENSE b/vendor/github.com/go-openapi/jsonreference/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/jsonreference/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md deleted file mode 100644 index b94753a..0000000 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# gojsonreference [![Build Status](https://travis-ci.org/go-openapi/jsonreference.svg?branch=master)](https://travis-ci.org/go-openapi/jsonreference) [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonreference?status.svg)](http://godoc.org/github.com/go-openapi/jsonreference) -An implementation of JSON Reference - Go language - -## Status -Feature complete. Stable API - -## Dependencies -https://github.com/go-openapi/jsonpointer - -## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 - -http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 diff --git a/vendor/github.com/go-openapi/jsonreference/go.mod b/vendor/github.com/go-openapi/jsonreference/go.mod deleted file mode 100644 index e6c2ec4..0000000 --- a/vendor/github.com/go-openapi/jsonreference/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module github.com/go-openapi/jsonreference - -require ( - github.com/PuerkitoBio/purell v1.1.1 - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/go-openapi/jsonpointer v0.19.3 - github.com/stretchr/testify v1.3.0 - golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect - golang.org/x/text v0.3.3 // indirect -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/jsonreference/go.sum b/vendor/github.com/go-openapi/jsonreference/go.sum deleted file mode 100644 index b37f873..0000000 --- a/vendor/github.com/go-openapi/jsonreference/go.sum +++ /dev/null @@ -1,38 +0,0 @@ -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/jsonreference/reference.go b/vendor/github.com/go-openapi/jsonreference/reference.go deleted file mode 100644 index 3bc0a6e..0000000 --- a/vendor/github.com/go-openapi/jsonreference/reference.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonreference -// repository-desc An implementation of JSON Reference - Go language -// -// description Main and unique file. -// -// created 26-02-2013 - -package jsonreference - -import ( - "errors" - "net/url" - "strings" - - "github.com/PuerkitoBio/purell" - "github.com/go-openapi/jsonpointer" -) - -const ( - fragmentRune = `#` -) - -// New creates a new reference for the given string -func New(jsonReferenceString string) (Ref, error) { - - var r Ref - err := r.parse(jsonReferenceString) - return r, err - -} - -// MustCreateRef parses the ref string and panics when it's invalid. -// Use the New method for a version that returns an error -func MustCreateRef(ref string) Ref { - r, err := New(ref) - if err != nil { - panic(err) - } - return r -} - -// Ref represents a json reference object -type Ref struct { - referenceURL *url.URL - referencePointer jsonpointer.Pointer - - HasFullURL bool - HasURLPathOnly bool - HasFragmentOnly bool - HasFileScheme bool - HasFullFilePath bool -} - -// GetURL gets the URL for this reference -func (r *Ref) GetURL() *url.URL { - return r.referenceURL -} - -// GetPointer gets the json pointer for this reference -func (r *Ref) GetPointer() *jsonpointer.Pointer { - return &r.referencePointer -} - -// String returns the best version of the url for this reference -func (r *Ref) String() string { - - if r.referenceURL != nil { - return r.referenceURL.String() - } - - if r.HasFragmentOnly { - return fragmentRune + r.referencePointer.String() - } - - return r.referencePointer.String() -} - -// IsRoot returns true if this reference is a root document -func (r *Ref) IsRoot() bool { - return r.referenceURL != nil && - !r.IsCanonical() && - !r.HasURLPathOnly && - r.referenceURL.Fragment == "" -} - -// IsCanonical returns true when this pointer starts with http(s):// or file:// -func (r *Ref) IsCanonical() bool { - return (r.HasFileScheme && r.HasFullFilePath) || (!r.HasFileScheme && r.HasFullURL) -} - -// "Constructor", parses the given string JSON reference -func (r *Ref) parse(jsonReferenceString string) error { - - parsed, err := url.Parse(jsonReferenceString) - if err != nil { - return err - } - - r.referenceURL, _ = url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) - refURL := r.referenceURL - - if refURL.Scheme != "" && refURL.Host != "" { - r.HasFullURL = true - } else { - if refURL.Path != "" { - r.HasURLPathOnly = true - } else if refURL.RawQuery == "" && refURL.Fragment != "" { - r.HasFragmentOnly = true - } - } - - r.HasFileScheme = refURL.Scheme == "file" - r.HasFullFilePath = strings.HasPrefix(refURL.Path, "/") - - // invalid json-pointer error means url has no json-pointer fragment. simply ignore error - r.referencePointer, _ = jsonpointer.New(refURL.Fragment) - - return nil -} - -// Inherits creates a new reference from a parent and a child -// If the child cannot inherit from the parent, an error is returned -func (r *Ref) Inherits(child Ref) (*Ref, error) { - childURL := child.GetURL() - parentURL := r.GetURL() - if childURL == nil { - return nil, errors.New("child url is nil") - } - if parentURL == nil { - return &child, nil - } - - ref, err := New(parentURL.ResolveReference(childURL).String()) - if err != nil { - return nil, err - } - return &ref, nil -} diff --git a/vendor/github.com/go-openapi/loads/.editorconfig b/vendor/github.com/go-openapi/loads/.editorconfig deleted file mode 100644 index 3152da6..0000000 --- a/vendor/github.com/go-openapi/loads/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/loads/.gitignore b/vendor/github.com/go-openapi/loads/.gitignore deleted file mode 100644 index e4f15f1..0000000 --- a/vendor/github.com/go-openapi/loads/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -secrets.yml -coverage.out -profile.cov -profile.out diff --git a/vendor/github.com/go-openapi/loads/.golangci.yml b/vendor/github.com/go-openapi/loads/.golangci.yml deleted file mode 100644 index d48b4a5..0000000 --- a/vendor/github.com/go-openapi/loads/.golangci.yml +++ /dev/null @@ -1,44 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 30 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 - -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoglobals - - gochecknoinits - - godox - - gocognit - - whitespace - - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - - testpackage - - gci - - gofumpt - - goerr113 - - gomnd - - tparallel - - nestif - - godot - - errorlint - - paralleltest diff --git a/vendor/github.com/go-openapi/loads/.travis.yml b/vendor/github.com/go-openapi/loads/.travis.yml deleted file mode 100644 index 9a65c12..0000000 --- a/vendor/github.com/go-openapi/loads/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -install: -- go get gotest.tools/gotestsum -language: go -jobs: - include: - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -notifications: - slack: - secure: OxkPwVp35qBTUilgWC8xykSj+sGMcj0h8IIOKD+Rflx2schZVlFfdYdyVBM+s9OqeOfvtuvnR9v1Ye2rPKAvcjWdC4LpRGUsgmItZaI6Um8Aj6+K9udCw5qrtZVfOVmRu8LieH//XznWWKdOultUuniW0MLqw5+II87Gd00RWbCGi0hk0PykHe7uK+PDA2BEbqyZ2WKKYCvfB3j+0nrFOHScXqnh0V05l2E83J4+Sgy1fsPy+1WdX58ZlNBG333ibaC1FS79XvKSmTgKRkx3+YBo97u6ZtUmJa5WZjf2OdLG3KIckGWAv6R5xgxeU31N0Ng8L332w/Edpp2O/M2bZwdnKJ8hJQikXIAQbICbr+lTDzsoNzMdEIYcHpJ5hjPbiUl3Bmd+Jnsjf5McgAZDiWIfpCKZ29tPCEkVwRsOCqkyPRMNMzHHmoja495P5jR+ODS7+J8RFg5xgcnOgpP9D4Wlhztlf5WyZMpkLxTUD+bZq2SRf50HfHFXTkfq22zPl3d1eq0yrLwh/Z/fWKkfb6SyysROL8y6s8u3dpFX1YHSg0BR6i913h4aoZw9B2BG27cafLLTwKYsp2dFo1PWl4O6u9giFJIeqwloZHLKKrwh0cBFhB7RH0I58asxkZpCH6uWjJierahmHe7iS+E6i+9oCHkOZ59hmCYNimIs3hM= -script: -- gotestsum -f short-verbose -- -race -timeout=20m -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/loads/LICENSE b/vendor/github.com/go-openapi/loads/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/loads/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/loads/README.md b/vendor/github.com/go-openapi/loads/README.md deleted file mode 100644 index 8071d6c..0000000 --- a/vendor/github.com/go-openapi/loads/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Loads OAI specs [![Build Status](https://travis-ci.org/go-openapi/loads.svg?branch=master)](https://travis-ci.org/go-openapi/loads) [![codecov](https://codecov.io/gh/go-openapi/loads/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/loads) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/loads/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/loads?status.svg)](http://godoc.org/github.com/go-openapi/loads) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/loads)](https://goreportcard.com/report/github.com/go-openapi/loads) - -Loading of OAI specification documents from local or remote locations. Supports JSON and YAML documents. diff --git a/vendor/github.com/go-openapi/loads/doc.go b/vendor/github.com/go-openapi/loads/doc.go deleted file mode 100644 index 3046da4..0000000 --- a/vendor/github.com/go-openapi/loads/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* -Package loads provides document loading methods for swagger (OAI) specifications. - -It is used by other go-openapi packages to load and run analysis on local or remote spec documents. - -*/ -package loads diff --git a/vendor/github.com/go-openapi/loads/go.mod b/vendor/github.com/go-openapi/loads/go.mod deleted file mode 100644 index e20b75f..0000000 --- a/vendor/github.com/go-openapi/loads/go.mod +++ /dev/null @@ -1,17 +0,0 @@ -module github.com/go-openapi/loads - -require ( - github.com/go-openapi/analysis v0.19.16 - github.com/go-openapi/spec v0.20.1 - github.com/go-openapi/strfmt v0.20.0 - github.com/go-openapi/swag v0.19.13 - github.com/go-openapi/validate v0.20.1 - github.com/mitchellh/mapstructure v1.4.1 // indirect - github.com/stretchr/testify v1.6.1 - go.mongodb.org/mongo-driver v1.4.6 // indirect - golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect - golang.org/x/text v0.3.5 // indirect - gopkg.in/yaml.v2 v2.4.0 -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/loads/go.sum b/vendor/github.com/go-openapi/loads/go.sum deleted file mode 100644 index 67ffcf6..0000000 --- a/vendor/github.com/go-openapi/loads/go.sum +++ /dev/null @@ -1,343 +0,0 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/analysis v0.19.16 h1:Ub9e++M8sDwtHD+S587TYi+6ANBG1NRYGZDihqk0SaY= -github.com/go-openapi/analysis v0.19.16/go.mod h1:GLInF007N83Ad3m8a/CbQ5TPzdnGT7workfHwuVjNVk= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3 h1:7MGZI1ibQDLasvAz8HuhvYk9eNJbJkCOXWsSjjMS+Zc= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.7 h1:Lcq+o0mSwCLKACMxZhreVHigB9ebghJ/lrmeaqASbjo= -github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9 h1:9SnKdGhiPZHF3ttwFMiCBEb8jQ4IDdrK+5+a0oTygA4= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.20.0/go.mod h1:2LhKquiE513rN5xC6Aan6lYOSddlL8Mp20AW9kpviM4= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.16 h1:tQMAY5s5BfmmCC31+ufDCsGrr8iO1A8UIdYfDo5ADvs= -github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= -github.com/go-openapi/runtime v0.19.24 h1:TqagMVlRAOTwllE/7hNKx6rQ10O6T8ZzeJdMjSTKaD4= -github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.15/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.0 h1:HGLc8AJ7ynOxwv0Lq4TsnwLsWMawHAYiJIFzbcML86I= -github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.1 h1:5WNKTzPguDN+79wbJw2UE2q+eX+gUmEFsIKSvnSQJlc= -github.com/go-openapi/spec v0.20.1/go.mod h1:93x7oh+d+FQsmsieroS4cmR3u0p/ywH649a3qwC9OsQ= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4 h1:eRvaqAhpL0IL6Trh5fDsGnGhiXndzHFuA05w6sXH6/g= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.11 h1:0+YvbNh05rmBkgztd6zHp4OCFn7Mtu30bn46NQo2ZRw= -github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= -github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7 h1:VRuXN2EnMSsZdauzdss6JBC29YotDqG59BZ+tdlIL1s= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.12 h1:Bc0bnY2c3AoF7Gc+IMIAQQsD8fLHjHpc19wXvYuayQI= -github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= -github.com/go-openapi/swag v0.19.13 h1:233UVgMy1DlmCYYfOiFpta6e2urloh+sEs5id6lyzog= -github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= -github.com/go-openapi/validate v0.19.12 h1:mPLM/bfbd00PGOCJlU0yJL7IulkZ+q9VjPv7U11RMQQ= -github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= -github.com/go-openapi/validate v0.19.15 h1:oUHZO8jD7p5oRLANlXF0U8ic9ePBUkDQyRZdN0EhL6M= -github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= -github.com/go-openapi/validate v0.20.1 h1:QGQ5CvK74E28t3DkegGweKR+auemUi5IdpMc4x3UW6s= -github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -go.mongodb.org/mongo-driver v1.0.3 h1:GKoji1ld3tw2aC+GX1wbr/J2fX13yNacEYoJ8Nhr0yU= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0 h1:ew6uUIeJOo+qdUUv7LxFCUhtWmVv7ZV/Xuy4FAUsw2E= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4 h1:zs/dKNwX0gYUtzwrN9lLiR15hCO0nDwQj5xXx+vjCdE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8= -go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.4 h1:bsPHfODES+/yx2PCWzUYMH8xj6PVniPI8DQrsJuSXSs= -go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.5 h1:TLtO+iD8krabXxvY1F1qpBOHgOxhLWR7XsT7kQeRmMY= -go.mongodb.org/mongo-driver v1.4.5/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.6 h1:rh7GdYmDrb8AQSkF8yteAus8qYOgOASWDOv1BWqBXkU= -go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/go-openapi/loads/loaders.go b/vendor/github.com/go-openapi/loads/loaders.go deleted file mode 100644 index 44bd32b..0000000 --- a/vendor/github.com/go-openapi/loads/loaders.go +++ /dev/null @@ -1,134 +0,0 @@ -package loads - -import ( - "encoding/json" - "errors" - "net/url" - - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -var ( - // Default chain of loaders, defined at the package level. - // - // By default this matches json and yaml documents. - // - // May be altered with AddLoader(). - loaders *loader -) - -func init() { - jsonLoader := &loader{ - DocLoaderWithMatch: DocLoaderWithMatch{ - Match: func(pth string) bool { - return true - }, - Fn: JSONDoc, - }, - } - - loaders = jsonLoader.WithHead(&loader{ - DocLoaderWithMatch: DocLoaderWithMatch{ - Match: swag.YAMLMatcher, - Fn: swag.YAMLDoc, - }, - }) - - // sets the global default loader for go-openapi/spec - spec.PathLoader = loaders.Load -} - -// DocLoader represents a doc loader type -type DocLoader func(string) (json.RawMessage, error) - -// DocMatcher represents a predicate to check if a loader matches -type DocMatcher func(string) bool - -// DocLoaderWithMatch describes a loading function for a given extension match. -type DocLoaderWithMatch struct { - Fn DocLoader - Match DocMatcher -} - -// NewDocLoaderWithMatch builds a DocLoaderWithMatch to be used in load options -func NewDocLoaderWithMatch(fn DocLoader, matcher DocMatcher) DocLoaderWithMatch { - return DocLoaderWithMatch{ - Fn: fn, - Match: matcher, - } -} - -type loader struct { - DocLoaderWithMatch - Next *loader -} - -// WithHead adds a loader at the head of the current stack -func (l *loader) WithHead(head *loader) *loader { - if head == nil { - return l - } - head.Next = l - return head -} - -// WithNext adds a loader at the trail of the current stack -func (l *loader) WithNext(next *loader) *loader { - l.Next = next - return next -} - -// Load the raw document from path -func (l *loader) Load(path string) (json.RawMessage, error) { - _, erp := url.Parse(path) - if erp != nil { - return nil, erp - } - - var lastErr error = errors.New("no loader matched") // default error if no match was found - for ldr := l; ldr != nil; ldr = ldr.Next { - if ldr.Match != nil && !ldr.Match(path) { - continue - } - - // try then move to next one if there is an error - b, err := ldr.Fn(path) - if err == nil { - return b, nil - } - - lastErr = err - } - - return nil, lastErr -} - -// JSONDoc loads a json document from either a file or a remote url -func JSONDoc(path string) (json.RawMessage, error) { - data, err := swag.LoadFromFileOrHTTP(path) - if err != nil { - return nil, err - } - return json.RawMessage(data), nil -} - -// AddLoader for a document, executed before other previously set loaders. -// -// This sets the configuration at the package level. -// -// NOTE: -// * this updates the default loader used by github.com/go-openapi/spec -// * since this sets package level globals, you shouln't call this concurrently -// -func AddLoader(predicate DocMatcher, load DocLoader) { - loaders = loaders.WithHead(&loader{ - DocLoaderWithMatch: DocLoaderWithMatch{ - Match: predicate, - Fn: load, - }, - }) - - // sets the global default loader for go-openapi/spec - spec.PathLoader = loaders.Load -} diff --git a/vendor/github.com/go-openapi/loads/options.go b/vendor/github.com/go-openapi/loads/options.go deleted file mode 100644 index f8305d5..0000000 --- a/vendor/github.com/go-openapi/loads/options.go +++ /dev/null @@ -1,61 +0,0 @@ -package loads - -type options struct { - loader *loader -} - -func defaultOptions() *options { - return &options{ - loader: loaders, - } -} - -func loaderFromOptions(options []LoaderOption) *loader { - opts := defaultOptions() - for _, apply := range options { - apply(opts) - } - - return opts.loader -} - -// LoaderOption allows to fine-tune the spec loader behavior -type LoaderOption func(*options) - -// WithDocLoader sets a custom loader for loading specs -func WithDocLoader(l DocLoader) LoaderOption { - return func(opt *options) { - if l == nil { - return - } - opt.loader = &loader{ - DocLoaderWithMatch: DocLoaderWithMatch{ - Fn: l, - }, - } - } -} - -// WithDocLoaderMatches sets a chain of custom loaders for loading specs -// for different extension matches. -// -// Loaders are executed in the order of provided DocLoaderWithMatch'es. -func WithDocLoaderMatches(l ...DocLoaderWithMatch) LoaderOption { - return func(opt *options) { - var final, prev *loader - for _, ldr := range l { - if ldr.Fn == nil { - continue - } - - if prev == nil { - final = &loader{DocLoaderWithMatch: ldr} - prev = final - continue - } - - prev = prev.WithNext(&loader{DocLoaderWithMatch: ldr}) - } - opt.loader = final - } -} diff --git a/vendor/github.com/go-openapi/loads/spec.go b/vendor/github.com/go-openapi/loads/spec.go deleted file mode 100644 index 93c8d4b..0000000 --- a/vendor/github.com/go-openapi/loads/spec.go +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package loads - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "fmt" - - "github.com/go-openapi/analysis" - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -func init() { - gob.Register(map[string]interface{}{}) - gob.Register([]interface{}{}) -} - -// Document represents a swagger spec document -type Document struct { - // specAnalyzer - Analyzer *analysis.Spec - spec *spec.Swagger - specFilePath string - origSpec *spec.Swagger - schema *spec.Schema - raw json.RawMessage - pathLoader *loader -} - -// JSONSpec loads a spec from a json document -func JSONSpec(path string, options ...LoaderOption) (*Document, error) { - data, err := JSONDoc(path) - if err != nil { - return nil, err - } - // convert to json - return Analyzed(data, "", options...) -} - -// Embedded returns a Document based on embedded specs. No analysis is required -func Embedded(orig, flat json.RawMessage, options ...LoaderOption) (*Document, error) { - var origSpec, flatSpec spec.Swagger - if err := json.Unmarshal(orig, &origSpec); err != nil { - return nil, err - } - if err := json.Unmarshal(flat, &flatSpec); err != nil { - return nil, err - } - return &Document{ - raw: orig, - origSpec: &origSpec, - spec: &flatSpec, - pathLoader: loaderFromOptions(options), - }, nil -} - -// Spec loads a new spec document from a local or remote path -func Spec(path string, options ...LoaderOption) (*Document, error) { - - ldr := loaderFromOptions(options) - - b, err := ldr.Load(path) - if err != nil { - return nil, err - } - - document, err := Analyzed(b, "", options...) - if err != nil { - return nil, err - } - - if document != nil { - document.specFilePath = path - document.pathLoader = ldr - } - - return document, err -} - -// Analyzed creates a new analyzed spec document for a root json.RawMessage. -func Analyzed(data json.RawMessage, version string, options ...LoaderOption) (*Document, error) { - if version == "" { - version = "2.0" - } - if version != "2.0" { - return nil, fmt.Errorf("spec version %q is not supported", version) - } - - raw, err := trimData(data) // trim blanks, then convert yaml docs into json - if err != nil { - return nil, err - } - - swspec := new(spec.Swagger) - if err = json.Unmarshal(raw, swspec); err != nil { - return nil, err - } - - origsqspec, err := cloneSpec(swspec) - if err != nil { - return nil, err - } - - d := &Document{ - Analyzer: analysis.New(swspec), - schema: spec.MustLoadSwagger20Schema(), - spec: swspec, - raw: raw, - origSpec: origsqspec, - pathLoader: loaderFromOptions(options), - } - - return d, nil -} - -func trimData(in json.RawMessage) (json.RawMessage, error) { - trimmed := bytes.TrimSpace(in) - if len(trimmed) == 0 { - return in, nil - } - - if trimmed[0] == '{' || trimmed[0] == '[' { - return trimmed, nil - } - - // assume yaml doc: convert it to json - yml, err := swag.BytesToYAMLDoc(trimmed) - if err != nil { - return nil, fmt.Errorf("analyzed: %v", err) - } - - d, err := swag.YAMLToJSON(yml) - if err != nil { - return nil, fmt.Errorf("analyzed: %v", err) - } - - return d, nil -} - -// Expanded expands the ref fields in the spec document and returns a new spec document -func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) { - - swspec := new(spec.Swagger) - if err := json.Unmarshal(d.raw, swspec); err != nil { - return nil, err - } - - var expandOptions *spec.ExpandOptions - if len(options) > 0 { - expandOptions = options[0] - } else { - expandOptions = &spec.ExpandOptions{ - RelativeBase: d.specFilePath, - } - } - - if expandOptions.PathLoader == nil { - if d.pathLoader != nil { - // use loader from Document options - expandOptions.PathLoader = d.pathLoader.Load - } else { - // use package level loader - expandOptions.PathLoader = loaders.Load - } - } - - if err := spec.ExpandSpec(swspec, expandOptions); err != nil { - return nil, err - } - - dd := &Document{ - Analyzer: analysis.New(swspec), - spec: swspec, - specFilePath: d.specFilePath, - schema: spec.MustLoadSwagger20Schema(), - raw: d.raw, - origSpec: d.origSpec, - } - return dd, nil -} - -// BasePath the base path for this spec -func (d *Document) BasePath() string { - return d.spec.BasePath -} - -// Version returns the version of this spec -func (d *Document) Version() string { - return d.spec.Swagger -} - -// Schema returns the swagger 2.0 schema -func (d *Document) Schema() *spec.Schema { - return d.schema -} - -// Spec returns the swagger spec object model -func (d *Document) Spec() *spec.Swagger { - return d.spec -} - -// Host returns the host for the API -func (d *Document) Host() string { - return d.spec.Host -} - -// Raw returns the raw swagger spec as json bytes -func (d *Document) Raw() json.RawMessage { - return d.raw -} - -// OrigSpec yields the original spec -func (d *Document) OrigSpec() *spec.Swagger { - return d.origSpec -} - -// ResetDefinitions gives a shallow copy with the models reset to the original spec -func (d *Document) ResetDefinitions() *Document { - defs := make(map[string]spec.Schema, len(d.origSpec.Definitions)) - for k, v := range d.origSpec.Definitions { - defs[k] = v - } - - d.spec.Definitions = defs - return d -} - -// Pristine creates a new pristine document instance based on the input data -func (d *Document) Pristine() *Document { - dd, _ := Analyzed(d.Raw(), d.Version()) - dd.pathLoader = d.pathLoader - return dd -} - -// SpecFilePath returns the file path of the spec if one is defined -func (d *Document) SpecFilePath() string { - return d.specFilePath -} - -func cloneSpec(src *spec.Swagger) (*spec.Swagger, error) { - var b bytes.Buffer - if err := gob.NewEncoder(&b).Encode(src); err != nil { - return nil, err - } - - var dst spec.Swagger - if err := gob.NewDecoder(&b).Decode(&dst); err != nil { - return nil, err - } - return &dst, nil -} diff --git a/vendor/github.com/go-openapi/runtime/.editorconfig b/vendor/github.com/go-openapi/runtime/.editorconfig deleted file mode 100644 index 3152da6..0000000 --- a/vendor/github.com/go-openapi/runtime/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/runtime/.gitattributes b/vendor/github.com/go-openapi/runtime/.gitattributes deleted file mode 100644 index d207b18..0000000 --- a/vendor/github.com/go-openapi/runtime/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go text eol=lf diff --git a/vendor/github.com/go-openapi/runtime/.gitignore b/vendor/github.com/go-openapi/runtime/.gitignore deleted file mode 100644 index fea8b84..0000000 --- a/vendor/github.com/go-openapi/runtime/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -secrets.yml -coverage.out -*.cov -*.out -playground diff --git a/vendor/github.com/go-openapi/runtime/.golangci.yml b/vendor/github.com/go-openapi/runtime/.golangci.yml deleted file mode 100644 index 90f38cf..0000000 --- a/vendor/github.com/go-openapi/runtime/.golangci.yml +++ /dev/null @@ -1,43 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 30 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 -linters: - disable: - - maligned - - lll - - gochecknoglobals - - godox - - gocognit - - whitespace - - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - - testpackage - - gci - - gofumpt - - goerr113 - - gomnd - - tparallel - - nestif - - godot - - errorlint - - noctx - - interfacer - - nilerr diff --git a/vendor/github.com/go-openapi/runtime/.travis.yml b/vendor/github.com/go-openapi/runtime/.travis.yml deleted file mode 100644 index a716f63..0000000 --- a/vendor/github.com/go-openapi/runtime/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.x -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -jobs: - include: - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -language: go -notifications: - slack: - secure: EmObnQuM9Mw8J9vpFaKKHqSMN4Wsr/A9+v7ewAD5cEhA0T1P4m7MbJMiJOhxUhj/X+BFh2DamW+P2lT8mybj5wg8wnkQ2BteKA8Tawi6f9PRw2NRheO8tAi8o/npLnlmet0kc93mn+oLuqHw36w4+j5mkOl2FghkfGiUVhwrhkCP7KXQN+3TU87e+/HzQumlJ3nsE+6terVxkH3PmaUTsS5ONaODZfuxFpfb7RsoEl3skHf6d+tr+1nViLxxly7558Nc33C+W1mr0qiEvMLZ+kJ/CpGWBJ6CUJM3jm6hNe2eMuIPwEK2hxZob8c7n22VPap4K6a0bBRoydoDXaba+2sD7Ym6ivDO/DVyL44VeBBLyIiIBylDGQdZH+6SoWm90Qe/i7tnY/T5Ao5igT8f3cfQY1c3EsTfqmlDfrhmACBmwSlgkdVBLTprHL63JMY24LWmh4jhxsmMRZhCL4dze8su1w6pLN/pD1pGHtKYCEVbdTmaM3PblNRFf12XB7qosmQsgUndH4Vq3bTbU0s1pKjeDhRyLvFzvR0TBbo0pDLEoF1A/i5GVFWa7yLZNUDudQERRh7qv/xBl2excIaQ1sV4DSVm7bAE9l6Kp+yeHQJW2uN6Y3X8wu9gB9nv9l5HBze7wh8KE6PyWAOLYYqZg9/sAtsv/2GcQqXcKFF1zcA= -script: -- gotestsum -f short-verbose -- -race -timeout=20m -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/runtime/LICENSE b/vendor/github.com/go-openapi/runtime/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/runtime/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/runtime/README.md b/vendor/github.com/go-openapi/runtime/README.md deleted file mode 100644 index 5b1ec64..0000000 --- a/vendor/github.com/go-openapi/runtime/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# runtime [![Build Status](https://travis-ci.org/go-openapi/runtime.svg?branch=client-context)](https://travis-ci.org/go-openapi/runtime) [![codecov](https://codecov.io/gh/go-openapi/runtime/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/runtime) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/runtime/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/runtime?status.svg)](http://godoc.org/github.com/go-openapi/runtime) - -# golang Open-API toolkit - runtime - -The runtime component for use in codegeneration or as untyped usage. diff --git a/vendor/github.com/go-openapi/runtime/bytestream.go b/vendor/github.com/go-openapi/runtime/bytestream.go deleted file mode 100644 index 4459025..0000000 --- a/vendor/github.com/go-openapi/runtime/bytestream.go +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "bytes" - "encoding" - "errors" - "fmt" - "io" - "reflect" - - "github.com/go-openapi/swag" -) - -func defaultCloser() error { return nil } - -type byteStreamOpt func(opts *byteStreamOpts) - -// ClosesStream when the bytestream consumer or producer is finished -func ClosesStream(opts *byteStreamOpts) { - opts.Close = true -} - -type byteStreamOpts struct { - Close bool -} - -// ByteStreamConsumer creates a consmer for byte streams, -// takes a Writer/BinaryUnmarshaler interface or binary slice by reference, -// and reads from the provided reader -func ByteStreamConsumer(opts ...byteStreamOpt) Consumer { - var vals byteStreamOpts - for _, opt := range opts { - opt(&vals) - } - - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - if reader == nil { - return errors.New("ByteStreamConsumer requires a reader") // early exit - } - - close := defaultCloser - if vals.Close { - if cl, ok := reader.(io.Closer); ok { - close = cl.Close - } - } - defer close() - - if wrtr, ok := data.(io.Writer); ok { - _, err := io.Copy(wrtr, reader) - return err - } - - buf := new(bytes.Buffer) - _, err := buf.ReadFrom(reader) - if err != nil { - return err - } - b := buf.Bytes() - - if bu, ok := data.(encoding.BinaryUnmarshaler); ok { - return bu.UnmarshalBinary(b) - } - - if t := reflect.TypeOf(data); data != nil && t.Kind() == reflect.Ptr { - v := reflect.Indirect(reflect.ValueOf(data)) - if t = v.Type(); t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8 { - v.SetBytes(b) - return nil - } - } - - return fmt.Errorf("%v (%T) is not supported by the ByteStreamConsumer, %s", - data, data, "can be resolved by supporting Writer/BinaryUnmarshaler interface") - }) -} - -// ByteStreamProducer creates a producer for byte streams, -// takes a Reader/BinaryMarshaler interface or binary slice, -// and writes to a writer (essentially a pipe) -func ByteStreamProducer(opts ...byteStreamOpt) Producer { - var vals byteStreamOpts - for _, opt := range opts { - opt(&vals) - } - return ProducerFunc(func(writer io.Writer, data interface{}) error { - if writer == nil { - return errors.New("ByteStreamProducer requires a writer") // early exit - } - close := defaultCloser - if vals.Close { - if cl, ok := writer.(io.Closer); ok { - close = cl.Close - } - } - defer close() - - if rc, ok := data.(io.ReadCloser); ok { - defer rc.Close() - } - - if rdr, ok := data.(io.Reader); ok { - _, err := io.Copy(writer, rdr) - return err - } - - if bm, ok := data.(encoding.BinaryMarshaler); ok { - bytes, err := bm.MarshalBinary() - if err != nil { - return err - } - - _, err = writer.Write(bytes) - return err - } - - if data != nil { - if e, ok := data.(error); ok { - _, err := writer.Write([]byte(e.Error())) - return err - } - - v := reflect.Indirect(reflect.ValueOf(data)) - if t := v.Type(); t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8 { - _, err := writer.Write(v.Bytes()) - return err - } - if t := v.Type(); t.Kind() == reflect.Struct || t.Kind() == reflect.Slice { - b, err := swag.WriteJSON(data) - if err != nil { - return err - } - _, err = writer.Write(b) - return err - } - } - - return fmt.Errorf("%v (%T) is not supported by the ByteStreamProducer, %s", - data, data, "can be resolved by supporting Reader/BinaryMarshaler interface") - }) -} diff --git a/vendor/github.com/go-openapi/runtime/client/auth_info.go b/vendor/github.com/go-openapi/runtime/client/auth_info.go deleted file mode 100644 index d37e8f6..0000000 --- a/vendor/github.com/go-openapi/runtime/client/auth_info.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "encoding/base64" - - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" -) - -// PassThroughAuth never manipulates the request -var PassThroughAuth runtime.ClientAuthInfoWriter - -func init() { - PassThroughAuth = runtime.ClientAuthInfoWriterFunc(func(_ runtime.ClientRequest, _ strfmt.Registry) error { return nil }) -} - -// BasicAuth provides a basic auth info writer -func BasicAuth(username, password string) runtime.ClientAuthInfoWriter { - return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { - encoded := base64.StdEncoding.EncodeToString([]byte(username + ":" + password)) - return r.SetHeaderParam("Authorization", "Basic "+encoded) - }) -} - -// APIKeyAuth provides an API key auth info writer -func APIKeyAuth(name, in, value string) runtime.ClientAuthInfoWriter { - if in == "query" { - return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { - return r.SetQueryParam(name, value) - }) - } - - if in == "header" { - return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { - return r.SetHeaderParam(name, value) - }) - } - return nil -} - -// BearerToken provides a header based oauth2 bearer access token auth info writer -func BearerToken(token string) runtime.ClientAuthInfoWriter { - return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { - return r.SetHeaderParam("Authorization", "Bearer "+token) - }) -} - -// Compose combines multiple ClientAuthInfoWriters into a single one. -// Useful when multiple auth headers are needed. -func Compose(auths ...runtime.ClientAuthInfoWriter) runtime.ClientAuthInfoWriter { - return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { - for _, auth := range auths { - if auth == nil { - continue - } - if err := auth.AuthenticateRequest(r, nil); err != nil { - return err - } - } - return nil - }) -} diff --git a/vendor/github.com/go-openapi/runtime/client/keepalive.go b/vendor/github.com/go-openapi/runtime/client/keepalive.go deleted file mode 100644 index f832545..0000000 --- a/vendor/github.com/go-openapi/runtime/client/keepalive.go +++ /dev/null @@ -1,53 +0,0 @@ -package client - -import ( - "io" - "io/ioutil" - "net/http" - "sync/atomic" -) - -// KeepAliveTransport drains the remaining body from a response -// so that go will reuse the TCP connections. -// This is not enabled by default because there are servers where -// the response never gets closed and that would make the code hang forever. -// So instead it's provided as a http client middleware that can be used to override -// any request. -func KeepAliveTransport(rt http.RoundTripper) http.RoundTripper { - return &keepAliveTransport{wrapped: rt} -} - -type keepAliveTransport struct { - wrapped http.RoundTripper -} - -func (k *keepAliveTransport) RoundTrip(r *http.Request) (*http.Response, error) { - resp, err := k.wrapped.RoundTrip(r) - if err != nil { - return resp, err - } - resp.Body = &drainingReadCloser{rdr: resp.Body} - return resp, nil -} - -type drainingReadCloser struct { - rdr io.ReadCloser - seenEOF uint32 -} - -func (d *drainingReadCloser) Read(p []byte) (n int, err error) { - n, err = d.rdr.Read(p) - if err == io.EOF || n == 0 { - atomic.StoreUint32(&d.seenEOF, 1) - } - return -} - -func (d *drainingReadCloser) Close() error { - // drain buffer - if atomic.LoadUint32(&d.seenEOF) != 1 { - //#nosec - io.Copy(ioutil.Discard, d.rdr) - } - return d.rdr.Close() -} diff --git a/vendor/github.com/go-openapi/runtime/client/opentracing.go b/vendor/github.com/go-openapi/runtime/client/opentracing.go deleted file mode 100644 index 87e0753..0000000 --- a/vendor/github.com/go-openapi/runtime/client/opentracing.go +++ /dev/null @@ -1,98 +0,0 @@ -package client - -import ( - "net/http" - "regexp" - "strings" - - "github.com/go-openapi/strfmt" - "github.com/opentracing/opentracing-go" - "github.com/opentracing/opentracing-go/ext" - "github.com/opentracing/opentracing-go/log" - - "github.com/go-openapi/runtime" -) - -type tracingTransport struct { - transport runtime.ClientTransport - host string - opts []opentracing.StartSpanOption -} - -func newOpenTracingTransport(transport runtime.ClientTransport, host string, opts []opentracing.StartSpanOption, -) runtime.ClientTransport { - return &tracingTransport{ - transport: transport, - host: host, - opts: opts, - } -} - -func (t *tracingTransport) Submit(op *runtime.ClientOperation) (interface{}, error) { - authInfo := op.AuthInfo - reader := op.Reader - - var span opentracing.Span - defer func() { - if span != nil { - span.Finish() - } - }() - - op.AuthInfo = runtime.ClientAuthInfoWriterFunc(func(req runtime.ClientRequest, reg strfmt.Registry) error { - span = createClientSpan(op, req.GetHeaderParams(), t.host, t.opts) - return authInfo.AuthenticateRequest(req, reg) - }) - - op.Reader = runtime.ClientResponseReaderFunc(func(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - if span != nil { - code := response.Code() - ext.HTTPStatusCode.Set(span, uint16(code)) - if code >= 400 { - ext.Error.Set(span, true) - } - } - return reader.ReadResponse(response, consumer) - }) - - submit, err := t.transport.Submit(op) - if err != nil && span != nil { - ext.Error.Set(span, true) - span.LogFields(log.Error(err)) - } - return submit, err -} - -func createClientSpan(op *runtime.ClientOperation, header http.Header, host string, - opts []opentracing.StartSpanOption) opentracing.Span { - ctx := op.Context - span := opentracing.SpanFromContext(ctx) - - if span != nil { - opts = append(opts, ext.SpanKindRPCClient) - span, _ = opentracing.StartSpanFromContextWithTracer( - ctx, span.Tracer(), toSnakeCase(op.ID), opts...) - - ext.Component.Set(span, "go-openapi") - ext.PeerHostname.Set(span, host) - span.SetTag("http.path", op.PathPattern) - ext.HTTPMethod.Set(span, op.Method) - - _ = span.Tracer().Inject( - span.Context(), - opentracing.HTTPHeaders, - opentracing.HTTPHeadersCarrier(header)) - - return span - } - return nil -} - -var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)") -var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])") - -func toSnakeCase(str string) string { - snake := matchFirstCap.ReplaceAllString(str, "${1}_${2}") - snake = matchAllCap.ReplaceAllString(snake, "${1}_${2}") - return strings.ToLower(snake) -} diff --git a/vendor/github.com/go-openapi/runtime/client/request.go b/vendor/github.com/go-openapi/runtime/client/request.go deleted file mode 100644 index b7ea8b8..0000000 --- a/vendor/github.com/go-openapi/runtime/client/request.go +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "bytes" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/textproto" - "net/url" - "os" - "path" - "path/filepath" - "strings" - "time" - - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" -) - -// NewRequest creates a new swagger http client request -func newRequest(method, pathPattern string, writer runtime.ClientRequestWriter) (*request, error) { - return &request{ - pathPattern: pathPattern, - method: method, - writer: writer, - header: make(http.Header), - query: make(url.Values), - timeout: DefaultTimeout, - getBody: getRequestBuffer, - }, nil -} - -// Request represents a swagger client request. -// -// This Request struct converts to a HTTP request. -// There might be others that convert to other transports. -// There is no error checking here, it is assumed to be used after a spec has been validated. -// so impossible combinations should not arise (hopefully). -// -// The main purpose of this struct is to hide the machinery of adding params to a transport request. -// The generated code only implements what is necessary to turn a param into a valid value for these methods. -type request struct { - pathPattern string - method string - writer runtime.ClientRequestWriter - - pathParams map[string]string - header http.Header - query url.Values - formFields url.Values - fileFields map[string][]runtime.NamedReadCloser - payload interface{} - timeout time.Duration - buf *bytes.Buffer - - getBody func(r *request) []byte -} - -var ( - // ensure interface compliance - _ runtime.ClientRequest = new(request) -) - -func (r *request) isMultipart(mediaType string) bool { - if len(r.fileFields) > 0 { - return true - } - - return runtime.MultipartFormMime == mediaType -} - -// BuildHTTP creates a new http request based on the data from the params -func (r *request) BuildHTTP(mediaType, basePath string, producers map[string]runtime.Producer, registry strfmt.Registry) (*http.Request, error) { - return r.buildHTTP(mediaType, basePath, producers, registry, nil) -} -func escapeQuotes(s string) string { - return strings.NewReplacer("\\", "\\\\", `"`, "\\\"").Replace(s) -} -func (r *request) buildHTTP(mediaType, basePath string, producers map[string]runtime.Producer, registry strfmt.Registry, auth runtime.ClientAuthInfoWriter) (*http.Request, error) { - // build the data - if err := r.writer.WriteToRequest(r, registry); err != nil { - return nil, err - } - - // Our body must be an io.Reader. - // When we create the http.Request, if we pass it a - // bytes.Buffer then it will wrap it in an io.ReadCloser - // and set the content length automatically. - var body io.Reader - var pr *io.PipeReader - var pw *io.PipeWriter - - r.buf = bytes.NewBuffer(nil) - if r.payload != nil || len(r.formFields) > 0 || len(r.fileFields) > 0 { - body = r.buf - if r.isMultipart(mediaType) { - pr, pw = io.Pipe() - body = pr - } - } - - // check if this is a form type request - if len(r.formFields) > 0 || len(r.fileFields) > 0 { - if !r.isMultipart(mediaType) { - r.header.Set(runtime.HeaderContentType, mediaType) - formString := r.formFields.Encode() - r.buf.WriteString(formString) - goto DoneChoosingBodySource - } - - mp := multipart.NewWriter(pw) - r.header.Set(runtime.HeaderContentType, mangleContentType(mediaType, mp.Boundary())) - - go func() { - defer func() { - mp.Close() - pw.Close() - }() - - for fn, v := range r.formFields { - for _, vi := range v { - if err := mp.WriteField(fn, vi); err != nil { - pw.CloseWithError(err) - log.Println(err) - } - } - } - - defer func() { - for _, ff := range r.fileFields { - for _, ffi := range ff { - ffi.Close() - } - } - }() - for fn, f := range r.fileFields { - for _, fi := range f { - buf := bytes.NewBuffer([]byte{}) - - // Need to read the data so that we can detect the content type - _, err := io.Copy(buf, fi) - if err != nil { - _ = pw.CloseWithError(err) - log.Println(err) - } - fileBytes := buf.Bytes() - fileContentType := http.DetectContentType(fileBytes) - - newFi := runtime.NamedReader(fi.Name(), buf) - - // Create the MIME headers for the new part - h := make(textproto.MIMEHeader) - h.Set("Content-Disposition", - fmt.Sprintf(`form-data; name="%s"; filename="%s"`, - escapeQuotes(fn), escapeQuotes(filepath.Base(fi.Name())))) - h.Set("Content-Type", fileContentType) - - wrtr, err := mp.CreatePart(h) - if err != nil { - pw.CloseWithError(err) - log.Println(err) - } else if _, err := io.Copy(wrtr, newFi); err != nil { - pw.CloseWithError(err) - log.Println(err) - } - } - } - }() - - goto DoneChoosingBodySource - } - - // if there is payload, use the producer to write the payload, and then - // set the header to the content-type appropriate for the payload produced - if r.payload != nil { - // TODO: infer most appropriate content type based on the producer used, - // and the `consumers` section of the spec/operation - r.header.Set(runtime.HeaderContentType, mediaType) - if rdr, ok := r.payload.(io.ReadCloser); ok { - body = rdr - goto DoneChoosingBodySource - } - - if rdr, ok := r.payload.(io.Reader); ok { - body = rdr - goto DoneChoosingBodySource - } - - producer := producers[mediaType] - if err := producer.Produce(r.buf, r.payload); err != nil { - return nil, err - } - } - -DoneChoosingBodySource: - - if runtime.CanHaveBody(r.method) && body == nil && r.header.Get(runtime.HeaderContentType) == "" { - r.header.Set(runtime.HeaderContentType, mediaType) - } - - if auth != nil { - // If we're not using r.buf as our http.Request's body, - // either the payload is an io.Reader or io.ReadCloser, - // or we're doing a multipart form/file. - // - // In those cases, if the AuthenticateRequest call asks for the body, - // we must read it into a buffer and provide that, then use that buffer - // as the body of our http.Request. - // - // This is done in-line with the GetBody() request rather than ahead - // of time, because there's no way to know if the AuthenticateRequest - // will even ask for the body of the request. - // - // If for some reason the copy fails, there's no way to return that - // error to the GetBody() call, so return it afterwards. - // - // An error from the copy action is prioritized over any error - // from the AuthenticateRequest call, because the mis-read - // body may have interfered with the auth. - // - var copyErr error - if buf, ok := body.(*bytes.Buffer); body != nil && (!ok || buf != r.buf) { - var copied bool - r.getBody = func(r *request) []byte { - if copied { - return getRequestBuffer(r) - } - - defer func() { - copied = true - }() - - if _, copyErr = io.Copy(r.buf, body); copyErr != nil { - return nil - } - - if closer, ok := body.(io.ReadCloser); ok { - if copyErr = closer.Close(); copyErr != nil { - return nil - } - } - - body = r.buf - return getRequestBuffer(r) - } - } - - authErr := auth.AuthenticateRequest(r, registry) - - if copyErr != nil { - return nil, fmt.Errorf("error retrieving the response body: %v", copyErr) - } - - if authErr != nil { - return nil, authErr - } - } - - // create http request - var reinstateSlash bool - if r.pathPattern != "" && r.pathPattern != "/" && r.pathPattern[len(r.pathPattern)-1] == '/' { - reinstateSlash = true - } - urlPath := path.Join(basePath, r.pathPattern) - for k, v := range r.pathParams { - urlPath = strings.Replace(urlPath, "{"+k+"}", url.PathEscape(v), -1) - } - if reinstateSlash { - urlPath = urlPath + "/" - } - - req, err := http.NewRequest(r.method, urlPath, body) - if err != nil { - return nil, err - } - - req.URL.RawQuery = r.query.Encode() - req.Header = r.header - - return req, nil -} - -func mangleContentType(mediaType, boundary string) string { - if strings.ToLower(mediaType) == runtime.URLencodedFormMime { - return fmt.Sprintf("%s; boundary=%s", mediaType, boundary) - } - return "multipart/form-data; boundary=" + boundary -} - -func (r *request) GetMethod() string { - return r.method -} - -func (r *request) GetPath() string { - path := r.pathPattern - for k, v := range r.pathParams { - path = strings.Replace(path, "{"+k+"}", v, -1) - } - return path -} - -func (r *request) GetBody() []byte { - return r.getBody(r) -} - -func getRequestBuffer(r *request) []byte { - if r.buf == nil { - return nil - } - return r.buf.Bytes() -} - -// SetHeaderParam adds a header param to the request -// when there is only 1 value provided for the varargs, it will set it. -// when there are several values provided for the varargs it will add it (no overriding) -func (r *request) SetHeaderParam(name string, values ...string) error { - if r.header == nil { - r.header = make(http.Header) - } - r.header[http.CanonicalHeaderKey(name)] = values - return nil -} - -// GetHeaderParams returns the all headers currently set for the request -func (r *request) GetHeaderParams() http.Header { - return r.header -} - -// SetQueryParam adds a query param to the request -// when there is only 1 value provided for the varargs, it will set it. -// when there are several values provided for the varargs it will add it (no overriding) -func (r *request) SetQueryParam(name string, values ...string) error { - if r.query == nil { - r.query = make(url.Values) - } - r.query[name] = values - return nil -} - -// GetQueryParams returns a copy of all query params currently set for the request -func (r *request) GetQueryParams() url.Values { - var result = make(url.Values) - for key, value := range r.query { - result[key] = append([]string{}, value...) - } - return result -} - -// SetFormParam adds a forn param to the request -// when there is only 1 value provided for the varargs, it will set it. -// when there are several values provided for the varargs it will add it (no overriding) -func (r *request) SetFormParam(name string, values ...string) error { - if r.formFields == nil { - r.formFields = make(url.Values) - } - r.formFields[name] = values - return nil -} - -// SetPathParam adds a path param to the request -func (r *request) SetPathParam(name string, value string) error { - if r.pathParams == nil { - r.pathParams = make(map[string]string) - } - - r.pathParams[name] = value - return nil -} - -// SetFileParam adds a file param to the request -func (r *request) SetFileParam(name string, files ...runtime.NamedReadCloser) error { - for _, file := range files { - if actualFile, ok := file.(*os.File); ok { - fi, err := os.Stat(actualFile.Name()) - if err != nil { - return err - } - if fi.IsDir() { - return fmt.Errorf("%q is a directory, only files are supported", file.Name()) - } - } - } - - if r.fileFields == nil { - r.fileFields = make(map[string][]runtime.NamedReadCloser) - } - if r.formFields == nil { - r.formFields = make(url.Values) - } - - r.fileFields[name] = files - return nil -} - -func (r *request) GetFileParam() map[string][]runtime.NamedReadCloser { - return r.fileFields -} - -// SetBodyParam sets a body parameter on the request. -// This does not yet serialze the object, this happens as late as possible. -func (r *request) SetBodyParam(payload interface{}) error { - r.payload = payload - return nil -} - -func (r *request) GetBodyParam() interface{} { - return r.payload -} - -// SetTimeout sets the timeout for a request -func (r *request) SetTimeout(timeout time.Duration) error { - r.timeout = timeout - return nil -} diff --git a/vendor/github.com/go-openapi/runtime/client/response.go b/vendor/github.com/go-openapi/runtime/client/response.go deleted file mode 100644 index bd23858..0000000 --- a/vendor/github.com/go-openapi/runtime/client/response.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "io" - "net/http" - - "github.com/go-openapi/runtime" -) - -var _ runtime.ClientResponse = response{} - -type response struct { - resp *http.Response -} - -func (r response) Code() int { - return r.resp.StatusCode -} - -func (r response) Message() string { - return r.resp.Status -} - -func (r response) GetHeader(name string) string { - return r.resp.Header.Get(name) -} - -func (r response) Body() io.ReadCloser { - return r.resp.Body -} diff --git a/vendor/github.com/go-openapi/runtime/client/runtime.go b/vendor/github.com/go-openapi/runtime/client/runtime.go deleted file mode 100644 index f6ea0fa..0000000 --- a/vendor/github.com/go-openapi/runtime/client/runtime.go +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "context" - "crypto" - "crypto/ecdsa" - "crypto/rsa" - "crypto/tls" - "crypto/x509" - "encoding/pem" - "fmt" - "io/ioutil" - "mime" - "net/http" - "net/http/httputil" - "strings" - "sync" - "time" - - "github.com/go-openapi/strfmt" - "github.com/opentracing/opentracing-go" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/logger" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/yamlpc" -) - -// TLSClientOptions to configure client authentication with mutual TLS -type TLSClientOptions struct { - // Certificate is the path to a PEM-encoded certificate to be used for - // client authentication. If set then Key must also be set. - Certificate string - - // LoadedCertificate is the certificate to be used for client authentication. - // This field is ignored if Certificate is set. If this field is set, LoadedKey - // is also required. - LoadedCertificate *x509.Certificate - - // Key is the path to an unencrypted PEM-encoded private key for client - // authentication. This field is required if Certificate is set. - Key string - - // LoadedKey is the key for client authentication. This field is required if - // LoadedCertificate is set. - LoadedKey crypto.PrivateKey - - // CA is a path to a PEM-encoded certificate that specifies the root certificate - // to use when validating the TLS certificate presented by the server. If this field - // (and LoadedCA) is not set, the system certificate pool is used. This field is ignored if LoadedCA - // is set. - CA string - - // LoadedCA specifies the root certificate to use when validating the server's TLS certificate. - // If this field (and CA) is not set, the system certificate pool is used. - LoadedCA *x509.Certificate - - // LoadedCAPool specifies a pool of RootCAs to use when validating the server's TLS certificate. - // If set, it will be combined with the the other loaded certificates (see LoadedCA and CA). - // If neither LoadedCA or CA is set, the provided pool with override the system - // certificate pool. - // The caller must not use the supplied pool after calling TLSClientAuth. - LoadedCAPool *x509.CertPool - - // ServerName specifies the hostname to use when verifying the server certificate. - // If this field is set then InsecureSkipVerify will be ignored and treated as - // false. - ServerName string - - // InsecureSkipVerify controls whether the certificate chain and hostname presented - // by the server are validated. If true, any certificate is accepted. - InsecureSkipVerify bool - - // VerifyPeerCertificate, if not nil, is called after normal - // certificate verification. It receives the raw ASN.1 certificates - // provided by the peer and also any verified chains that normal processing found. - // If it returns a non-nil error, the handshake is aborted and that error results. - // - // If normal verification fails then the handshake will abort before - // considering this callback. If normal verification is disabled by - // setting InsecureSkipVerify then this callback will be considered but - // the verifiedChains argument will always be nil. - VerifyPeerCertificate func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error - - // SessionTicketsDisabled may be set to true to disable session ticket and - // PSK (resumption) support. Note that on clients, session ticket support is - // also disabled if ClientSessionCache is nil. - SessionTicketsDisabled bool - - // ClientSessionCache is a cache of ClientSessionState entries for TLS - // session resumption. It is only used by clients. - ClientSessionCache tls.ClientSessionCache - - // Prevents callers using unkeyed fields. - _ struct{} -} - -// TLSClientAuth creates a tls.Config for mutual auth -func TLSClientAuth(opts TLSClientOptions) (*tls.Config, error) { - // create client tls config - cfg := &tls.Config{} - - // load client cert if specified - if opts.Certificate != "" { - cert, err := tls.LoadX509KeyPair(opts.Certificate, opts.Key) - if err != nil { - return nil, fmt.Errorf("tls client cert: %v", err) - } - cfg.Certificates = []tls.Certificate{cert} - } else if opts.LoadedCertificate != nil { - block := pem.Block{Type: "CERTIFICATE", Bytes: opts.LoadedCertificate.Raw} - certPem := pem.EncodeToMemory(&block) - - var keyBytes []byte - switch k := opts.LoadedKey.(type) { - case *rsa.PrivateKey: - keyBytes = x509.MarshalPKCS1PrivateKey(k) - case *ecdsa.PrivateKey: - var err error - keyBytes, err = x509.MarshalECPrivateKey(k) - if err != nil { - return nil, fmt.Errorf("tls client priv key: %v", err) - } - default: - return nil, fmt.Errorf("tls client priv key: unsupported key type") - } - - block = pem.Block{Type: "PRIVATE KEY", Bytes: keyBytes} - keyPem := pem.EncodeToMemory(&block) - - cert, err := tls.X509KeyPair(certPem, keyPem) - if err != nil { - return nil, fmt.Errorf("tls client cert: %v", err) - } - cfg.Certificates = []tls.Certificate{cert} - } - - cfg.InsecureSkipVerify = opts.InsecureSkipVerify - - cfg.VerifyPeerCertificate = opts.VerifyPeerCertificate - cfg.SessionTicketsDisabled = opts.SessionTicketsDisabled - cfg.ClientSessionCache = opts.ClientSessionCache - - // When no CA certificate is provided, default to the system cert pool - // that way when a request is made to a server known by the system trust store, - // the name is still verified - if opts.LoadedCA != nil { - caCertPool := basePool(opts.LoadedCAPool) - caCertPool.AddCert(opts.LoadedCA) - cfg.RootCAs = caCertPool - } else if opts.CA != "" { - // load ca cert - caCert, err := ioutil.ReadFile(opts.CA) - if err != nil { - return nil, fmt.Errorf("tls client ca: %v", err) - } - caCertPool := basePool(opts.LoadedCAPool) - caCertPool.AppendCertsFromPEM(caCert) - cfg.RootCAs = caCertPool - } else if opts.LoadedCAPool != nil { - cfg.RootCAs = opts.LoadedCAPool - } - - // apply servername overrride - if opts.ServerName != "" { - cfg.InsecureSkipVerify = false - cfg.ServerName = opts.ServerName - } - - cfg.BuildNameToCertificate() - - return cfg, nil -} - -func basePool(pool *x509.CertPool) *x509.CertPool { - if pool == nil { - return x509.NewCertPool() - } - return pool -} - -// TLSTransport creates a http client transport suitable for mutual tls auth -func TLSTransport(opts TLSClientOptions) (http.RoundTripper, error) { - cfg, err := TLSClientAuth(opts) - if err != nil { - return nil, err - } - - return &http.Transport{TLSClientConfig: cfg}, nil -} - -// TLSClient creates a http.Client for mutual auth -func TLSClient(opts TLSClientOptions) (*http.Client, error) { - transport, err := TLSTransport(opts) - if err != nil { - return nil, err - } - return &http.Client{Transport: transport}, nil -} - -// DefaultTimeout the default request timeout -var DefaultTimeout = 30 * time.Second - -// Runtime represents an API client that uses the transport -// to make http requests based on a swagger specification. -type Runtime struct { - DefaultMediaType string - DefaultAuthentication runtime.ClientAuthInfoWriter - Consumers map[string]runtime.Consumer - Producers map[string]runtime.Producer - - Transport http.RoundTripper - Jar http.CookieJar - //Spec *spec.Document - Host string - BasePath string - Formats strfmt.Registry - Context context.Context - - Debug bool - logger logger.Logger - - clientOnce *sync.Once - client *http.Client - schemes []string -} - -// New creates a new default runtime for a swagger api runtime.Client -func New(host, basePath string, schemes []string) *Runtime { - var rt Runtime - rt.DefaultMediaType = runtime.JSONMime - - // TODO: actually infer this stuff from the spec - rt.Consumers = map[string]runtime.Consumer{ - runtime.YAMLMime: yamlpc.YAMLConsumer(), - runtime.JSONMime: runtime.JSONConsumer(), - runtime.XMLMime: runtime.XMLConsumer(), - runtime.TextMime: runtime.TextConsumer(), - runtime.HTMLMime: runtime.TextConsumer(), - runtime.CSVMime: runtime.CSVConsumer(), - runtime.DefaultMime: runtime.ByteStreamConsumer(), - } - rt.Producers = map[string]runtime.Producer{ - runtime.YAMLMime: yamlpc.YAMLProducer(), - runtime.JSONMime: runtime.JSONProducer(), - runtime.XMLMime: runtime.XMLProducer(), - runtime.TextMime: runtime.TextProducer(), - runtime.HTMLMime: runtime.TextProducer(), - runtime.CSVMime: runtime.CSVProducer(), - runtime.DefaultMime: runtime.ByteStreamProducer(), - } - rt.Transport = http.DefaultTransport - rt.Jar = nil - rt.Host = host - rt.BasePath = basePath - rt.Context = context.Background() - rt.clientOnce = new(sync.Once) - if !strings.HasPrefix(rt.BasePath, "/") { - rt.BasePath = "/" + rt.BasePath - } - - rt.Debug = logger.DebugEnabled() - rt.logger = logger.StandardLogger{} - - if len(schemes) > 0 { - rt.schemes = schemes - } - return &rt -} - -// NewWithClient allows you to create a new transport with a configured http.Client -func NewWithClient(host, basePath string, schemes []string, client *http.Client) *Runtime { - rt := New(host, basePath, schemes) - if client != nil { - rt.clientOnce.Do(func() { - rt.client = client - }) - } - return rt -} - -// WithOpenTracing adds opentracing support to the provided runtime. -// A new client span is created for each request. -// If the context of the client operation does not contain an active span, no span is created. -// The provided opts are applied to each spans - for example to add global tags. -func (r *Runtime) WithOpenTracing(opts ...opentracing.StartSpanOption) runtime.ClientTransport { - return newOpenTracingTransport(r, r.Host, opts) -} - -func (r *Runtime) pickScheme(schemes []string) string { - if v := r.selectScheme(r.schemes); v != "" { - return v - } - if v := r.selectScheme(schemes); v != "" { - return v - } - return "http" -} - -func (r *Runtime) selectScheme(schemes []string) string { - schLen := len(schemes) - if schLen == 0 { - return "" - } - - scheme := schemes[0] - // prefer https, but skip when not possible - if scheme != "https" && schLen > 1 { - for _, sch := range schemes { - if sch == "https" { - scheme = sch - break - } - } - } - return scheme -} -func transportOrDefault(left, right http.RoundTripper) http.RoundTripper { - if left == nil { - return right - } - return left -} - -// EnableConnectionReuse drains the remaining body from a response -// so that go will reuse the TCP connections. -// -// This is not enabled by default because there are servers where -// the response never gets closed and that would make the code hang forever. -// So instead it's provided as a http client middleware that can be used to override -// any request. -func (r *Runtime) EnableConnectionReuse() { - if r.client == nil { - r.Transport = KeepAliveTransport( - transportOrDefault(r.Transport, http.DefaultTransport), - ) - return - } - - r.client.Transport = KeepAliveTransport( - transportOrDefault(r.client.Transport, - transportOrDefault(r.Transport, http.DefaultTransport), - ), - ) -} - -// Submit a request and when there is a body on success it will turn that into the result -// all other things are turned into an api error for swagger which retains the status code -func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error) { - params, readResponse, auth := operation.Params, operation.Reader, operation.AuthInfo - - request, err := newRequest(operation.Method, operation.PathPattern, params) - if err != nil { - return nil, err - } - - var accept []string - accept = append(accept, operation.ProducesMediaTypes...) - if err = request.SetHeaderParam(runtime.HeaderAccept, accept...); err != nil { - return nil, err - } - - if auth == nil && r.DefaultAuthentication != nil { - auth = r.DefaultAuthentication - } - //if auth != nil { - // if err := auth.AuthenticateRequest(request, r.Formats); err != nil { - // return nil, err - // } - //} - - // TODO: pick appropriate media type - cmt := r.DefaultMediaType - for _, mediaType := range operation.ConsumesMediaTypes { - // Pick first non-empty media type - if mediaType != "" { - cmt = mediaType - break - } - } - - if _, ok := r.Producers[cmt]; !ok && cmt != runtime.MultipartFormMime && cmt != runtime.URLencodedFormMime { - return nil, fmt.Errorf("none of producers: %v registered. try %s", r.Producers, cmt) - } - - req, err := request.buildHTTP(cmt, r.BasePath, r.Producers, r.Formats, auth) - if err != nil { - return nil, err - } - req.URL.Scheme = r.pickScheme(operation.Schemes) - req.URL.Host = r.Host - req.Host = r.Host - - r.clientOnce.Do(func() { - r.client = &http.Client{ - Transport: r.Transport, - Jar: r.Jar, - } - }) - - if r.Debug { - b, err2 := httputil.DumpRequestOut(req, true) - if err2 != nil { - return nil, err2 - } - r.logger.Debugf("%s\n", string(b)) - } - - var hasTimeout bool - pctx := operation.Context - if pctx == nil { - pctx = r.Context - } else { - hasTimeout = true - } - if pctx == nil { - pctx = context.Background() - } - var ctx context.Context - var cancel context.CancelFunc - if hasTimeout { - ctx, cancel = context.WithCancel(pctx) - } else { - ctx, cancel = context.WithTimeout(pctx, request.timeout) - } - defer cancel() - - client := operation.Client - if client == nil { - client = r.client - } - req = req.WithContext(ctx) - res, err := client.Do(req) // make requests, by default follows 10 redirects before failing - if err != nil { - return nil, err - } - defer res.Body.Close() - - ct := res.Header.Get(runtime.HeaderContentType) - if ct == "" { // this should really really never occur - ct = r.DefaultMediaType - } - - if r.Debug { - printBody := true - if ct == runtime.DefaultMime { - printBody = false // Spare the terminal from a binary blob. - } - b, err2 := httputil.DumpResponse(res, printBody) - if err2 != nil { - return nil, err2 - } - r.logger.Debugf("%s\n", string(b)) - } - - mt, _, err := mime.ParseMediaType(ct) - if err != nil { - return nil, fmt.Errorf("parse content type: %s", err) - } - - cons, ok := r.Consumers[mt] - if !ok { - if cons, ok = r.Consumers["*/*"]; !ok { - // scream about not knowing what to do - return nil, fmt.Errorf("no consumer: %q", ct) - } - } - return readResponse.ReadResponse(response{res}, cons) -} - -// SetDebug changes the debug flag. -// It ensures that client and middlewares have the set debug level. -func (r *Runtime) SetDebug(debug bool) { - r.Debug = debug - middleware.Debug = debug -} - -// SetLogger changes the logger stream. -// It ensures that client and middlewares use the same logger. -func (r *Runtime) SetLogger(logger logger.Logger) { - r.logger = logger - middleware.Logger = logger -} diff --git a/vendor/github.com/go-openapi/runtime/client_auth_info.go b/vendor/github.com/go-openapi/runtime/client_auth_info.go deleted file mode 100644 index c6c97d9..0000000 --- a/vendor/github.com/go-openapi/runtime/client_auth_info.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import "github.com/go-openapi/strfmt" - -// A ClientAuthInfoWriterFunc converts a function to a request writer interface -type ClientAuthInfoWriterFunc func(ClientRequest, strfmt.Registry) error - -// AuthenticateRequest adds authentication data to the request -func (fn ClientAuthInfoWriterFunc) AuthenticateRequest(req ClientRequest, reg strfmt.Registry) error { - return fn(req, reg) -} - -// A ClientAuthInfoWriter implementor knows how to write authentication info to a request -type ClientAuthInfoWriter interface { - AuthenticateRequest(ClientRequest, strfmt.Registry) error -} diff --git a/vendor/github.com/go-openapi/runtime/client_operation.go b/vendor/github.com/go-openapi/runtime/client_operation.go deleted file mode 100644 index fa21eac..0000000 --- a/vendor/github.com/go-openapi/runtime/client_operation.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "context" - "net/http" -) - -// ClientOperation represents the context for a swagger operation to be submitted to the transport -type ClientOperation struct { - ID string - Method string - PathPattern string - ProducesMediaTypes []string - ConsumesMediaTypes []string - Schemes []string - AuthInfo ClientAuthInfoWriter - Params ClientRequestWriter - Reader ClientResponseReader - Context context.Context - Client *http.Client -} - -// A ClientTransport implementor knows how to submit Request objects to some destination -type ClientTransport interface { - //Submit(string, RequestWriter, ResponseReader, AuthInfoWriter) (interface{}, error) - Submit(*ClientOperation) (interface{}, error) -} diff --git a/vendor/github.com/go-openapi/runtime/client_request.go b/vendor/github.com/go-openapi/runtime/client_request.go deleted file mode 100644 index 3efda34..0000000 --- a/vendor/github.com/go-openapi/runtime/client_request.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "io" - "io/ioutil" - "net/http" - "net/url" - "time" - - "github.com/go-openapi/strfmt" -) - -// ClientRequestWriterFunc converts a function to a request writer interface -type ClientRequestWriterFunc func(ClientRequest, strfmt.Registry) error - -// WriteToRequest adds data to the request -func (fn ClientRequestWriterFunc) WriteToRequest(req ClientRequest, reg strfmt.Registry) error { - return fn(req, reg) -} - -// ClientRequestWriter is an interface for things that know how to write to a request -type ClientRequestWriter interface { - WriteToRequest(ClientRequest, strfmt.Registry) error -} - -// ClientRequest is an interface for things that know how to -// add information to a swagger client request -type ClientRequest interface { - SetHeaderParam(string, ...string) error - - GetHeaderParams() http.Header - - SetQueryParam(string, ...string) error - - SetFormParam(string, ...string) error - - SetPathParam(string, string) error - - GetQueryParams() url.Values - - SetFileParam(string, ...NamedReadCloser) error - - SetBodyParam(interface{}) error - - SetTimeout(time.Duration) error - - GetMethod() string - - GetPath() string - - GetBody() []byte - - GetBodyParam() interface{} - - GetFileParam() map[string][]NamedReadCloser -} - -// NamedReadCloser represents a named ReadCloser interface -type NamedReadCloser interface { - io.ReadCloser - Name() string -} - -// NamedReader creates a NamedReadCloser for use as file upload -func NamedReader(name string, rdr io.Reader) NamedReadCloser { - rc, ok := rdr.(io.ReadCloser) - if !ok { - rc = ioutil.NopCloser(rdr) - } - return &namedReadCloser{ - name: name, - cr: rc, - } -} - -type namedReadCloser struct { - name string - cr io.ReadCloser -} - -func (n *namedReadCloser) Close() error { - return n.cr.Close() -} -func (n *namedReadCloser) Read(p []byte) (int, error) { - return n.cr.Read(p) -} -func (n *namedReadCloser) Name() string { - return n.name -} - -type TestClientRequest struct { - Headers http.Header - Body interface{} -} - -func (t *TestClientRequest) SetHeaderParam(name string, values ...string) error { - if t.Headers == nil { - t.Headers = make(http.Header) - } - t.Headers.Set(name, values[0]) - return nil -} - -func (t *TestClientRequest) SetQueryParam(_ string, _ ...string) error { return nil } - -func (t *TestClientRequest) SetFormParam(_ string, _ ...string) error { return nil } - -func (t *TestClientRequest) SetPathParam(_ string, _ string) error { return nil } - -func (t *TestClientRequest) SetFileParam(_ string, _ ...NamedReadCloser) error { return nil } - -func (t *TestClientRequest) SetBodyParam(body interface{}) error { - t.Body = body - return nil -} - -func (t *TestClientRequest) SetTimeout(time.Duration) error { - return nil -} - -func (t *TestClientRequest) GetQueryParams() url.Values { return nil } - -func (t *TestClientRequest) GetMethod() string { return "" } - -func (t *TestClientRequest) GetPath() string { return "" } - -func (t *TestClientRequest) GetBody() []byte { return nil } - -func (t *TestClientRequest) GetBodyParam() interface{} { - return t.Body -} - -func (t *TestClientRequest) GetFileParam() map[string][]NamedReadCloser { - return nil -} - -func (t *TestClientRequest) GetHeaderParams() http.Header { - return t.Headers -} diff --git a/vendor/github.com/go-openapi/runtime/client_response.go b/vendor/github.com/go-openapi/runtime/client_response.go deleted file mode 100644 index d97e0ac..0000000 --- a/vendor/github.com/go-openapi/runtime/client_response.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "fmt" - "io" - - "encoding/json" -) - -// A ClientResponse represents a client response -// This bridges between responses obtained from different transports -type ClientResponse interface { - Code() int - Message() string - GetHeader(string) string - Body() io.ReadCloser -} - -// A ClientResponseReaderFunc turns a function into a ClientResponseReader interface implementation -type ClientResponseReaderFunc func(ClientResponse, Consumer) (interface{}, error) - -// ReadResponse reads the response -func (read ClientResponseReaderFunc) ReadResponse(resp ClientResponse, consumer Consumer) (interface{}, error) { - return read(resp, consumer) -} - -// A ClientResponseReader is an interface for things want to read a response. -// An application of this is to create structs from response values -type ClientResponseReader interface { - ReadResponse(ClientResponse, Consumer) (interface{}, error) -} - -// NewAPIError creates a new API error -func NewAPIError(opName string, payload interface{}, code int) *APIError { - return &APIError{ - OperationName: opName, - Response: payload, - Code: code, - } -} - -// APIError wraps an error model and captures the status code -type APIError struct { - OperationName string - Response interface{} - Code int -} - -func (a *APIError) Error() string { - resp, _ := json.Marshal(a.Response) - return fmt.Sprintf("%s (status %d): %s", a.OperationName, a.Code, resp) -} - -func (a *APIError) String() string { - return a.Error() -} diff --git a/vendor/github.com/go-openapi/runtime/constants.go b/vendor/github.com/go-openapi/runtime/constants.go deleted file mode 100644 index a4de897..0000000 --- a/vendor/github.com/go-openapi/runtime/constants.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -const ( - // HeaderContentType represents a http content-type header, it's value is supposed to be a mime type - HeaderContentType = "Content-Type" - - // HeaderTransferEncoding represents a http transfer-encoding header. - HeaderTransferEncoding = "Transfer-Encoding" - - // HeaderAccept the Accept header - HeaderAccept = "Accept" - - charsetKey = "charset" - - // DefaultMime the default fallback mime type - DefaultMime = "application/octet-stream" - // JSONMime the json mime type - JSONMime = "application/json" - // YAMLMime the yaml mime type - YAMLMime = "application/x-yaml" - // XMLMime the xml mime type - XMLMime = "application/xml" - // TextMime the text mime type - TextMime = "text/plain" - // HTMLMime the html mime type - HTMLMime = "text/html" - // CSVMime the csv mime type - CSVMime = "text/csv" - // MultipartFormMime the multipart form mime type - MultipartFormMime = "multipart/form-data" - // URLencodedFormMime the url encoded form mime type - URLencodedFormMime = "application/x-www-form-urlencoded" -) diff --git a/vendor/github.com/go-openapi/runtime/csv.go b/vendor/github.com/go-openapi/runtime/csv.go deleted file mode 100644 index d807bd9..0000000 --- a/vendor/github.com/go-openapi/runtime/csv.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "bytes" - "encoding/csv" - "errors" - "io" -) - -// CSVConsumer creates a new CSV consumer -func CSVConsumer() Consumer { - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - if reader == nil { - return errors.New("CSVConsumer requires a reader") - } - - csvReader := csv.NewReader(reader) - writer, ok := data.(io.Writer) - if !ok { - return errors.New("data type must be io.Writer") - } - csvWriter := csv.NewWriter(writer) - records, err := csvReader.ReadAll() - if err != nil { - return err - } - for _, r := range records { - if err := csvWriter.Write(r); err != nil { - return err - } - } - csvWriter.Flush() - return nil - }) -} - -// CSVProducer creates a new CSV producer -func CSVProducer() Producer { - return ProducerFunc(func(writer io.Writer, data interface{}) error { - if writer == nil { - return errors.New("CSVProducer requires a writer") - } - - dataBytes, ok := data.([]byte) - if !ok { - return errors.New("data type must be byte array") - } - - csvReader := csv.NewReader(bytes.NewBuffer(dataBytes)) - records, err := csvReader.ReadAll() - if err != nil { - return err - } - csvWriter := csv.NewWriter(writer) - for _, r := range records { - if err := csvWriter.Write(r); err != nil { - return err - } - } - csvWriter.Flush() - return nil - }) -} diff --git a/vendor/github.com/go-openapi/runtime/discard.go b/vendor/github.com/go-openapi/runtime/discard.go deleted file mode 100644 index 0d390cf..0000000 --- a/vendor/github.com/go-openapi/runtime/discard.go +++ /dev/null @@ -1,9 +0,0 @@ -package runtime - -import "io" - -// DiscardConsumer does absolutely nothing, it's a black hole. -var DiscardConsumer = ConsumerFunc(func(_ io.Reader, _ interface{}) error { return nil }) - -// DiscardProducer does absolutely nothing, it's a black hole. -var DiscardProducer = ProducerFunc(func(_ io.Writer, _ interface{}) error { return nil }) diff --git a/vendor/github.com/go-openapi/runtime/file.go b/vendor/github.com/go-openapi/runtime/file.go deleted file mode 100644 index 85971c1..0000000 --- a/vendor/github.com/go-openapi/runtime/file.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import "mime/multipart" - -// File represents an uploaded file. -type File struct { - Data multipart.File - Header *multipart.FileHeader -} - -// Read bytes from the file -func (f *File) Read(p []byte) (n int, err error) { - return f.Data.Read(p) -} - -// Close the file -func (f *File) Close() error { - return f.Data.Close() -} diff --git a/vendor/github.com/go-openapi/runtime/go.mod b/vendor/github.com/go-openapi/runtime/go.mod deleted file mode 100644 index 6fcf0fe..0000000 --- a/vendor/github.com/go-openapi/runtime/go.mod +++ /dev/null @@ -1,18 +0,0 @@ -module github.com/go-openapi/runtime - -require ( - github.com/docker/go-units v0.4.0 - github.com/go-openapi/analysis v0.19.10 - github.com/go-openapi/errors v0.19.6 - github.com/go-openapi/loads v0.19.5 - github.com/go-openapi/spec v0.19.8 - github.com/go-openapi/strfmt v0.19.5 - github.com/go-openapi/swag v0.19.9 - github.com/go-openapi/validate v0.19.10 - github.com/opentracing/opentracing-go v1.2.0 - github.com/stretchr/testify v1.6.1 - gopkg.in/yaml.v2 v2.3.0 - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/runtime/go.sum b/vendor/github.com/go-openapi/runtime/go.sum deleted file mode 100644 index 27801d8..0000000 --- a/vendor/github.com/go-openapi/runtime/go.sum +++ /dev/null @@ -1,270 +0,0 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf h1:eg0MeVzsP1G42dRafH3vf+al2vQIJU0YHX+1Tw87oco= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2 h1:ophLETFestFZHk3ji7niPEL4d466QjW+0Tdg5VyDq7E= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5 h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOXdfYzI= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2 h1:rf5ArTHmIJxyV5Oiks+Su0mUens1+AjpkPoWr5xFRcI= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3 h1:jwIoahqCmaA5OBoc/B+1+Mu2L0Gr8xYQnbeyQEo/7b0= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2 h1:SStNd1jRcYtfKCN7R0laGNs80WYYvn5CbBjM2sOmCrE= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.8 h1:qAdZLh1r6QF/hI/gTq+TJTvsQUodZsM7KLqkAJdiJNg= -github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0 h1:0Dn9qy1G9+UJfRU7TR8bmdGxb4uifB7HNrJjOnV0yPk= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3 h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2 h1:ky5l57HjyVRrsJfd2+Ro5Z9PjGuKbsmftwyMtk8H7js= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3 h1:PAH/2DylwWcIU1s0Y7k3yNmeAgWOcKrNE2Q7Ww/kCg4= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe h1:W/GaMY0y69G4cFlmsC6B9sbuo2fP8OFP1ABjt4kPz+w= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1 h1:Sq1fR+0c58RME5EoqKdjkiQAmPjmfHlZOoRI6fTUOcs= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4 h1:zs/dKNwX0gYUtzwrN9lLiR15hCO0nDwQj5xXx+vjCdE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53 h1:kcXqo9vE6fsZY5X5Rd7R1l7fTgnWaDCVmln65REefiE= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/go-openapi/runtime/headers.go b/vendor/github.com/go-openapi/runtime/headers.go deleted file mode 100644 index 4d111db..0000000 --- a/vendor/github.com/go-openapi/runtime/headers.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "mime" - "net/http" - - "github.com/go-openapi/errors" -) - -// ContentType parses a content type header -func ContentType(headers http.Header) (string, string, error) { - ct := headers.Get(HeaderContentType) - orig := ct - if ct == "" { - ct = DefaultMime - } - if ct == "" { - return "", "", nil - } - - mt, opts, err := mime.ParseMediaType(ct) - if err != nil { - return "", "", errors.NewParseError(HeaderContentType, "header", orig, err) - } - - if cs, ok := opts[charsetKey]; ok { - return mt, cs, nil - } - - return mt, "", nil -} diff --git a/vendor/github.com/go-openapi/runtime/interfaces.go b/vendor/github.com/go-openapi/runtime/interfaces.go deleted file mode 100644 index e334128..0000000 --- a/vendor/github.com/go-openapi/runtime/interfaces.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/strfmt" -) - -// OperationHandlerFunc an adapter for a function to the OperationHandler interface -type OperationHandlerFunc func(interface{}) (interface{}, error) - -// Handle implements the operation handler interface -func (s OperationHandlerFunc) Handle(data interface{}) (interface{}, error) { - return s(data) -} - -// OperationHandler a handler for a swagger operation -type OperationHandler interface { - Handle(interface{}) (interface{}, error) -} - -// ConsumerFunc represents a function that can be used as a consumer -type ConsumerFunc func(io.Reader, interface{}) error - -// Consume consumes the reader into the data parameter -func (fn ConsumerFunc) Consume(reader io.Reader, data interface{}) error { - return fn(reader, data) -} - -// Consumer implementations know how to bind the values on the provided interface to -// data provided by the request body -type Consumer interface { - // Consume performs the binding of request values - Consume(io.Reader, interface{}) error -} - -// ProducerFunc represents a function that can be used as a producer -type ProducerFunc func(io.Writer, interface{}) error - -// Produce produces the response for the provided data -func (f ProducerFunc) Produce(writer io.Writer, data interface{}) error { - return f(writer, data) -} - -// Producer implementations know how to turn the provided interface into a valid -// HTTP response -type Producer interface { - // Produce writes to the http response - Produce(io.Writer, interface{}) error -} - -// AuthenticatorFunc turns a function into an authenticator -type AuthenticatorFunc func(interface{}) (bool, interface{}, error) - -// Authenticate authenticates the request with the provided data -func (f AuthenticatorFunc) Authenticate(params interface{}) (bool, interface{}, error) { - return f(params) -} - -// Authenticator represents an authentication strategy -// implementations of Authenticator know how to authenticate the -// request data and translate that into a valid principal object or an error -type Authenticator interface { - Authenticate(interface{}) (bool, interface{}, error) -} - -// AuthorizerFunc turns a function into an authorizer -type AuthorizerFunc func(*http.Request, interface{}) error - -// Authorize authorizes the processing of the request for the principal -func (f AuthorizerFunc) Authorize(r *http.Request, principal interface{}) error { - return f(r, principal) -} - -// Authorizer represents an authorization strategy -// implementations of Authorizer know how to authorize the principal object -// using the request data and returns error if unauthorized -type Authorizer interface { - Authorize(*http.Request, interface{}) error -} - -// Validatable types implementing this interface allow customizing their validation -// this will be used instead of the reflective validation based on the spec document. -// the implementations are assumed to have been generated by the swagger tool so they should -// contain all the validations obtained from the spec -type Validatable interface { - Validate(strfmt.Registry) error -} - -// ContextValidatable types implementing this interface allow customizing their validation -// this will be used instead of the reflective validation based on the spec document. -// the implementations are assumed to have been generated by the swagger tool so they should -// contain all the context validations obtained from the spec -type ContextValidatable interface { - ContextValidate(context.Context, strfmt.Registry) error -} diff --git a/vendor/github.com/go-openapi/runtime/json.go b/vendor/github.com/go-openapi/runtime/json.go deleted file mode 100644 index 5a69055..0000000 --- a/vendor/github.com/go-openapi/runtime/json.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "encoding/json" - "io" -) - -// JSONConsumer creates a new JSON consumer -func JSONConsumer() Consumer { - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - dec := json.NewDecoder(reader) - dec.UseNumber() // preserve number formats - return dec.Decode(data) - }) -} - -// JSONProducer creates a new JSON producer -func JSONProducer() Producer { - return ProducerFunc(func(writer io.Writer, data interface{}) error { - enc := json.NewEncoder(writer) - enc.SetEscapeHTML(false) - return enc.Encode(data) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/logger/logger.go b/vendor/github.com/go-openapi/runtime/logger/logger.go deleted file mode 100644 index 6f4debc..0000000 --- a/vendor/github.com/go-openapi/runtime/logger/logger.go +++ /dev/null @@ -1,20 +0,0 @@ -package logger - -import "os" - -type Logger interface { - Printf(format string, args ...interface{}) - Debugf(format string, args ...interface{}) -} - -func DebugEnabled() bool { - d := os.Getenv("SWAGGER_DEBUG") - if d != "" && d != "false" && d != "0" { - return true - } - d = os.Getenv("DEBUG") - if d != "" && d != "false" && d != "0" { - return true - } - return false -} diff --git a/vendor/github.com/go-openapi/runtime/logger/standard.go b/vendor/github.com/go-openapi/runtime/logger/standard.go deleted file mode 100644 index f7e67eb..0000000 --- a/vendor/github.com/go-openapi/runtime/logger/standard.go +++ /dev/null @@ -1,22 +0,0 @@ -package logger - -import ( - "fmt" - "os" -) - -type StandardLogger struct{} - -func (StandardLogger) Printf(format string, args ...interface{}) { - if len(format) == 0 || format[len(format)-1] != '\n' { - format += "\n" - } - fmt.Fprintf(os.Stderr, format, args...) -} - -func (StandardLogger) Debugf(format string, args ...interface{}) { - if len(format) == 0 || format[len(format)-1] != '\n' { - format += "\n" - } - fmt.Fprintf(os.Stderr, format, args...) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/context.go b/vendor/github.com/go-openapi/runtime/middleware/context.go deleted file mode 100644 index 250e35f..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/context.go +++ /dev/null @@ -1,622 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - stdContext "context" - "fmt" - "net/http" - "strings" - "sync" - - "github.com/go-openapi/analysis" - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/logger" - "github.com/go-openapi/runtime/middleware/untyped" - "github.com/go-openapi/runtime/security" -) - -// Debug when true turns on verbose logging -var Debug = logger.DebugEnabled() -var Logger logger.Logger = logger.StandardLogger{} - -func debugLog(format string, args ...interface{}) { - if Debug { - Logger.Printf(format, args...) - } -} - -// A Builder can create middlewares -type Builder func(http.Handler) http.Handler - -// PassthroughBuilder returns the handler, aka the builder identity function -func PassthroughBuilder(handler http.Handler) http.Handler { return handler } - -// RequestBinder is an interface for types to implement -// when they want to be able to bind from a request -type RequestBinder interface { - BindRequest(*http.Request, *MatchedRoute) error -} - -// Responder is an interface for types to implement -// when they want to be considered for writing HTTP responses -type Responder interface { - WriteResponse(http.ResponseWriter, runtime.Producer) -} - -// ResponderFunc wraps a func as a Responder interface -type ResponderFunc func(http.ResponseWriter, runtime.Producer) - -// WriteResponse writes to the response -func (fn ResponderFunc) WriteResponse(rw http.ResponseWriter, pr runtime.Producer) { - fn(rw, pr) -} - -// Context is a type safe wrapper around an untyped request context -// used throughout to store request context with the standard context attached -// to the http.Request -type Context struct { - spec *loads.Document - analyzer *analysis.Spec - api RoutableAPI - router Router -} - -type routableUntypedAPI struct { - api *untyped.API - hlock *sync.Mutex - handlers map[string]map[string]http.Handler - defaultConsumes string - defaultProduces string -} - -func newRoutableUntypedAPI(spec *loads.Document, api *untyped.API, context *Context) *routableUntypedAPI { - var handlers map[string]map[string]http.Handler - if spec == nil || api == nil { - return nil - } - analyzer := analysis.New(spec.Spec()) - for method, hls := range analyzer.Operations() { - um := strings.ToUpper(method) - for path, op := range hls { - schemes := analyzer.SecurityRequirementsFor(op) - - if oh, ok := api.OperationHandlerFor(method, path); ok { - if handlers == nil { - handlers = make(map[string]map[string]http.Handler) - } - if b, ok := handlers[um]; !ok || b == nil { - handlers[um] = make(map[string]http.Handler) - } - - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // lookup route info in the context - route, rCtx, _ := context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - - // bind and validate the request using reflection - var bound interface{} - var validation error - bound, r, validation = context.BindAndValidate(r, route) - if validation != nil { - context.Respond(w, r, route.Produces, route, validation) - return - } - - // actually handle the request - result, err := oh.Handle(bound) - if err != nil { - // respond with failure - context.Respond(w, r, route.Produces, route, err) - return - } - - // respond with success - context.Respond(w, r, route.Produces, route, result) - }) - - if len(schemes) > 0 { - handler = newSecureAPI(context, handler) - } - handlers[um][path] = handler - } - } - } - - return &routableUntypedAPI{ - api: api, - hlock: new(sync.Mutex), - handlers: handlers, - defaultProduces: api.DefaultProduces, - defaultConsumes: api.DefaultConsumes, - } -} - -func (r *routableUntypedAPI) HandlerFor(method, path string) (http.Handler, bool) { - r.hlock.Lock() - paths, ok := r.handlers[strings.ToUpper(method)] - if !ok { - r.hlock.Unlock() - return nil, false - } - handler, ok := paths[path] - r.hlock.Unlock() - return handler, ok -} -func (r *routableUntypedAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return r.api.ServeError -} -func (r *routableUntypedAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - return r.api.ConsumersFor(mediaTypes) -} -func (r *routableUntypedAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - return r.api.ProducersFor(mediaTypes) -} -func (r *routableUntypedAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return r.api.AuthenticatorsFor(schemes) -} -func (r *routableUntypedAPI) Authorizer() runtime.Authorizer { - return r.api.Authorizer() -} -func (r *routableUntypedAPI) Formats() strfmt.Registry { - return r.api.Formats() -} - -func (r *routableUntypedAPI) DefaultProduces() string { - return r.defaultProduces -} - -func (r *routableUntypedAPI) DefaultConsumes() string { - return r.defaultConsumes -} - -// NewRoutableContext creates a new context for a routable API -func NewRoutableContext(spec *loads.Document, routableAPI RoutableAPI, routes Router) *Context { - var an *analysis.Spec - if spec != nil { - an = analysis.New(spec.Spec()) - } - ctx := &Context{spec: spec, api: routableAPI, analyzer: an, router: routes} - return ctx -} - -// NewContext creates a new context wrapper -func NewContext(spec *loads.Document, api *untyped.API, routes Router) *Context { - var an *analysis.Spec - if spec != nil { - an = analysis.New(spec.Spec()) - } - ctx := &Context{spec: spec, analyzer: an} - ctx.api = newRoutableUntypedAPI(spec, api, ctx) - ctx.router = routes - return ctx -} - -// Serve serves the specified spec with the specified api registrations as a http.Handler -func Serve(spec *loads.Document, api *untyped.API) http.Handler { - return ServeWithBuilder(spec, api, PassthroughBuilder) -} - -// ServeWithBuilder serves the specified spec with the specified api registrations as a http.Handler that is decorated -// by the Builder -func ServeWithBuilder(spec *loads.Document, api *untyped.API, builder Builder) http.Handler { - context := NewContext(spec, api, nil) - return context.APIHandler(builder) -} - -type contextKey int8 - -const ( - _ contextKey = iota - ctxContentType - ctxResponseFormat - ctxMatchedRoute - ctxBoundParams - ctxSecurityPrincipal - ctxSecurityScopes -) - -// MatchedRouteFrom request context value. -func MatchedRouteFrom(req *http.Request) *MatchedRoute { - mr := req.Context().Value(ctxMatchedRoute) - if mr == nil { - return nil - } - if res, ok := mr.(*MatchedRoute); ok { - return res - } - return nil -} - -// SecurityPrincipalFrom request context value. -func SecurityPrincipalFrom(req *http.Request) interface{} { - return req.Context().Value(ctxSecurityPrincipal) -} - -// SecurityScopesFrom request context value. -func SecurityScopesFrom(req *http.Request) []string { - rs := req.Context().Value(ctxSecurityScopes) - if res, ok := rs.([]string); ok { - return res - } - return nil -} - -type contentTypeValue struct { - MediaType string - Charset string -} - -// BasePath returns the base path for this API -func (c *Context) BasePath() string { - return c.spec.BasePath() -} - -// RequiredProduces returns the accepted content types for responses -func (c *Context) RequiredProduces() []string { - return c.analyzer.RequiredProduces() -} - -// BindValidRequest binds a params object to a request but only when the request is valid -// if the request is not valid an error will be returned -func (c *Context) BindValidRequest(request *http.Request, route *MatchedRoute, binder RequestBinder) error { - var res []error - var requestContentType string - - // check and validate content type, select consumer - if runtime.HasBody(request) { - ct, _, err := runtime.ContentType(request.Header) - if err != nil { - res = append(res, err) - } else { - if err := validateContentType(route.Consumes, ct); err != nil { - res = append(res, err) - } - if len(res) == 0 { - cons, ok := route.Consumers[ct] - if !ok { - res = append(res, errors.New(500, "no consumer registered for %s", ct)) - } else { - route.Consumer = cons - requestContentType = ct - } - } - } - } - - // check and validate the response format - if len(res) == 0 { - // if the route does not provide Produces and a default contentType could not be identified - // based on a body, typical for GET and DELETE requests, then default contentType to. - if len(route.Produces) == 0 && requestContentType == "" { - requestContentType = "*/*" - } - - if str := NegotiateContentType(request, route.Produces, requestContentType); str == "" { - res = append(res, errors.InvalidResponseFormat(request.Header.Get(runtime.HeaderAccept), route.Produces)) - } - } - - // now bind the request with the provided binder - // it's assumed the binder will also validate the request and return an error if the - // request is invalid - if binder != nil && len(res) == 0 { - if err := binder.BindRequest(request, route); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContentType gets the parsed value of a content type -// Returns the media type, its charset and a shallow copy of the request -// when its context doesn't contain the content type value, otherwise it returns -// the same request -// Returns the error that runtime.ContentType may retunrs. -func (c *Context) ContentType(request *http.Request) (string, string, *http.Request, error) { - var rCtx = request.Context() - - if v, ok := rCtx.Value(ctxContentType).(*contentTypeValue); ok { - return v.MediaType, v.Charset, request, nil - } - - mt, cs, err := runtime.ContentType(request.Header) - if err != nil { - return "", "", nil, err - } - rCtx = stdContext.WithValue(rCtx, ctxContentType, &contentTypeValue{mt, cs}) - return mt, cs, request.WithContext(rCtx), nil -} - -// LookupRoute looks a route up and returns true when it is found -func (c *Context) LookupRoute(request *http.Request) (*MatchedRoute, bool) { - if route, ok := c.router.Lookup(request.Method, request.URL.EscapedPath()); ok { - return route, ok - } - return nil, false -} - -// RouteInfo tries to match a route for this request -// Returns the matched route, a shallow copy of the request if its context -// contains the matched router, otherwise the same request, and a bool to -// indicate if it the request matches one of the routes, if it doesn't -// then it returns false and nil for the other two return values -func (c *Context) RouteInfo(request *http.Request) (*MatchedRoute, *http.Request, bool) { - var rCtx = request.Context() - - if v, ok := rCtx.Value(ctxMatchedRoute).(*MatchedRoute); ok { - return v, request, ok - } - - if route, ok := c.LookupRoute(request); ok { - rCtx = stdContext.WithValue(rCtx, ctxMatchedRoute, route) - return route, request.WithContext(rCtx), ok - } - - return nil, nil, false -} - -// ResponseFormat negotiates the response content type -// Returns the response format and a shallow copy of the request if its context -// doesn't contain the response format, otherwise the same request -func (c *Context) ResponseFormat(r *http.Request, offers []string) (string, *http.Request) { - var rCtx = r.Context() - - if v, ok := rCtx.Value(ctxResponseFormat).(string); ok { - debugLog("[%s %s] found response format %q in context", r.Method, r.URL.Path, v) - return v, r - } - - format := NegotiateContentType(r, offers, "") - if format != "" { - debugLog("[%s %s] set response format %q in context", r.Method, r.URL.Path, format) - r = r.WithContext(stdContext.WithValue(rCtx, ctxResponseFormat, format)) - } - debugLog("[%s %s] negotiated response format %q", r.Method, r.URL.Path, format) - return format, r -} - -// AllowedMethods gets the allowed methods for the path of this request -func (c *Context) AllowedMethods(request *http.Request) []string { - return c.router.OtherMethods(request.Method, request.URL.EscapedPath()) -} - -// ResetAuth removes the current principal from the request context -func (c *Context) ResetAuth(request *http.Request) *http.Request { - rctx := request.Context() - rctx = stdContext.WithValue(rctx, ctxSecurityPrincipal, nil) - rctx = stdContext.WithValue(rctx, ctxSecurityScopes, nil) - return request.WithContext(rctx) -} - -// Authorize authorizes the request -// Returns the principal object and a shallow copy of the request when its -// context doesn't contain the principal, otherwise the same request or an error -// (the last) if one of the authenticators returns one or an Unauthenticated error -func (c *Context) Authorize(request *http.Request, route *MatchedRoute) (interface{}, *http.Request, error) { - if route == nil || !route.HasAuth() { - return nil, nil, nil - } - - var rCtx = request.Context() - if v := rCtx.Value(ctxSecurityPrincipal); v != nil { - return v, request, nil - } - - applies, usr, err := route.Authenticators.Authenticate(request, route) - if !applies || err != nil || !route.Authenticators.AllowsAnonymous() && usr == nil { - if err != nil { - return nil, nil, err - } - return nil, nil, errors.Unauthenticated("invalid credentials") - } - if route.Authorizer != nil { - if err := route.Authorizer.Authorize(request, usr); err != nil { - if _, ok := err.(errors.Error); ok { - return nil, nil, err - } - - return nil, nil, errors.New(http.StatusForbidden, err.Error()) - } - } - - rCtx = request.Context() - - rCtx = stdContext.WithValue(rCtx, ctxSecurityPrincipal, usr) - rCtx = stdContext.WithValue(rCtx, ctxSecurityScopes, route.Authenticator.AllScopes()) - return usr, request.WithContext(rCtx), nil -} - -// BindAndValidate binds and validates the request -// Returns the validation map and a shallow copy of the request when its context -// doesn't contain the validation, otherwise it returns the same request or an -// CompositeValidationError error -func (c *Context) BindAndValidate(request *http.Request, matched *MatchedRoute) (interface{}, *http.Request, error) { - var rCtx = request.Context() - - if v, ok := rCtx.Value(ctxBoundParams).(*validation); ok { - debugLog("got cached validation (valid: %t)", len(v.result) == 0) - if len(v.result) > 0 { - return v.bound, request, errors.CompositeValidationError(v.result...) - } - return v.bound, request, nil - } - result := validateRequest(c, request, matched) - rCtx = stdContext.WithValue(rCtx, ctxBoundParams, result) - request = request.WithContext(rCtx) - if len(result.result) > 0 { - return result.bound, request, errors.CompositeValidationError(result.result...) - } - debugLog("no validation errors found") - return result.bound, request, nil -} - -// NotFound the default not found responder for when no route has been matched yet -func (c *Context) NotFound(rw http.ResponseWriter, r *http.Request) { - c.Respond(rw, r, []string{c.api.DefaultProduces()}, nil, errors.NotFound("not found")) -} - -// Respond renders the response after doing some content negotiation -func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []string, route *MatchedRoute, data interface{}) { - debugLog("responding to %s %s with produces: %v", r.Method, r.URL.Path, produces) - offers := []string{} - for _, mt := range produces { - if mt != c.api.DefaultProduces() { - offers = append(offers, mt) - } - } - // the default producer is last so more specific producers take precedence - offers = append(offers, c.api.DefaultProduces()) - debugLog("offers: %v", offers) - - var format string - format, r = c.ResponseFormat(r, offers) - rw.Header().Set(runtime.HeaderContentType, format) - - if resp, ok := data.(Responder); ok { - producers := route.Producers - prod, ok := producers[format] - if !ok { - prods := c.api.ProducersFor(normalizeOffers([]string{c.api.DefaultProduces()})) - pr, ok := prods[c.api.DefaultProduces()] - if !ok { - panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format)) - } - prod = pr - } - resp.WriteResponse(rw, prod) - return - } - - if err, ok := data.(error); ok { - if format == "" { - rw.Header().Set(runtime.HeaderContentType, runtime.JSONMime) - } - - if realm := security.FailedBasicAuth(r); realm != "" { - rw.Header().Set("WWW-Authenticate", fmt.Sprintf("Basic realm=%q", realm)) - } - - if route == nil || route.Operation == nil { - c.api.ServeErrorFor("")(rw, r, err) - return - } - c.api.ServeErrorFor(route.Operation.ID)(rw, r, err) - return - } - - if route == nil || route.Operation == nil { - rw.WriteHeader(200) - if r.Method == "HEAD" { - return - } - producers := c.api.ProducersFor(normalizeOffers(offers)) - prod, ok := producers[format] - if !ok { - panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format)) - } - if err := prod.Produce(rw, data); err != nil { - panic(err) // let the recovery middleware deal with this - } - return - } - - if _, code, ok := route.Operation.SuccessResponse(); ok { - rw.WriteHeader(code) - if code == 204 || r.Method == "HEAD" { - return - } - - producers := route.Producers - prod, ok := producers[format] - if !ok { - if !ok { - prods := c.api.ProducersFor(normalizeOffers([]string{c.api.DefaultProduces()})) - pr, ok := prods[c.api.DefaultProduces()] - if !ok { - panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format)) - } - prod = pr - } - } - if err := prod.Produce(rw, data); err != nil { - panic(err) // let the recovery middleware deal with this - } - return - } - - c.api.ServeErrorFor(route.Operation.ID)(rw, r, errors.New(http.StatusInternalServerError, "can't produce response")) -} - -func (c *Context) APIHandlerSwaggerUI(builder Builder) http.Handler { - b := builder - if b == nil { - b = PassthroughBuilder - } - - var title string - sp := c.spec.Spec() - if sp != nil && sp.Info != nil && sp.Info.Title != "" { - title = sp.Info.Title - } - - swaggerUIOpts := SwaggerUIOpts{ - BasePath: c.BasePath(), - Title: title, - } - - return Spec("", c.spec.Raw(), SwaggerUI(swaggerUIOpts, c.RoutesHandler(b))) -} - -// APIHandler returns a handler to serve the API, this includes a swagger spec, router and the contract defined in the swagger spec -func (c *Context) APIHandler(builder Builder) http.Handler { - b := builder - if b == nil { - b = PassthroughBuilder - } - - var title string - sp := c.spec.Spec() - if sp != nil && sp.Info != nil && sp.Info.Title != "" { - title = sp.Info.Title - } - - redocOpts := RedocOpts{ - BasePath: c.BasePath(), - Title: title, - } - - return Spec("", c.spec.Raw(), Redoc(redocOpts, c.RoutesHandler(b))) -} - -// RoutesHandler returns a handler to serve the API, just the routes and the contract defined in the swagger spec -func (c *Context) RoutesHandler(builder Builder) http.Handler { - b := builder - if b == nil { - b = PassthroughBuilder - } - return NewRouter(c, b(NewOperationExecutor(c))) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE b/vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE deleted file mode 100644 index e65039a..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Naoya Inada - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/README.md b/vendor/github.com/go-openapi/runtime/middleware/denco/README.md deleted file mode 100644 index 30109e1..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/README.md +++ /dev/null @@ -1,180 +0,0 @@ -# Denco [![Build Status](https://travis-ci.org/naoina/denco.png?branch=master)](https://travis-ci.org/naoina/denco) - -The fast and flexible HTTP request router for [Go](http://golang.org). - -Denco is based on Double-Array implementation of [Kocha-urlrouter](https://github.com/naoina/kocha-urlrouter). -However, Denco is optimized and some features added. - -## Features - -* Fast (See [go-http-routing-benchmark](https://github.com/naoina/go-http-routing-benchmark)) -* [URL patterns](#url-patterns) (`/foo/:bar` and `/foo/*wildcard`) -* Small (but enough) URL router API -* HTTP request multiplexer like `http.ServeMux` - -## Installation - - go get -u github.com/go-openapi/runtime/middleware/denco - -## Using as HTTP request multiplexer - -```go -package main - -import ( - "fmt" - "log" - "net/http" - - "github.com/go-openapi/runtime/middleware/denco" -) - -func Index(w http.ResponseWriter, r *http.Request, params denco.Params) { - fmt.Fprintf(w, "Welcome to Denco!\n") -} - -func User(w http.ResponseWriter, r *http.Request, params denco.Params) { - fmt.Fprintf(w, "Hello %s!\n", params.Get("name")) -} - -func main() { - mux := denco.NewMux() - handler, err := mux.Build([]denco.Handler{ - mux.GET("/", Index), - mux.GET("/user/:name", User), - mux.POST("/user/:name", User), - }) - if err != nil { - panic(err) - } - log.Fatal(http.ListenAndServe(":8080", handler)) -} -``` - -## Using as URL router - -```go -package main - -import ( - "fmt" - - "github.com/go-openapi/runtime/middleware/denco" -) - -type route struct { - name string -} - -func main() { - router := denco.New() - router.Build([]denco.Record{ - {"/", &route{"root"}}, - {"/user/:id", &route{"user"}}, - {"/user/:name/:id", &route{"username"}}, - {"/static/*filepath", &route{"static"}}, - }) - - data, params, found := router.Lookup("/") - // print `&main.route{name:"root"}, denco.Params(nil), true`. - fmt.Printf("%#v, %#v, %#v\n", data, params, found) - - data, params, found = router.Lookup("/user/hoge") - // print `&main.route{name:"user"}, denco.Params{denco.Param{Name:"id", Value:"hoge"}}, true`. - fmt.Printf("%#v, %#v, %#v\n", data, params, found) - - data, params, found = router.Lookup("/user/hoge/7") - // print `&main.route{name:"username"}, denco.Params{denco.Param{Name:"name", Value:"hoge"}, denco.Param{Name:"id", Value:"7"}}, true`. - fmt.Printf("%#v, %#v, %#v\n", data, params, found) - - data, params, found = router.Lookup("/static/path/to/file") - // print `&main.route{name:"static"}, denco.Params{denco.Param{Name:"filepath", Value:"path/to/file"}}, true`. - fmt.Printf("%#v, %#v, %#v\n", data, params, found) -} -``` - -See [Godoc](http://godoc.org/github.com/go-openapi/runtime/middleware/denco) for more details. - -## Getting the value of path parameter - -You can get the value of path parameter by 2 ways. - -1. Using [`denco.Params.Get`](http://godoc.org/github.com/go-openapi/runtime/middleware/denco#Params.Get) method -2. Find by loop - -```go -package main - -import ( - "fmt" - - "github.com/go-openapi/runtime/middleware/denco" -) - -func main() { - router := denco.New() - if err := router.Build([]denco.Record{ - {"/user/:name/:id", "route1"}, - }); err != nil { - panic(err) - } - - // 1. Using denco.Params.Get method. - _, params, _ := router.Lookup("/user/alice/1") - name := params.Get("name") - if name != "" { - fmt.Printf("Hello %s.\n", name) // prints "Hello alice.". - } - - // 2. Find by loop. - for _, param := range params { - if param.Name == "name" { - fmt.Printf("Hello %s.\n", name) // prints "Hello alice.". - } - } -} -``` - -## URL patterns - -Denco's route matching strategy is "most nearly matching". - -When routes `/:name` and `/alice` have been built, URI `/alice` matches the route `/alice`, not `/:name`. -Because URI `/alice` is more match with the route `/alice` than `/:name`. - -For more example, when routes below have been built: - -``` -/user/alice -/user/:name -/user/:name/:id -/user/alice/:id -/user/:id/bob -``` - -Routes matching are: - -``` -/user/alice => "/user/alice" (no match with "/user/:name") -/user/bob => "/user/:name" -/user/naoina/1 => "/user/:name/1" -/user/alice/1 => "/user/alice/:id" (no match with "/user/:name/:id") -/user/1/bob => "/user/:id/bob" (no match with "/user/:name/:id") -/user/alice/bob => "/user/alice/:id" (no match with "/user/:name/:id" and "/user/:id/bob") -``` - -## Limitation - -Denco has some limitations below. - -* Number of param records (such as `/:name`) must be less than 2^22 -* Number of elements of internal slice must be less than 2^22 - -## Benchmarks - - cd $GOPATH/github.com/go-openapi/runtime/middleware/denco - go test -bench . -benchmem - -## License - -Denco is licensed under the MIT License. diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/router.go b/vendor/github.com/go-openapi/runtime/middleware/denco/router.go deleted file mode 100644 index 5d2691e..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/router.go +++ /dev/null @@ -1,460 +0,0 @@ -// Package denco provides fast URL router. -package denco - -import ( - "fmt" - "sort" - "strings" -) - -const ( - // ParamCharacter is a special character for path parameter. - ParamCharacter = ':' - - // WildcardCharacter is a special character for wildcard path parameter. - WildcardCharacter = '*' - - // TerminationCharacter is a special character for end of path. - TerminationCharacter = '#' - - // SeparatorCharacter separates path segments. - SeparatorCharacter = '/' - - // PathParamCharacter indicates a RESTCONF path param - PathParamCharacter = '=' - - // MaxSize is max size of records and internal slice. - MaxSize = (1 << 22) - 1 -) - -// Router represents a URL router. -type Router struct { - // SizeHint expects the maximum number of path parameters in records to Build. - // SizeHint will be used to determine the capacity of the memory to allocate. - // By default, SizeHint will be determined from given records to Build. - SizeHint int - - static map[string]interface{} - param *doubleArray -} - -// New returns a new Router. -func New() *Router { - return &Router{ - SizeHint: -1, - static: make(map[string]interface{}), - param: newDoubleArray(), - } -} - -// Lookup returns data and path parameters that associated with path. -// params is a slice of the Param that arranged in the order in which parameters appeared. -// e.g. when built routing path is "/path/to/:id/:name" and given path is "/path/to/1/alice". params order is [{"id": "1"}, {"name": "alice"}], not [{"name": "alice"}, {"id": "1"}]. -func (rt *Router) Lookup(path string) (data interface{}, params Params, found bool) { - if data, found := rt.static[path]; found { - return data, nil, true - } - if len(rt.param.node) == 1 { - return nil, nil, false - } - nd, params, found := rt.param.lookup(path, make([]Param, 0, rt.SizeHint), 1) - if !found { - return nil, nil, false - } - for i := 0; i < len(params); i++ { - params[i].Name = nd.paramNames[i] - } - return nd.data, params, true -} - -// Build builds URL router from records. -func (rt *Router) Build(records []Record) error { - statics, params := makeRecords(records) - if len(params) > MaxSize { - return fmt.Errorf("denco: too many records") - } - if rt.SizeHint < 0 { - rt.SizeHint = 0 - for _, p := range params { - size := 0 - for _, k := range p.Key { - if k == ParamCharacter || k == WildcardCharacter { - size++ - } - } - if size > rt.SizeHint { - rt.SizeHint = size - } - } - } - for _, r := range statics { - rt.static[r.Key] = r.Value - } - if err := rt.param.build(params, 1, 0, make(map[int]struct{})); err != nil { - return err - } - return nil -} - -// Param represents name and value of path parameter. -type Param struct { - Name string - Value string -} - -// Params represents the name and value of path parameters. -type Params []Param - -// Get gets the first value associated with the given name. -// If there are no values associated with the key, Get returns "". -func (ps Params) Get(name string) string { - for _, p := range ps { - if p.Name == name { - return p.Value - } - } - return "" -} - -type doubleArray struct { - bc []baseCheck - node []*node -} - -func newDoubleArray() *doubleArray { - return &doubleArray{ - bc: []baseCheck{0}, - node: []*node{nil}, // A start index is adjusting to 1 because 0 will be used as a mark of non-existent node. - } -} - -// baseCheck contains BASE, CHECK and Extra flags. -// From the top, 22bits of BASE, 2bits of Extra flags and 8bits of CHECK. -// -// BASE (22bit) | Extra flags (2bit) | CHECK (8bit) -// |----------------------|--|--------| -// 32 10 8 0 -type baseCheck uint32 - -func (bc baseCheck) Base() int { - return int(bc >> 10) -} - -func (bc *baseCheck) SetBase(base int) { - *bc |= baseCheck(base) << 10 -} - -func (bc baseCheck) Check() byte { - return byte(bc) -} - -func (bc *baseCheck) SetCheck(check byte) { - *bc |= baseCheck(check) -} - -func (bc baseCheck) IsEmpty() bool { - return bc&0xfffffcff == 0 -} - -func (bc baseCheck) IsSingleParam() bool { - return bc¶mTypeSingle == paramTypeSingle -} - -func (bc baseCheck) IsWildcardParam() bool { - return bc¶mTypeWildcard == paramTypeWildcard -} - -func (bc baseCheck) IsAnyParam() bool { - return bc¶mTypeAny != 0 -} - -func (bc *baseCheck) SetSingleParam() { - *bc |= (1 << 8) -} - -func (bc *baseCheck) SetWildcardParam() { - *bc |= (1 << 9) -} - -const ( - paramTypeSingle = 0x0100 - paramTypeWildcard = 0x0200 - paramTypeAny = 0x0300 -) - -func (da *doubleArray) lookup(path string, params []Param, idx int) (*node, []Param, bool) { - indices := make([]uint64, 0, 1) - for i := 0; i < len(path); i++ { - if da.bc[idx].IsAnyParam() { - indices = append(indices, (uint64(i)<<32)|(uint64(idx)&0xffffffff)) - } - c := path[i] - if idx = nextIndex(da.bc[idx].Base(), c); idx >= len(da.bc) || da.bc[idx].Check() != c { - goto BACKTRACKING - } - } - if next := nextIndex(da.bc[idx].Base(), TerminationCharacter); next < len(da.bc) && da.bc[next].Check() == TerminationCharacter { - return da.node[da.bc[next].Base()], params, true - } -BACKTRACKING: - for j := len(indices) - 1; j >= 0; j-- { - i, idx := int(indices[j]>>32), int(indices[j]&0xffffffff) - if da.bc[idx].IsSingleParam() { - idx := nextIndex(da.bc[idx].Base(), ParamCharacter) - if idx >= len(da.bc) { - break - } - next := NextSeparator(path, i) - params := append(params, Param{Value: path[i:next]}) - if nd, params, found := da.lookup(path[next:], params, idx); found { - return nd, params, true - } - } - if da.bc[idx].IsWildcardParam() { - idx := nextIndex(da.bc[idx].Base(), WildcardCharacter) - params := append(params, Param{Value: path[i:]}) - return da.node[da.bc[idx].Base()], params, true - } - } - return nil, nil, false -} - -// build builds double-array from records. -func (da *doubleArray) build(srcs []*record, idx, depth int, usedBase map[int]struct{}) error { - sort.Stable(recordSlice(srcs)) - base, siblings, leaf, err := da.arrange(srcs, idx, depth, usedBase) - if err != nil { - return err - } - if leaf != nil { - nd, err := makeNode(leaf) - if err != nil { - return err - } - da.bc[idx].SetBase(len(da.node)) - da.node = append(da.node, nd) - } - for _, sib := range siblings { - da.setCheck(nextIndex(base, sib.c), sib.c) - } - for _, sib := range siblings { - records := srcs[sib.start:sib.end] - switch sib.c { - case ParamCharacter: - for _, r := range records { - next := NextSeparator(r.Key, depth+1) - name := r.Key[depth+1 : next] - r.paramNames = append(r.paramNames, name) - r.Key = r.Key[next:] - } - da.bc[idx].SetSingleParam() - if err := da.build(records, nextIndex(base, sib.c), 0, usedBase); err != nil { - return err - } - case WildcardCharacter: - r := records[0] - name := r.Key[depth+1 : len(r.Key)-1] - r.paramNames = append(r.paramNames, name) - r.Key = "" - da.bc[idx].SetWildcardParam() - if err := da.build(records, nextIndex(base, sib.c), 0, usedBase); err != nil { - return err - } - default: - if err := da.build(records, nextIndex(base, sib.c), depth+1, usedBase); err != nil { - return err - } - } - } - return nil -} - -// setBase sets BASE. -func (da *doubleArray) setBase(i, base int) { - da.bc[i].SetBase(base) -} - -// setCheck sets CHECK. -func (da *doubleArray) setCheck(i int, check byte) { - da.bc[i].SetCheck(check) -} - -// findEmptyIndex returns an index of unused BASE/CHECK node. -func (da *doubleArray) findEmptyIndex(start int) int { - i := start - for ; i < len(da.bc); i++ { - if da.bc[i].IsEmpty() { - break - } - } - return i -} - -// findBase returns good BASE. -func (da *doubleArray) findBase(siblings []sibling, start int, usedBase map[int]struct{}) (base int) { - for idx, firstChar := start+1, siblings[0].c; ; idx = da.findEmptyIndex(idx + 1) { - base = nextIndex(idx, firstChar) - if _, used := usedBase[base]; used { - continue - } - i := 0 - for ; i < len(siblings); i++ { - next := nextIndex(base, siblings[i].c) - if len(da.bc) <= next { - da.bc = append(da.bc, make([]baseCheck, next-len(da.bc)+1)...) - } - if !da.bc[next].IsEmpty() { - break - } - } - if i == len(siblings) { - break - } - } - usedBase[base] = struct{}{} - return base -} - -func (da *doubleArray) arrange(records []*record, idx, depth int, usedBase map[int]struct{}) (base int, siblings []sibling, leaf *record, err error) { - siblings, leaf, err = makeSiblings(records, depth) - if err != nil { - return -1, nil, nil, err - } - if len(siblings) < 1 { - return -1, nil, leaf, nil - } - base = da.findBase(siblings, idx, usedBase) - if base > MaxSize { - return -1, nil, nil, fmt.Errorf("denco: too many elements of internal slice") - } - da.setBase(idx, base) - return base, siblings, leaf, err -} - -// node represents a node of Double-Array. -type node struct { - data interface{} - - // Names of path parameters. - paramNames []string -} - -// makeNode returns a new node from record. -func makeNode(r *record) (*node, error) { - dups := make(map[string]bool) - for _, name := range r.paramNames { - if dups[name] { - return nil, fmt.Errorf("denco: path parameter `%v' is duplicated in the key `%v'", name, r.Key) - } - dups[name] = true - } - return &node{data: r.Value, paramNames: r.paramNames}, nil -} - -// sibling represents an intermediate data of build for Double-Array. -type sibling struct { - // An index of start of duplicated characters. - start int - - // An index of end of duplicated characters. - end int - - // A character of sibling. - c byte -} - -// nextIndex returns a next index of array of BASE/CHECK. -func nextIndex(base int, c byte) int { - return base ^ int(c) -} - -// makeSiblings returns slice of sibling. -func makeSiblings(records []*record, depth int) (sib []sibling, leaf *record, err error) { - var ( - pc byte - n int - ) - for i, r := range records { - if len(r.Key) <= depth { - leaf = r - continue - } - c := r.Key[depth] - switch { - case pc < c: - sib = append(sib, sibling{start: i, c: c}) - case pc == c: - continue - default: - return nil, nil, fmt.Errorf("denco: BUG: routing table hasn't been sorted") - } - if n > 0 { - sib[n-1].end = i - } - pc = c - n++ - } - if n == 0 { - return nil, leaf, nil - } - sib[n-1].end = len(records) - return sib, leaf, nil -} - -// Record represents a record data for router construction. -type Record struct { - // Key for router construction. - Key string - - // Result value for Key. - Value interface{} -} - -// NewRecord returns a new Record. -func NewRecord(key string, value interface{}) Record { - return Record{ - Key: key, - Value: value, - } -} - -// record represents a record that use to build the Double-Array. -type record struct { - Record - paramNames []string -} - -// makeRecords returns the records that use to build Double-Arrays. -func makeRecords(srcs []Record) (statics, params []*record) { - termChar := string(TerminationCharacter) - paramPrefix := string(SeparatorCharacter) + string(ParamCharacter) - wildcardPrefix := string(SeparatorCharacter) + string(WildcardCharacter) - restconfPrefix := string(PathParamCharacter) + string(ParamCharacter) - for _, r := range srcs { - if strings.Contains(r.Key, paramPrefix) || strings.Contains(r.Key, wildcardPrefix) ||strings.Contains(r.Key, restconfPrefix){ - r.Key += termChar - params = append(params, &record{Record: r}) - } else { - statics = append(statics, &record{Record: r}) - } - } - return statics, params -} - -// recordSlice represents a slice of Record for sort and implements the sort.Interface. -type recordSlice []*record - -// Len implements the sort.Interface.Len. -func (rs recordSlice) Len() int { - return len(rs) -} - -// Less implements the sort.Interface.Less. -func (rs recordSlice) Less(i, j int) bool { - return rs[i].Key < rs[j].Key -} - -// Swap implements the sort.Interface.Swap. -func (rs recordSlice) Swap(i, j int) { - rs[i], rs[j] = rs[j], rs[i] -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/server.go b/vendor/github.com/go-openapi/runtime/middleware/denco/server.go deleted file mode 100644 index 0886713..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/server.go +++ /dev/null @@ -1,106 +0,0 @@ -package denco - -import ( - "net/http" -) - -// Mux represents a multiplexer for HTTP request. -type Mux struct{} - -// NewMux returns a new Mux. -func NewMux() *Mux { - return &Mux{} -} - -// GET is shorthand of Mux.Handler("GET", path, handler). -func (m *Mux) GET(path string, handler HandlerFunc) Handler { - return m.Handler("GET", path, handler) -} - -// POST is shorthand of Mux.Handler("POST", path, handler). -func (m *Mux) POST(path string, handler HandlerFunc) Handler { - return m.Handler("POST", path, handler) -} - -// PUT is shorthand of Mux.Handler("PUT", path, handler). -func (m *Mux) PUT(path string, handler HandlerFunc) Handler { - return m.Handler("PUT", path, handler) -} - -// HEAD is shorthand of Mux.Handler("HEAD", path, handler). -func (m *Mux) HEAD(path string, handler HandlerFunc) Handler { - return m.Handler("HEAD", path, handler) -} - -// Handler returns a handler for HTTP method. -func (m *Mux) Handler(method, path string, handler HandlerFunc) Handler { - return Handler{ - Method: method, - Path: path, - Func: handler, - } -} - -// Build builds a http.Handler. -func (m *Mux) Build(handlers []Handler) (http.Handler, error) { - recordMap := make(map[string][]Record) - for _, h := range handlers { - recordMap[h.Method] = append(recordMap[h.Method], NewRecord(h.Path, h.Func)) - } - mux := newServeMux() - for m, records := range recordMap { - router := New() - if err := router.Build(records); err != nil { - return nil, err - } - mux.routers[m] = router - } - return mux, nil -} - -// Handler represents a handler of HTTP request. -type Handler struct { - // Method is an HTTP method. - Method string - - // Path is a routing path for handler. - Path string - - // Func is a function of handler of HTTP request. - Func HandlerFunc -} - -// The HandlerFunc type is aliased to type of handler function. -type HandlerFunc func(w http.ResponseWriter, r *http.Request, params Params) - -type serveMux struct { - routers map[string]*Router -} - -func newServeMux() *serveMux { - return &serveMux{ - routers: make(map[string]*Router), - } -} - -// ServeHTTP implements http.Handler interface. -func (mux *serveMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { - handler, params := mux.handler(r.Method, r.URL.Path) - handler(w, r, params) -} - -func (mux *serveMux) handler(method, path string) (HandlerFunc, []Param) { - if router, found := mux.routers[method]; found { - if handler, params, found := router.Lookup(path); found { - return handler.(HandlerFunc), params - } - } - return NotFound, nil -} - -// NotFound replies to the request with an HTTP 404 not found error. -// NotFound is called when unknown HTTP method or a handler not found. -// If you want to use the your own NotFound handler, please overwrite this variable. -var NotFound = func(w http.ResponseWriter, r *http.Request, _ Params) { - http.NotFound(w, r) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/util.go b/vendor/github.com/go-openapi/runtime/middleware/denco/util.go deleted file mode 100644 index edc1f6a..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/util.go +++ /dev/null @@ -1,12 +0,0 @@ -package denco - -// NextSeparator returns an index of next separator in path. -func NextSeparator(path string, start int) int { - for start < len(path) { - if c := path[start]; c == '/' || c == TerminationCharacter { - break - } - start++ - } - return start -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/doc.go b/vendor/github.com/go-openapi/runtime/middleware/doc.go deleted file mode 100644 index eaf9060..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/doc.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*Package middleware provides the library with helper functions for serving swagger APIs. - -Pseudo middleware handler - - import ( - "net/http" - - "github.com/go-openapi/errors" - ) - - func newCompleteMiddleware(ctx *Context) http.Handler { - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - // use context to lookup routes - if matched, ok := ctx.RouteInfo(r); ok { - - if matched.NeedsAuth() { - if _, err := ctx.Authorize(r, matched); err != nil { - ctx.Respond(rw, r, matched.Produces, matched, err) - return - } - } - - bound, validation := ctx.BindAndValidate(r, matched) - if validation != nil { - ctx.Respond(rw, r, matched.Produces, matched, validation) - return - } - - result, err := matched.Handler.Handle(bound) - if err != nil { - ctx.Respond(rw, r, matched.Produces, matched, err) - return - } - - ctx.Respond(rw, r, matched.Produces, matched, result) - return - } - - // Not found, check if it exists in the other methods first - if others := ctx.AllowedMethods(r); len(others) > 0 { - ctx.Respond(rw, r, ctx.spec.RequiredProduces(), nil, errors.MethodNotAllowed(r.Method, others)) - return - } - ctx.Respond(rw, r, ctx.spec.RequiredProduces(), nil, errors.NotFound("path %s was not found", r.URL.Path)) - }) - } -*/ -package middleware diff --git a/vendor/github.com/go-openapi/runtime/middleware/go18.go b/vendor/github.com/go-openapi/runtime/middleware/go18.go deleted file mode 100644 index 75c762c..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/go18.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build go1.8 - -package middleware - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.PathUnescape(path) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/header/header.go b/vendor/github.com/go-openapi/runtime/middleware/header/header.go deleted file mode 100644 index 3e34225..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/header/header.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// this file was taken from the github.com/golang/gddo repository - -// Package header provides functions for parsing HTTP headers. -package header - -import ( - "net/http" - "strings" - "time" -) - -// Octet types from RFC 2616. -var octetTypes [256]octetType - -type octetType byte - -const ( - isToken octetType = 1 << iota - isSpace -) - -func init() { - // OCTET = - // CHAR = - // CTL = - // CR = - // LF = - // SP = - // HT = - // <"> = - // CRLF = CR LF - // LWS = [CRLF] 1*( SP | HT ) - // TEXT = - // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> - // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT - // token = 1* - // qdtext = > - - for c := 0; c < 256; c++ { - var t octetType - isCtl := c <= 31 || c == 127 - isChar := 0 <= c && c <= 127 - isSeparator := strings.ContainsRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) - if strings.ContainsRune(" \t\r\n", rune(c)) { - t |= isSpace - } - if isChar && !isCtl && !isSeparator { - t |= isToken - } - octetTypes[c] = t - } -} - -// Copy returns a shallow copy of the header. -func Copy(header http.Header) http.Header { - h := make(http.Header) - for k, vs := range header { - h[k] = vs - } - return h -} - -var timeLayouts = []string{"Mon, 02 Jan 2006 15:04:05 GMT", time.RFC850, time.ANSIC} - -// ParseTime parses the header as time. The zero value is returned if the -// header is not present or there is an error parsing the -// header. -func ParseTime(header http.Header, key string) time.Time { - if s := header.Get(key); s != "" { - for _, layout := range timeLayouts { - if t, err := time.Parse(layout, s); err == nil { - return t.UTC() - } - } - } - return time.Time{} -} - -// ParseList parses a comma separated list of values. Commas are ignored in -// quoted strings. Quoted values are not unescaped or unquoted. Whitespace is -// trimmed. -func ParseList(header http.Header, key string) []string { - var result []string - for _, s := range header[http.CanonicalHeaderKey(key)] { - begin := 0 - end := 0 - escape := false - quote := false - for i := 0; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - end = i + 1 - case quote: - switch b { - case '\\': - escape = true - case '"': - quote = false - } - end = i + 1 - case b == '"': - quote = true - end = i + 1 - case octetTypes[b]&isSpace != 0: - if begin == end { - begin = i + 1 - end = begin - } - case b == ',': - if begin < end { - result = append(result, s[begin:end]) - } - begin = i + 1 - end = begin - default: - end = i + 1 - } - } - if begin < end { - result = append(result, s[begin:end]) - } - } - return result -} - -// ParseValueAndParams parses a comma separated list of values with optional -// semicolon separated name-value pairs. Content-Type and Content-Disposition -// headers are in this format. -func ParseValueAndParams(header http.Header, key string) (string, map[string]string) { - return parseValueAndParams(header.Get(key)) -} - -func parseValueAndParams(s string) (value string, params map[string]string) { - params = make(map[string]string) - value, s = expectTokenSlash(s) - if value == "" { - return - } - value = strings.ToLower(value) - s = skipSpace(s) - for strings.HasPrefix(s, ";") { - var pkey string - pkey, s = expectToken(skipSpace(s[1:])) - if pkey == "" { - return - } - if !strings.HasPrefix(s, "=") { - return - } - var pvalue string - pvalue, s = expectTokenOrQuoted(s[1:]) - if pvalue == "" { - return - } - pkey = strings.ToLower(pkey) - params[pkey] = pvalue - s = skipSpace(s) - } - return -} - -// AcceptSpec ... -type AcceptSpec struct { - Value string - Q float64 -} - -// ParseAccept2 ... -func ParseAccept2(header http.Header, key string) (specs []AcceptSpec) { - for _, en := range ParseList(header, key) { - v, p := parseValueAndParams(en) - var spec AcceptSpec - spec.Value = v - spec.Q = 1.0 - if p != nil { - if q, ok := p["q"]; ok { - spec.Q, _ = expectQuality(q) - } - } - if spec.Q < 0.0 { - continue - } - specs = append(specs, spec) - } - - return -} - -// ParseAccept parses Accept* headers. -func ParseAccept(header http.Header, key string) (specs []AcceptSpec) { -loop: - for _, s := range header[key] { - for { - var spec AcceptSpec - spec.Value, s = expectTokenSlash(s) - if spec.Value == "" { - continue loop - } - spec.Q = 1.0 - s = skipSpace(s) - if strings.HasPrefix(s, ";") { - s = skipSpace(s[1:]) - for !strings.HasPrefix(s, "q=") && s != "" && !strings.HasPrefix(s, ",") { - s = skipSpace(s[1:]) - } - if strings.HasPrefix(s, "q=") { - spec.Q, s = expectQuality(s[2:]) - if spec.Q < 0.0 { - continue loop - } - } - } - specs = append(specs, spec) - s = skipSpace(s) - if !strings.HasPrefix(s, ",") { - continue loop - } - s = skipSpace(s[1:]) - } - } - return -} - -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isSpace == 0 { - break - } - } - return s[i:] -} - -func expectToken(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isToken == 0 { - break - } - } - return s[:i], s[i:] -} - -func expectTokenSlash(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - b := s[i] - if (octetTypes[b]&isToken == 0) && b != '/' { - break - } - } - return s[:i], s[i:] -} - -func expectQuality(s string) (q float64, rest string) { - switch { - case len(s) == 0: - return -1, "" - case s[0] == '0': - q = 0 - case s[0] == '1': - q = 1 - default: - return -1, "" - } - s = s[1:] - if !strings.HasPrefix(s, ".") { - return q, s - } - s = s[1:] - i := 0 - n := 0 - d := 1 - for ; i < len(s); i++ { - b := s[i] - if b < '0' || b > '9' { - break - } - n = n*10 + int(b) - '0' - d *= 10 - } - return q + float64(n)/float64(d), s[i:] -} - -func expectTokenOrQuoted(s string) (value string, rest string) { - if !strings.HasPrefix(s, "\"") { - return expectToken(s) - } - s = s[1:] - for i := 0; i < len(s); i++ { - switch s[i] { - case '"': - return s[:i], s[i+1:] - case '\\': - p := make([]byte, len(s)-1) - j := copy(p, s[:i]) - escape := true - for i = i + 1; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - p[j] = b - j++ - case b == '\\': - escape = true - case b == '"': - return string(p[:j]), s[i+1:] - default: - p[j] = b - j++ - } - } - return "", "" - } - } - return "", "" -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/negotiate.go b/vendor/github.com/go-openapi/runtime/middleware/negotiate.go deleted file mode 100644 index a9b6f27..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/negotiate.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// this file was taken from the github.com/golang/gddo repository - -package middleware - -import ( - "net/http" - "strings" - - "github.com/go-openapi/runtime/middleware/header" -) - -// NegotiateContentEncoding returns the best offered content encoding for the -// request's Accept-Encoding header. If two offers match with equal weight and -// then the offer earlier in the list is preferred. If no offers are -// acceptable, then "" is returned. -func NegotiateContentEncoding(r *http.Request, offers []string) string { - bestOffer := "identity" - bestQ := -1.0 - specs := header.ParseAccept(r.Header, "Accept-Encoding") - for _, offer := range offers { - for _, spec := range specs { - if spec.Q > bestQ && - (spec.Value == "*" || spec.Value == offer) { - bestQ = spec.Q - bestOffer = offer - } - } - } - if bestQ == 0 { - bestOffer = "" - } - return bestOffer -} - -// NegotiateContentType returns the best offered content type for the request's -// Accept header. If two offers match with equal weight, then the more specific -// offer is preferred. For example, text/* trumps */*. If two offers match -// with equal weight and specificity, then the offer earlier in the list is -// preferred. If no offers match, then defaultOffer is returned. -func NegotiateContentType(r *http.Request, offers []string, defaultOffer string) string { - bestOffer := defaultOffer - bestQ := -1.0 - bestWild := 3 - specs := header.ParseAccept(r.Header, "Accept") - for _, rawOffer := range offers { - offer := normalizeOffer(rawOffer) - // No Accept header: just return the first offer. - if len(specs) == 0 { - return rawOffer - } - for _, spec := range specs { - switch { - case spec.Q == 0.0: - // ignore - case spec.Q < bestQ: - // better match found - case spec.Value == "*/*": - if spec.Q > bestQ || bestWild > 2 { - bestQ = spec.Q - bestWild = 2 - bestOffer = rawOffer - } - case strings.HasSuffix(spec.Value, "/*"): - if strings.HasPrefix(offer, spec.Value[:len(spec.Value)-1]) && - (spec.Q > bestQ || bestWild > 1) { - bestQ = spec.Q - bestWild = 1 - bestOffer = rawOffer - } - default: - if spec.Value == offer && - (spec.Q > bestQ || bestWild > 0) { - bestQ = spec.Q - bestWild = 0 - bestOffer = rawOffer - } - } - } - } - return bestOffer -} - -func normalizeOffers(orig []string) (norm []string) { - for _, o := range orig { - norm = append(norm, normalizeOffer(o)) - } - return -} - -func normalizeOffer(orig string) string { - return strings.SplitN(orig, ";", 2)[0] -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/not_implemented.go b/vendor/github.com/go-openapi/runtime/middleware/not_implemented.go deleted file mode 100644 index bc6942a..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/not_implemented.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -type errorResp struct { - code int - response interface{} - headers http.Header -} - -func (e *errorResp) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - for k, v := range e.headers { - for _, val := range v { - rw.Header().Add(k, val) - } - } - if e.code > 0 { - rw.WriteHeader(e.code) - } else { - rw.WriteHeader(http.StatusInternalServerError) - } - if err := producer.Produce(rw, e.response); err != nil { - Logger.Printf("failed to write error response: %v", err) - } -} - -// NotImplemented the error response when the response is not implemented -func NotImplemented(message string) Responder { - return Error(http.StatusNotImplemented, message) -} - -// Error creates a generic responder for returning errors, the data will be serialized -// with the matching producer for the request -func Error(code int, data interface{}, headers ...http.Header) Responder { - var hdr http.Header - for _, h := range headers { - for k, v := range h { - if hdr == nil { - hdr = make(http.Header) - } - hdr[k] = v - } - } - return &errorResp{ - code: code, - response: data, - headers: hdr, - } -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/operation.go b/vendor/github.com/go-openapi/runtime/middleware/operation.go deleted file mode 100644 index 1175a63..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/operation.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import "net/http" - -// NewOperationExecutor creates a context aware middleware that handles the operations after routing -func NewOperationExecutor(ctx *Context) http.Handler { - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - // use context to lookup routes - route, rCtx, _ := ctx.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - - route.Handler.ServeHTTP(rw, r) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/parameter.go b/vendor/github.com/go-openapi/runtime/middleware/parameter.go deleted file mode 100644 index 8fa0cf4..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/parameter.go +++ /dev/null @@ -1,481 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "encoding" - "encoding/base64" - "fmt" - "io" - "net/http" - "reflect" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" - - "github.com/go-openapi/runtime" -) - -const defaultMaxMemory = 32 << 20 - -var textUnmarshalType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem() - -func newUntypedParamBinder(param spec.Parameter, spec *spec.Swagger, formats strfmt.Registry) *untypedParamBinder { - binder := new(untypedParamBinder) - binder.Name = param.Name - binder.parameter = ¶m - binder.formats = formats - if param.In != "body" { - binder.validator = validate.NewParamValidator(¶m, formats) - } else { - binder.validator = validate.NewSchemaValidator(param.Schema, spec, param.Name, formats) - } - - return binder -} - -type untypedParamBinder struct { - parameter *spec.Parameter - formats strfmt.Registry - Name string - validator validate.EntityValidator -} - -func (p *untypedParamBinder) Type() reflect.Type { - return p.typeForSchema(p.parameter.Type, p.parameter.Format, p.parameter.Items) -} - -func (p *untypedParamBinder) typeForSchema(tpe, format string, items *spec.Items) reflect.Type { - switch tpe { - case "boolean": - return reflect.TypeOf(true) - - case "string": - if tt, ok := p.formats.GetType(format); ok { - return tt - } - return reflect.TypeOf("") - - case "integer": - switch format { - case "int8": - return reflect.TypeOf(int8(0)) - case "int16": - return reflect.TypeOf(int16(0)) - case "int32": - return reflect.TypeOf(int32(0)) - case "int64": - return reflect.TypeOf(int64(0)) - default: - return reflect.TypeOf(int64(0)) - } - - case "number": - switch format { - case "float": - return reflect.TypeOf(float32(0)) - case "double": - return reflect.TypeOf(float64(0)) - } - - case "array": - if items == nil { - return nil - } - itemsType := p.typeForSchema(items.Type, items.Format, items.Items) - if itemsType == nil { - return nil - } - return reflect.MakeSlice(reflect.SliceOf(itemsType), 0, 0).Type() - - case "file": - return reflect.TypeOf(&runtime.File{}).Elem() - - case "object": - return reflect.TypeOf(map[string]interface{}{}) - } - return nil -} - -func (p *untypedParamBinder) allowsMulti() bool { - return p.parameter.In == "query" || p.parameter.In == "formData" -} - -func (p *untypedParamBinder) readValue(values runtime.Gettable, target reflect.Value) ([]string, bool, bool, error) { - name, in, cf, tpe := p.parameter.Name, p.parameter.In, p.parameter.CollectionFormat, p.parameter.Type - if tpe == "array" { - if cf == "multi" { - if !p.allowsMulti() { - return nil, false, false, errors.InvalidCollectionFormat(name, in, cf) - } - vv, hasKey, _ := values.GetOK(name) - return vv, false, hasKey, nil - } - - v, hk, hv := values.GetOK(name) - if !hv { - return nil, false, hk, nil - } - d, c, e := p.readFormattedSliceFieldValue(v[len(v)-1], target) - return d, c, hk, e - } - - vv, hk, _ := values.GetOK(name) - return vv, false, hk, nil -} - -func (p *untypedParamBinder) Bind(request *http.Request, routeParams RouteParams, consumer runtime.Consumer, target reflect.Value) error { - // fmt.Println("binding", p.name, "as", p.Type()) - switch p.parameter.In { - case "query": - data, custom, hasKey, err := p.readValue(runtime.Values(request.URL.Query()), target) - if err != nil { - return err - } - if custom { - return nil - } - - return p.bindValue(data, hasKey, target) - - case "header": - data, custom, hasKey, err := p.readValue(runtime.Values(request.Header), target) - if err != nil { - return err - } - if custom { - return nil - } - return p.bindValue(data, hasKey, target) - - case "path": - data, custom, hasKey, err := p.readValue(routeParams, target) - if err != nil { - return err - } - if custom { - return nil - } - return p.bindValue(data, hasKey, target) - - case "formData": - var err error - var mt string - - mt, _, e := runtime.ContentType(request.Header) - if e != nil { - // because of the interface conversion go thinks the error is not nil - // so we first check for nil and then set the err var if it's not nil - err = e - } - - if err != nil { - return errors.InvalidContentType("", []string{"multipart/form-data", "application/x-www-form-urlencoded"}) - } - - if mt != "multipart/form-data" && mt != "application/x-www-form-urlencoded" { - return errors.InvalidContentType(mt, []string{"multipart/form-data", "application/x-www-form-urlencoded"}) - } - - if mt == "multipart/form-data" { - if err = request.ParseMultipartForm(defaultMaxMemory); err != nil { - return errors.NewParseError(p.Name, p.parameter.In, "", err) - } - } - - if err = request.ParseForm(); err != nil { - return errors.NewParseError(p.Name, p.parameter.In, "", err) - } - - if p.parameter.Type == "file" { - file, header, ffErr := request.FormFile(p.parameter.Name) - if ffErr != nil { - return errors.NewParseError(p.Name, p.parameter.In, "", ffErr) - } - target.Set(reflect.ValueOf(runtime.File{Data: file, Header: header})) - return nil - } - - if request.MultipartForm != nil { - data, custom, hasKey, rvErr := p.readValue(runtime.Values(request.MultipartForm.Value), target) - if rvErr != nil { - return rvErr - } - if custom { - return nil - } - return p.bindValue(data, hasKey, target) - } - data, custom, hasKey, err := p.readValue(runtime.Values(request.PostForm), target) - if err != nil { - return err - } - if custom { - return nil - } - return p.bindValue(data, hasKey, target) - - case "body": - newValue := reflect.New(target.Type()) - if !runtime.HasBody(request) { - if p.parameter.Default != nil { - target.Set(reflect.ValueOf(p.parameter.Default)) - } - - return nil - } - if err := consumer.Consume(request.Body, newValue.Interface()); err != nil { - if err == io.EOF && p.parameter.Default != nil { - target.Set(reflect.ValueOf(p.parameter.Default)) - return nil - } - tpe := p.parameter.Type - if p.parameter.Format != "" { - tpe = p.parameter.Format - } - return errors.InvalidType(p.Name, p.parameter.In, tpe, nil) - } - target.Set(reflect.Indirect(newValue)) - return nil - default: - return errors.New(500, fmt.Sprintf("invalid parameter location %q", p.parameter.In)) - } -} - -func (p *untypedParamBinder) bindValue(data []string, hasKey bool, target reflect.Value) error { - if p.parameter.Type == "array" { - return p.setSliceFieldValue(target, p.parameter.Default, data, hasKey) - } - var d string - if len(data) > 0 { - d = data[len(data)-1] - } - return p.setFieldValue(target, p.parameter.Default, d, hasKey) -} - -func (p *untypedParamBinder) setFieldValue(target reflect.Value, defaultValue interface{}, data string, hasKey bool) error { - tpe := p.parameter.Type - if p.parameter.Format != "" { - tpe = p.parameter.Format - } - - if (!hasKey || (!p.parameter.AllowEmptyValue && data == "")) && p.parameter.Required && p.parameter.Default == nil { - return errors.Required(p.Name, p.parameter.In, data) - } - - ok, err := p.tryUnmarshaler(target, defaultValue, data) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if ok { - return nil - } - - defVal := reflect.Zero(target.Type()) - if defaultValue != nil { - defVal = reflect.ValueOf(defaultValue) - } - - if tpe == "byte" { - if data == "" { - if target.CanSet() { - target.SetBytes(defVal.Bytes()) - } - return nil - } - - b, err := base64.StdEncoding.DecodeString(data) - if err != nil { - b, err = base64.URLEncoding.DecodeString(data) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - } - if target.CanSet() { - target.SetBytes(b) - } - return nil - } - - switch target.Kind() { - case reflect.Bool: - if data == "" { - if target.CanSet() { - target.SetBool(defVal.Bool()) - } - return nil - } - b, err := swag.ConvertBool(data) - if err != nil { - return err - } - if target.CanSet() { - target.SetBool(b) - } - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - if data == "" { - if target.CanSet() { - rd := defVal.Convert(reflect.TypeOf(int64(0))) - target.SetInt(rd.Int()) - } - return nil - } - i, err := strconv.ParseInt(data, 10, 64) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.OverflowInt(i) { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.CanSet() { - target.SetInt(i) - } - - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - if data == "" { - if target.CanSet() { - rd := defVal.Convert(reflect.TypeOf(uint64(0))) - target.SetUint(rd.Uint()) - } - return nil - } - u, err := strconv.ParseUint(data, 10, 64) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.OverflowUint(u) { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.CanSet() { - target.SetUint(u) - } - - case reflect.Float32, reflect.Float64: - if data == "" { - if target.CanSet() { - rd := defVal.Convert(reflect.TypeOf(float64(0))) - target.SetFloat(rd.Float()) - } - return nil - } - f, err := strconv.ParseFloat(data, 64) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.OverflowFloat(f) { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.CanSet() { - target.SetFloat(f) - } - - case reflect.String: - value := data - if value == "" { - value = defVal.String() - } - // validate string - if target.CanSet() { - target.SetString(value) - } - - case reflect.Ptr: - if data == "" && defVal.Kind() == reflect.Ptr { - if target.CanSet() { - target.Set(defVal) - } - return nil - } - newVal := reflect.New(target.Type().Elem()) - if err := p.setFieldValue(reflect.Indirect(newVal), defVal, data, hasKey); err != nil { - return err - } - if target.CanSet() { - target.Set(newVal) - } - - default: - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - return nil -} - -func (p *untypedParamBinder) tryUnmarshaler(target reflect.Value, defaultValue interface{}, data string) (bool, error) { - if !target.CanSet() { - return false, nil - } - // When a type implements encoding.TextUnmarshaler we'll use that instead of reflecting some more - if reflect.PtrTo(target.Type()).Implements(textUnmarshalType) { - if defaultValue != nil && len(data) == 0 { - target.Set(reflect.ValueOf(defaultValue)) - return true, nil - } - value := reflect.New(target.Type()) - if err := value.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(data)); err != nil { - return true, err - } - target.Set(reflect.Indirect(value)) - return true, nil - } - return false, nil -} - -func (p *untypedParamBinder) readFormattedSliceFieldValue(data string, target reflect.Value) ([]string, bool, error) { - ok, err := p.tryUnmarshaler(target, p.parameter.Default, data) - if err != nil { - return nil, true, err - } - if ok { - return nil, true, nil - } - - return swag.SplitByFormat(data, p.parameter.CollectionFormat), false, nil -} - -func (p *untypedParamBinder) setSliceFieldValue(target reflect.Value, defaultValue interface{}, data []string, hasKey bool) error { - sz := len(data) - if (!hasKey || (!p.parameter.AllowEmptyValue && (sz == 0 || (sz == 1 && data[0] == "")))) && p.parameter.Required && defaultValue == nil { - return errors.Required(p.Name, p.parameter.In, data) - } - - defVal := reflect.Zero(target.Type()) - if defaultValue != nil { - defVal = reflect.ValueOf(defaultValue) - } - - if !target.CanSet() { - return nil - } - if sz == 0 { - target.Set(defVal) - return nil - } - - value := reflect.MakeSlice(reflect.SliceOf(target.Type().Elem()), sz, sz) - - for i := 0; i < sz; i++ { - if err := p.setFieldValue(value.Index(i), nil, data[i], hasKey); err != nil { - return err - } - } - - target.Set(value) - - return nil -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go b/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go deleted file mode 100644 index 0338525..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build !go1.8 - -package middleware - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.QueryUnescape(path) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go b/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go deleted file mode 100644 index 4be330d..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go +++ /dev/null @@ -1,90 +0,0 @@ -package middleware - -import ( - "bytes" - "fmt" - "html/template" - "net/http" - "path" -) - -// RapiDocOpts configures the RapiDoc middlewares -type RapiDocOpts struct { - // BasePath for the UI path, defaults to: / - BasePath string - // Path combines with BasePath for the full UI path, defaults to: docs - Path string - // SpecURL the url to find the spec for - SpecURL string - // RapiDocURL for the js that generates the rapidoc site, defaults to: https://cdn.jsdelivr.net/npm/rapidoc/bundles/rapidoc.standalone.js - RapiDocURL string - // Title for the documentation site, default to: API documentation - Title string -} - -// EnsureDefaults in case some options are missing -func (r *RapiDocOpts) EnsureDefaults() { - if r.BasePath == "" { - r.BasePath = "/" - } - if r.Path == "" { - r.Path = "docs" - } - if r.SpecURL == "" { - r.SpecURL = "/swagger.json" - } - if r.RapiDocURL == "" { - r.RapiDocURL = rapidocLatest - } - if r.Title == "" { - r.Title = "API documentation" - } -} - -// RapiDoc creates a middleware to serve a documentation site for a swagger spec. -// This allows for altering the spec before starting the http listener. -// -func RapiDoc(opts RapiDocOpts, next http.Handler) http.Handler { - opts.EnsureDefaults() - - pth := path.Join(opts.BasePath, opts.Path) - tmpl := template.Must(template.New("rapidoc").Parse(rapidocTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) -} - -const ( - rapidocLatest = "https://unpkg.com/rapidoc/dist/rapidoc-min.js" - rapidocTemplate = ` - - - {{ .Title }} - - - - - - - -` -) diff --git a/vendor/github.com/go-openapi/runtime/middleware/redoc.go b/vendor/github.com/go-openapi/runtime/middleware/redoc.go deleted file mode 100644 index 019c854..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/redoc.go +++ /dev/null @@ -1,103 +0,0 @@ -package middleware - -import ( - "bytes" - "fmt" - "html/template" - "net/http" - "path" -) - -// RedocOpts configures the Redoc middlewares -type RedocOpts struct { - // BasePath for the UI path, defaults to: / - BasePath string - // Path combines with BasePath for the full UI path, defaults to: docs - Path string - // SpecURL the url to find the spec for - SpecURL string - // RedocURL for the js that generates the redoc site, defaults to: https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js - RedocURL string - // Title for the documentation site, default to: API documentation - Title string -} - -// EnsureDefaults in case some options are missing -func (r *RedocOpts) EnsureDefaults() { - if r.BasePath == "" { - r.BasePath = "/" - } - if r.Path == "" { - r.Path = "docs" - } - if r.SpecURL == "" { - r.SpecURL = "/swagger.json" - } - if r.RedocURL == "" { - r.RedocURL = redocLatest - } - if r.Title == "" { - r.Title = "API documentation" - } -} - -// Redoc creates a middleware to serve a documentation site for a swagger spec. -// This allows for altering the spec before starting the http listener. -// -func Redoc(opts RedocOpts, next http.Handler) http.Handler { - opts.EnsureDefaults() - - pth := path.Join(opts.BasePath, opts.Path) - tmpl := template.Must(template.New("redoc").Parse(redocTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) -} - -const ( - redocLatest = "https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js" - redocTemplate = ` - - - {{ .Title }} - - - - - - - - - - - - - -` -) diff --git a/vendor/github.com/go-openapi/runtime/middleware/request.go b/vendor/github.com/go-openapi/runtime/middleware/request.go deleted file mode 100644 index 760c378..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/request.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "net/http" - "reflect" - - "github.com/go-openapi/errors" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" -) - -// UntypedRequestBinder binds and validates the data from a http request -type UntypedRequestBinder struct { - Spec *spec.Swagger - Parameters map[string]spec.Parameter - Formats strfmt.Registry - paramBinders map[string]*untypedParamBinder -} - -// NewUntypedRequestBinder creates a new binder for reading a request. -func NewUntypedRequestBinder(parameters map[string]spec.Parameter, spec *spec.Swagger, formats strfmt.Registry) *UntypedRequestBinder { - binders := make(map[string]*untypedParamBinder) - for fieldName, param := range parameters { - binders[fieldName] = newUntypedParamBinder(param, spec, formats) - } - return &UntypedRequestBinder{ - Parameters: parameters, - paramBinders: binders, - Spec: spec, - Formats: formats, - } -} - -// Bind perform the databinding and validation -func (o *UntypedRequestBinder) Bind(request *http.Request, routeParams RouteParams, consumer runtime.Consumer, data interface{}) error { - val := reflect.Indirect(reflect.ValueOf(data)) - isMap := val.Kind() == reflect.Map - var result []error - debugLog("binding %d parameters for %s %s", len(o.Parameters), request.Method, request.URL.EscapedPath()) - for fieldName, param := range o.Parameters { - binder := o.paramBinders[fieldName] - debugLog("binding parameter %s for %s %s", fieldName, request.Method, request.URL.EscapedPath()) - var target reflect.Value - if !isMap { - binder.Name = fieldName - target = val.FieldByName(fieldName) - } - - if isMap { - tpe := binder.Type() - if tpe == nil { - if param.Schema.Type.Contains("array") { - tpe = reflect.TypeOf([]interface{}{}) - } else { - tpe = reflect.TypeOf(map[string]interface{}{}) - } - } - target = reflect.Indirect(reflect.New(tpe)) - } - - if !target.IsValid() { - result = append(result, errors.New(500, "parameter name %q is an unknown field", binder.Name)) - continue - } - - if err := binder.Bind(request, routeParams, consumer, target); err != nil { - result = append(result, err) - continue - } - - if binder.validator != nil { - rr := binder.validator.Validate(target.Interface()) - if rr != nil && rr.HasErrors() { - result = append(result, rr.AsError()) - } - } - - if isMap { - val.SetMapIndex(reflect.ValueOf(param.Name), target) - } - } - - if len(result) > 0 { - return errors.CompositeValidationError(result...) - } - - return nil -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/router.go b/vendor/github.com/go-openapi/runtime/middleware/router.go deleted file mode 100644 index 5052031..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/router.go +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "fmt" - "net/http" - fpath "path" - "regexp" - "strings" - - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/swag" - - "github.com/go-openapi/analysis" - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware/denco" -) - -// RouteParam is a object to capture route params in a framework agnostic way. -// implementations of the muxer should use these route params to communicate with the -// swagger framework -type RouteParam struct { - Name string - Value string -} - -// RouteParams the collection of route params -type RouteParams []RouteParam - -// Get gets the value for the route param for the specified key -func (r RouteParams) Get(name string) string { - vv, _, _ := r.GetOK(name) - if len(vv) > 0 { - return vv[len(vv)-1] - } - return "" -} - -// GetOK gets the value but also returns booleans to indicate if a key or value -// is present. This aids in validation and satisfies an interface in use there -// -// The returned values are: data, has key, has value -func (r RouteParams) GetOK(name string) ([]string, bool, bool) { - for _, p := range r { - if p.Name == name { - return []string{p.Value}, true, p.Value != "" - } - } - return nil, false, false -} - -// NewRouter creates a new context aware router middleware -func NewRouter(ctx *Context, next http.Handler) http.Handler { - if ctx.router == nil { - ctx.router = DefaultRouter(ctx.spec, ctx.api) - } - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if _, rCtx, ok := ctx.RouteInfo(r); ok { - next.ServeHTTP(rw, rCtx) - return - } - - // Not found, check if it exists in the other methods first - if others := ctx.AllowedMethods(r); len(others) > 0 { - ctx.Respond(rw, r, ctx.analyzer.RequiredProduces(), nil, errors.MethodNotAllowed(r.Method, others)) - return - } - - ctx.Respond(rw, r, ctx.analyzer.RequiredProduces(), nil, errors.NotFound("path %s was not found", r.URL.EscapedPath())) - }) -} - -// RoutableAPI represents an interface for things that can serve -// as a provider of implementations for the swagger router -type RoutableAPI interface { - HandlerFor(string, string) (http.Handler, bool) - ServeErrorFor(string) func(http.ResponseWriter, *http.Request, error) - ConsumersFor([]string) map[string]runtime.Consumer - ProducersFor([]string) map[string]runtime.Producer - AuthenticatorsFor(map[string]spec.SecurityScheme) map[string]runtime.Authenticator - Authorizer() runtime.Authorizer - Formats() strfmt.Registry - DefaultProduces() string - DefaultConsumes() string -} - -// Router represents a swagger aware router -type Router interface { - Lookup(method, path string) (*MatchedRoute, bool) - OtherMethods(method, path string) []string -} - -type defaultRouteBuilder struct { - spec *loads.Document - analyzer *analysis.Spec - api RoutableAPI - records map[string][]denco.Record -} - -type defaultRouter struct { - spec *loads.Document - routers map[string]*denco.Router -} - -func newDefaultRouteBuilder(spec *loads.Document, api RoutableAPI) *defaultRouteBuilder { - return &defaultRouteBuilder{ - spec: spec, - analyzer: analysis.New(spec.Spec()), - api: api, - records: make(map[string][]denco.Record), - } -} - -// DefaultRouter creates a default implemenation of the router -func DefaultRouter(spec *loads.Document, api RoutableAPI) Router { - builder := newDefaultRouteBuilder(spec, api) - if spec != nil { - for method, paths := range builder.analyzer.Operations() { - for path, operation := range paths { - fp := fpath.Join(spec.BasePath(), path) - debugLog("adding route %s %s %q", method, fp, operation.ID) - builder.AddRoute(method, fp, operation) - } - } - } - return builder.Build() -} - -// RouteAuthenticator is an authenticator that can compose several authenticators together. -// It also knows when it contains an authenticator that allows for anonymous pass through. -// Contains a group of 1 or more authenticators that have a logical AND relationship -type RouteAuthenticator struct { - Authenticator map[string]runtime.Authenticator - Schemes []string - Scopes map[string][]string - allScopes []string - commonScopes []string - allowAnonymous bool -} - -func (ra *RouteAuthenticator) AllowsAnonymous() bool { - return ra.allowAnonymous -} - -// AllScopes returns a list of unique scopes that is the combination -// of all the scopes in the requirements -func (ra *RouteAuthenticator) AllScopes() []string { - return ra.allScopes -} - -// CommonScopes returns a list of unique scopes that are common in all the -// scopes in the requirements -func (ra *RouteAuthenticator) CommonScopes() []string { - return ra.commonScopes -} - -// Authenticate Authenticator interface implementation -func (ra *RouteAuthenticator) Authenticate(req *http.Request, route *MatchedRoute) (bool, interface{}, error) { - if ra.allowAnonymous { - route.Authenticator = ra - return true, nil, nil - } - // iterate in proper order - var lastResult interface{} - for _, scheme := range ra.Schemes { - if authenticator, ok := ra.Authenticator[scheme]; ok { - applies, princ, err := authenticator.Authenticate(&security.ScopedAuthRequest{ - Request: req, - RequiredScopes: ra.Scopes[scheme], - }) - if !applies { - return false, nil, nil - } - if err != nil { - route.Authenticator = ra - return true, nil, err - } - lastResult = princ - } - } - route.Authenticator = ra - return true, lastResult, nil -} - -func stringSliceUnion(slices ...[]string) []string { - unique := make(map[string]struct{}) - var result []string - for _, slice := range slices { - for _, entry := range slice { - if _, ok := unique[entry]; ok { - continue - } - unique[entry] = struct{}{} - result = append(result, entry) - } - } - return result -} - -func stringSliceIntersection(slices ...[]string) []string { - unique := make(map[string]int) - var intersection []string - - total := len(slices) - var emptyCnt int - for _, slice := range slices { - if len(slice) == 0 { - emptyCnt++ - continue - } - - for _, entry := range slice { - unique[entry]++ - if unique[entry] == total-emptyCnt { // this entry appeared in all the non-empty slices - intersection = append(intersection, entry) - } - } - } - - return intersection -} - -// RouteAuthenticators represents a group of authenticators that represent a logical OR -type RouteAuthenticators []RouteAuthenticator - -// AllowsAnonymous returns true when there is an authenticator that means optional auth -func (ras RouteAuthenticators) AllowsAnonymous() bool { - for _, ra := range ras { - if ra.AllowsAnonymous() { - return true - } - } - return false -} - -// Authenticate method implemention so this collection can be used as authenticator -func (ras RouteAuthenticators) Authenticate(req *http.Request, route *MatchedRoute) (bool, interface{}, error) { - var lastError error - var allowsAnon bool - var anonAuth RouteAuthenticator - - for _, ra := range ras { - if ra.AllowsAnonymous() { - anonAuth = ra - allowsAnon = true - continue - } - applies, usr, err := ra.Authenticate(req, route) - if !applies || err != nil || usr == nil { - if err != nil { - lastError = err - } - continue - } - return applies, usr, nil - } - - if allowsAnon && lastError == nil { - route.Authenticator = &anonAuth - return true, nil, lastError - } - return lastError != nil, nil, lastError -} - -type routeEntry struct { - PathPattern string - BasePath string - Operation *spec.Operation - Consumes []string - Consumers map[string]runtime.Consumer - Produces []string - Producers map[string]runtime.Producer - Parameters map[string]spec.Parameter - Handler http.Handler - Formats strfmt.Registry - Binder *UntypedRequestBinder - Authenticators RouteAuthenticators - Authorizer runtime.Authorizer -} - -// MatchedRoute represents the route that was matched in this request -type MatchedRoute struct { - routeEntry - Params RouteParams - Consumer runtime.Consumer - Producer runtime.Producer - Authenticator *RouteAuthenticator -} - -// HasAuth returns true when the route has a security requirement defined -func (m *MatchedRoute) HasAuth() bool { - return len(m.Authenticators) > 0 -} - -// NeedsAuth returns true when the request still -// needs to perform authentication -func (m *MatchedRoute) NeedsAuth() bool { - return m.HasAuth() && m.Authenticator == nil -} - -func (d *defaultRouter) Lookup(method, path string) (*MatchedRoute, bool) { - mth := strings.ToUpper(method) - debugLog("looking up route for %s %s", method, path) - if Debug { - if len(d.routers) == 0 { - debugLog("there are no known routers") - } - for meth := range d.routers { - debugLog("got a router for %s", meth) - } - } - if router, ok := d.routers[mth]; ok { - if m, rp, ok := router.Lookup(fpath.Clean(path)); ok && m != nil { - if entry, ok := m.(*routeEntry); ok { - debugLog("found a route for %s %s with %d parameters", method, path, len(entry.Parameters)) - var params RouteParams - for _, p := range rp { - v, err := pathUnescape(p.Value) - if err != nil { - debugLog("failed to escape %q: %v", p.Value, err) - v = p.Value - } - // a workaround to handle fragment/composing parameters until they are supported in denco router - // check if this parameter is a fragment within a path segment - if xpos := strings.Index(entry.PathPattern, fmt.Sprintf("{%s}", p.Name)) + len(p.Name) + 2; xpos < len(entry.PathPattern) && entry.PathPattern[xpos] != '/' { - // extract fragment parameters - ep := strings.Split(entry.PathPattern[xpos:], "/")[0] - pnames, pvalues := decodeCompositParams(p.Name, v, ep, nil, nil) - for i, pname := range pnames { - params = append(params, RouteParam{Name: pname, Value: pvalues[i]}) - } - } else { - // use the parameter directly - params = append(params, RouteParam{Name: p.Name, Value: v}) - } - } - return &MatchedRoute{routeEntry: *entry, Params: params}, true - } - } else { - debugLog("couldn't find a route by path for %s %s", method, path) - } - } else { - debugLog("couldn't find a route by method for %s %s", method, path) - } - return nil, false -} - -func (d *defaultRouter) OtherMethods(method, path string) []string { - mn := strings.ToUpper(method) - var methods []string - for k, v := range d.routers { - if k != mn { - if _, _, ok := v.Lookup(fpath.Clean(path)); ok { - methods = append(methods, k) - continue - } - } - } - return methods -} - -// convert swagger parameters per path segment into a denco parameter as multiple parameters per segment are not supported in denco -var pathConverter = regexp.MustCompile(`{(.+?)}([^/]*)`) - -func decodeCompositParams(name string, value string, pattern string, names []string, values []string) ([]string, []string) { - pleft := strings.Index(pattern, "{") - names = append(names, name) - if pleft < 0 { - if strings.HasSuffix(value, pattern) { - values = append(values, value[:len(value)-len(pattern)]) - } else { - values = append(values, "") - } - } else { - toskip := pattern[:pleft] - pright := strings.Index(pattern, "}") - vright := strings.Index(value, toskip) - if vright >= 0 { - values = append(values, value[:vright]) - } else { - values = append(values, "") - value = "" - } - return decodeCompositParams(pattern[pleft+1:pright], value[vright+len(toskip):], pattern[pright+1:], names, values) - } - return names, values -} - -func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Operation) { - mn := strings.ToUpper(method) - - bp := fpath.Clean(d.spec.BasePath()) - if len(bp) > 0 && bp[len(bp)-1] == '/' { - bp = bp[:len(bp)-1] - } - - debugLog("operation: %#v", *operation) - if handler, ok := d.api.HandlerFor(method, strings.TrimPrefix(path, bp)); ok { - consumes := d.analyzer.ConsumesFor(operation) - produces := d.analyzer.ProducesFor(operation) - parameters := d.analyzer.ParamsFor(method, strings.TrimPrefix(path, bp)) - - // add API defaults if not part of the spec - if defConsumes := d.api.DefaultConsumes(); defConsumes != "" && !swag.ContainsStringsCI(consumes, defConsumes) { - consumes = append(consumes, defConsumes) - } - - if defProduces := d.api.DefaultProduces(); defProduces != "" && !swag.ContainsStringsCI(produces, defProduces) { - produces = append(produces, defProduces) - } - - record := denco.NewRecord(pathConverter.ReplaceAllString(path, ":$1"), &routeEntry{ - BasePath: bp, - PathPattern: path, - Operation: operation, - Handler: handler, - Consumes: consumes, - Produces: produces, - Consumers: d.api.ConsumersFor(normalizeOffers(consumes)), - Producers: d.api.ProducersFor(normalizeOffers(produces)), - Parameters: parameters, - Formats: d.api.Formats(), - Binder: NewUntypedRequestBinder(parameters, d.spec.Spec(), d.api.Formats()), - Authenticators: d.buildAuthenticators(operation), - Authorizer: d.api.Authorizer(), - }) - d.records[mn] = append(d.records[mn], record) - } -} - -func (d *defaultRouteBuilder) buildAuthenticators(operation *spec.Operation) RouteAuthenticators { - requirements := d.analyzer.SecurityRequirementsFor(operation) - var auths []RouteAuthenticator - for _, reqs := range requirements { - var schemes []string - scopes := make(map[string][]string, len(reqs)) - var scopeSlices [][]string - for _, req := range reqs { - schemes = append(schemes, req.Name) - scopes[req.Name] = req.Scopes - scopeSlices = append(scopeSlices, req.Scopes) - } - - definitions := d.analyzer.SecurityDefinitionsForRequirements(reqs) - authenticators := d.api.AuthenticatorsFor(definitions) - auths = append(auths, RouteAuthenticator{ - Authenticator: authenticators, - Schemes: schemes, - Scopes: scopes, - allScopes: stringSliceUnion(scopeSlices...), - commonScopes: stringSliceIntersection(scopeSlices...), - allowAnonymous: len(reqs) == 1 && reqs[0].Name == "", - }) - } - return auths -} - -func (d *defaultRouteBuilder) Build() *defaultRouter { - routers := make(map[string]*denco.Router) - for method, records := range d.records { - router := denco.New() - _ = router.Build(records) - routers[method] = router - } - return &defaultRouter{ - spec: d.spec, - routers: routers, - } -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/security.go b/vendor/github.com/go-openapi/runtime/middleware/security.go deleted file mode 100644 index 2b061ca..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/security.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import "net/http" - -func newSecureAPI(ctx *Context, next http.Handler) http.Handler { - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := ctx.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - if route != nil && !route.NeedsAuth() { - next.ServeHTTP(rw, r) - return - } - - _, rCtx, err := ctx.Authorize(r, route) - if err != nil { - ctx.Respond(rw, r, route.Produces, route, err) - return - } - r = rCtx - - next.ServeHTTP(rw, r) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/spec.go b/vendor/github.com/go-openapi/runtime/middleware/spec.go deleted file mode 100644 index f029142..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/spec.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "net/http" - "path" -) - -// Spec creates a middleware to serve a swagger spec. -// This allows for altering the spec before starting the http listener. -// This can be useful if you want to serve the swagger spec from another path than /swagger.json -// -func Spec(basePath string, b []byte, next http.Handler) http.Handler { - if basePath == "" { - basePath = "/" - } - pth := path.Join(basePath, "swagger.json") - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(http.StatusOK) - //#nosec - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(http.StatusNotFound) - return - } - next.ServeHTTP(rw, r) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go b/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go deleted file mode 100644 index 2c92f5c..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go +++ /dev/null @@ -1,162 +0,0 @@ -package middleware - -import ( - "bytes" - "fmt" - "html/template" - "net/http" - "path" -) - -// SwaggerUIOpts configures the Swaggerui middlewares -type SwaggerUIOpts struct { - // BasePath for the UI path, defaults to: / - BasePath string - // Path combines with BasePath for the full UI path, defaults to: docs - Path string - // SpecURL the url to find the spec for - SpecURL string - - // The three components needed to embed swagger-ui - SwaggerURL string - SwaggerPresetURL string - SwaggerStylesURL string - - Favicon32 string - Favicon16 string - - // Title for the documentation site, default to: API documentation - Title string -} - -// EnsureDefaults in case some options are missing -func (r *SwaggerUIOpts) EnsureDefaults() { - if r.BasePath == "" { - r.BasePath = "/" - } - if r.Path == "" { - r.Path = "docs" - } - if r.SpecURL == "" { - r.SpecURL = "/swagger.json" - } - if r.SwaggerURL == "" { - r.SwaggerURL = swaggerLatest - } - if r.SwaggerPresetURL == "" { - r.SwaggerPresetURL = swaggerPresetLatest - } - if r.SwaggerStylesURL == "" { - r.SwaggerStylesURL = swaggerStylesLatest - } - if r.Favicon16 == "" { - r.Favicon16 = swaggerFavicon16Latest - } - if r.Favicon32 == "" { - r.Favicon32 = swaggerFavicon32Latest - } - if r.Title == "" { - r.Title = "API documentation" - } -} - -// SwaggerUI creates a middleware to serve a documentation site for a swagger spec. -// This allows for altering the spec before starting the http listener. -func SwaggerUI(opts SwaggerUIOpts, next http.Handler) http.Handler { - opts.EnsureDefaults() - - pth := path.Join(opts.BasePath, opts.Path) - tmpl := template.Must(template.New("swaggerui").Parse(swaggeruiTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, &opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) -} - -const ( - swaggerLatest = "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js" - swaggerPresetLatest = "https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js" - swaggerStylesLatest = "https://unpkg.com/swagger-ui-dist/swagger-ui.css" - swaggerFavicon32Latest = "https://unpkg.com/swagger-ui-dist/favicon-32x32.png" - swaggerFavicon16Latest = "https://unpkg.com/swagger-ui-dist/favicon-16x16.png" - swaggeruiTemplate = ` - - - - - {{ .Title }} - - - - - - - - -
- - - - - - -` -) diff --git a/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go b/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go deleted file mode 100644 index 39a85f7..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package untyped - -import ( - "fmt" - "net/http" - "sort" - "strings" - - "github.com/go-openapi/analysis" - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" -) - -// NewAPI creates the default untyped API -func NewAPI(spec *loads.Document) *API { - var an *analysis.Spec - if spec != nil && spec.Spec() != nil { - an = analysis.New(spec.Spec()) - } - api := &API{ - spec: spec, - analyzer: an, - consumers: make(map[string]runtime.Consumer, 10), - producers: make(map[string]runtime.Producer, 10), - authenticators: make(map[string]runtime.Authenticator), - operations: make(map[string]map[string]runtime.OperationHandler), - ServeError: errors.ServeError, - Models: make(map[string]func() interface{}), - formats: strfmt.NewFormats(), - } - return api.WithJSONDefaults() -} - -// API represents an untyped mux for a swagger spec -type API struct { - spec *loads.Document - analyzer *analysis.Spec - DefaultProduces string - DefaultConsumes string - consumers map[string]runtime.Consumer - producers map[string]runtime.Producer - authenticators map[string]runtime.Authenticator - authorizer runtime.Authorizer - operations map[string]map[string]runtime.OperationHandler - ServeError func(http.ResponseWriter, *http.Request, error) - Models map[string]func() interface{} - formats strfmt.Registry -} - -// WithJSONDefaults loads the json defaults for this api -func (d *API) WithJSONDefaults() *API { - d.DefaultConsumes = runtime.JSONMime - d.DefaultProduces = runtime.JSONMime - d.consumers[runtime.JSONMime] = runtime.JSONConsumer() - d.producers[runtime.JSONMime] = runtime.JSONProducer() - return d -} - -// WithoutJSONDefaults clears the json defaults for this api -func (d *API) WithoutJSONDefaults() *API { - d.DefaultConsumes = "" - d.DefaultProduces = "" - delete(d.consumers, runtime.JSONMime) - delete(d.producers, runtime.JSONMime) - return d -} - -// Formats returns the registered string formats -func (d *API) Formats() strfmt.Registry { - if d.formats == nil { - d.formats = strfmt.NewFormats() - } - return d.formats -} - -// RegisterFormat registers a custom format validator -func (d *API) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - if d.formats == nil { - d.formats = strfmt.NewFormats() - } - d.formats.Add(name, format, validator) -} - -// RegisterAuth registers an auth handler in this api -func (d *API) RegisterAuth(scheme string, handler runtime.Authenticator) { - if d.authenticators == nil { - d.authenticators = make(map[string]runtime.Authenticator) - } - d.authenticators[scheme] = handler -} - -// RegisterAuthorizer registers an authorizer handler in this api -func (d *API) RegisterAuthorizer(handler runtime.Authorizer) { - d.authorizer = handler -} - -// RegisterConsumer registers a consumer for a media type. -func (d *API) RegisterConsumer(mediaType string, handler runtime.Consumer) { - if d.consumers == nil { - d.consumers = make(map[string]runtime.Consumer, 10) - } - d.consumers[strings.ToLower(mediaType)] = handler -} - -// RegisterProducer registers a producer for a media type -func (d *API) RegisterProducer(mediaType string, handler runtime.Producer) { - if d.producers == nil { - d.producers = make(map[string]runtime.Producer, 10) - } - d.producers[strings.ToLower(mediaType)] = handler -} - -// RegisterOperation registers an operation handler for an operation name -func (d *API) RegisterOperation(method, path string, handler runtime.OperationHandler) { - if d.operations == nil { - d.operations = make(map[string]map[string]runtime.OperationHandler, 30) - } - um := strings.ToUpper(method) - if b, ok := d.operations[um]; !ok || b == nil { - d.operations[um] = make(map[string]runtime.OperationHandler) - } - d.operations[um][path] = handler -} - -// OperationHandlerFor returns the operation handler for the specified id if it can be found -func (d *API) OperationHandlerFor(method, path string) (runtime.OperationHandler, bool) { - if d.operations == nil { - return nil, false - } - if pi, ok := d.operations[strings.ToUpper(method)]; ok { - h, ok := pi[path] - return h, ok - } - return nil, false -} - -// ConsumersFor gets the consumers for the specified media types -func (d *API) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer) - for _, mt := range mediaTypes { - if consumer, ok := d.consumers[mt]; ok { - result[mt] = consumer - } - } - return result -} - -// ProducersFor gets the producers for the specified media types -func (d *API) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer) - for _, mt := range mediaTypes { - if producer, ok := d.producers[mt]; ok { - result[mt] = producer - } - } - return result -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (d *API) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - result := make(map[string]runtime.Authenticator) - for k := range schemes { - if a, ok := d.authenticators[k]; ok { - result[k] = a - } - } - return result -} - -// Authorizer returns the registered authorizer -func (d *API) Authorizer() runtime.Authorizer { - return d.authorizer -} - -// Validate validates this API for any missing items -func (d *API) Validate() error { - return d.validate() -} - -// validateWith validates the registrations in this API against the provided spec analyzer -func (d *API) validate() error { - var consumes []string - for k := range d.consumers { - consumes = append(consumes, k) - } - - var produces []string - for k := range d.producers { - produces = append(produces, k) - } - - var authenticators []string - for k := range d.authenticators { - authenticators = append(authenticators, k) - } - - var operations []string - for m, v := range d.operations { - for p := range v { - operations = append(operations, fmt.Sprintf("%s %s", strings.ToUpper(m), p)) - } - } - - var definedAuths []string - for k := range d.spec.Spec().SecurityDefinitions { - definedAuths = append(definedAuths, k) - } - - if err := d.verify("consumes", consumes, d.analyzer.RequiredConsumes()); err != nil { - return err - } - if err := d.verify("produces", produces, d.analyzer.RequiredProduces()); err != nil { - return err - } - if err := d.verify("operation", operations, d.analyzer.OperationMethodPaths()); err != nil { - return err - } - - requiredAuths := d.analyzer.RequiredSecuritySchemes() - if err := d.verify("auth scheme", authenticators, requiredAuths); err != nil { - return err - } - if err := d.verify("security definitions", definedAuths, requiredAuths); err != nil { - return err - } - return nil -} - -func (d *API) verify(name string, registrations []string, expectations []string) error { - sort.Strings(registrations) - sort.Strings(expectations) - - expected := map[string]struct{}{} - seen := map[string]struct{}{} - - for _, v := range expectations { - expected[v] = struct{}{} - } - - var unspecified []string - for _, v := range registrations { - seen[v] = struct{}{} - if _, ok := expected[v]; !ok { - unspecified = append(unspecified, v) - } - } - - for k := range seen { - delete(expected, k) - } - - var unregistered []string - for k := range expected { - unregistered = append(unregistered, k) - } - sort.Strings(unspecified) - sort.Strings(unregistered) - - if len(unregistered) > 0 || len(unspecified) > 0 { - return &errors.APIVerificationFailed{ - Section: name, - MissingSpecification: unspecified, - MissingRegistration: unregistered, - } - } - - return nil -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/validation.go b/vendor/github.com/go-openapi/runtime/middleware/validation.go deleted file mode 100644 index 1f0135b..0000000 --- a/vendor/github.com/go-openapi/runtime/middleware/validation.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "mime" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - - "github.com/go-openapi/runtime" -) - -type validation struct { - context *Context - result []error - request *http.Request - route *MatchedRoute - bound map[string]interface{} -} - -// ContentType validates the content type of a request -func validateContentType(allowed []string, actual string) error { - debugLog("validating content type for %q against [%s]", actual, strings.Join(allowed, ", ")) - if len(allowed) == 0 { - return nil - } - mt, _, err := mime.ParseMediaType(actual) - if err != nil { - return errors.InvalidContentType(actual, allowed) - } - if swag.ContainsStringsCI(allowed, mt) { - return nil - } - if swag.ContainsStringsCI(allowed, "*/*") { - return nil - } - parts := strings.Split(actual, "/") - if len(parts) == 2 && swag.ContainsStringsCI(allowed, parts[0]+"/*") { - return nil - } - return errors.InvalidContentType(actual, allowed) -} - -func validateRequest(ctx *Context, request *http.Request, route *MatchedRoute) *validation { - debugLog("validating request %s %s", request.Method, request.URL.EscapedPath()) - validate := &validation{ - context: ctx, - request: request, - route: route, - bound: make(map[string]interface{}), - } - - validate.contentType() - if len(validate.result) == 0 { - validate.responseFormat() - } - if len(validate.result) == 0 { - validate.parameters() - } - - return validate -} - -func (v *validation) parameters() { - debugLog("validating request parameters for %s %s", v.request.Method, v.request.URL.EscapedPath()) - if result := v.route.Binder.Bind(v.request, v.route.Params, v.route.Consumer, v.bound); result != nil { - if result.Error() == "validation failure list" { - for _, e := range result.(*errors.Validation).Value.([]interface{}) { - v.result = append(v.result, e.(error)) - } - return - } - v.result = append(v.result, result) - } -} - -func (v *validation) contentType() { - if len(v.result) == 0 && runtime.HasBody(v.request) { - debugLog("validating body content type for %s %s", v.request.Method, v.request.URL.EscapedPath()) - ct, _, req, err := v.context.ContentType(v.request) - if err != nil { - v.result = append(v.result, err) - } else { - v.request = req - } - - if len(v.result) == 0 { - if err := validateContentType(v.route.Consumes, ct); err != nil { - v.result = append(v.result, err) - } - } - if ct != "" && v.route.Consumer == nil { - cons, ok := v.route.Consumers[ct] - if !ok { - v.result = append(v.result, errors.New(500, "no consumer registered for %s", ct)) - } else { - v.route.Consumer = cons - } - } - } -} - -func (v *validation) responseFormat() { - // if the route provides values for Produces and no format could be identify then return an error. - // if the route does not specify values for Produces then treat request as valid since the API designer - // choose not to specify the format for responses. - if str, rCtx := v.context.ResponseFormat(v.request, v.route.Produces); str == "" && len(v.route.Produces) > 0 { - v.request = rCtx - v.result = append(v.result, errors.InvalidResponseFormat(v.request.Header.Get(runtime.HeaderAccept), v.route.Produces)) - } -} diff --git a/vendor/github.com/go-openapi/runtime/request.go b/vendor/github.com/go-openapi/runtime/request.go deleted file mode 100644 index 9e51b42..0000000 --- a/vendor/github.com/go-openapi/runtime/request.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "bufio" - "io" - "net/http" - "strings" - - "github.com/go-openapi/swag" -) - -// CanHaveBody returns true if this method can have a body -func CanHaveBody(method string) bool { - mn := strings.ToUpper(method) - return mn == "POST" || mn == "PUT" || mn == "PATCH" || mn == "DELETE" -} - -// IsSafe returns true if this is a request with a safe method -func IsSafe(r *http.Request) bool { - mn := strings.ToUpper(r.Method) - return mn == "GET" || mn == "HEAD" -} - -// AllowsBody returns true if the request allows for a body -func AllowsBody(r *http.Request) bool { - mn := strings.ToUpper(r.Method) - return mn != "HEAD" -} - -// HasBody returns true if this method needs a content-type -func HasBody(r *http.Request) bool { - // happy case: we have a content length set - if r.ContentLength > 0 { - return true - } - - if r.Header.Get(http.CanonicalHeaderKey("content-length")) != "" { - // in this case, no Transfer-Encoding should be present - // we have a header set but it was explicitly set to 0, so we assume no body - return false - } - - rdr := newPeekingReader(r.Body) - r.Body = rdr - return rdr.HasContent() -} - -func newPeekingReader(r io.ReadCloser) *peekingReader { - if r == nil { - return nil - } - return &peekingReader{ - underlying: bufio.NewReader(r), - orig: r, - } -} - -type peekingReader struct { - underlying interface { - Buffered() int - Peek(int) ([]byte, error) - Read([]byte) (int, error) - } - orig io.ReadCloser -} - -func (p *peekingReader) HasContent() bool { - if p == nil { - return false - } - if p.underlying.Buffered() > 0 { - return true - } - b, err := p.underlying.Peek(1) - if err != nil { - return false - } - return len(b) > 0 -} - -func (p *peekingReader) Read(d []byte) (int, error) { - if p == nil { - return 0, io.EOF - } - return p.underlying.Read(d) -} - -func (p *peekingReader) Close() error { - p.underlying = nil - if p.orig != nil { - return p.orig.Close() - } - return nil -} - -// JSONRequest creates a new http request with json headers set -func JSONRequest(method, urlStr string, body io.Reader) (*http.Request, error) { - req, err := http.NewRequest(method, urlStr, body) - if err != nil { - return nil, err - } - req.Header.Add(HeaderContentType, JSONMime) - req.Header.Add(HeaderAccept, JSONMime) - return req, nil -} - -// Gettable for things with a method GetOK(string) (data string, hasKey bool, hasValue bool) -type Gettable interface { - GetOK(string) ([]string, bool, bool) -} - -// ReadSingleValue reads a single value from the source -func ReadSingleValue(values Gettable, name string) string { - vv, _, hv := values.GetOK(name) - if hv { - return vv[len(vv)-1] - } - return "" -} - -// ReadCollectionValue reads a collection value from a string data source -func ReadCollectionValue(values Gettable, name, collectionFormat string) []string { - v := ReadSingleValue(values, name) - return swag.SplitByFormat(v, collectionFormat) -} diff --git a/vendor/github.com/go-openapi/runtime/security/authenticator.go b/vendor/github.com/go-openapi/runtime/security/authenticator.go deleted file mode 100644 index 476d26c..0000000 --- a/vendor/github.com/go-openapi/runtime/security/authenticator.go +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package security - -import ( - "context" - "net/http" - "strings" - - "github.com/go-openapi/errors" - - "github.com/go-openapi/runtime" -) - -const ( - query = "query" - header = "header" -) - -// HttpAuthenticator is a function that authenticates a HTTP request -func HttpAuthenticator(handler func(*http.Request) (bool, interface{}, error)) runtime.Authenticator { - return runtime.AuthenticatorFunc(func(params interface{}) (bool, interface{}, error) { - if request, ok := params.(*http.Request); ok { - return handler(request) - } - if scoped, ok := params.(*ScopedAuthRequest); ok { - return handler(scoped.Request) - } - return false, nil, nil - }) -} - -// ScopedAuthenticator is a function that authenticates a HTTP request against a list of valid scopes -func ScopedAuthenticator(handler func(*ScopedAuthRequest) (bool, interface{}, error)) runtime.Authenticator { - return runtime.AuthenticatorFunc(func(params interface{}) (bool, interface{}, error) { - if request, ok := params.(*ScopedAuthRequest); ok { - return handler(request) - } - return false, nil, nil - }) -} - -// UserPassAuthentication authentication function -type UserPassAuthentication func(string, string) (interface{}, error) - -// UserPassAuthenticationCtx authentication function with context.Context -type UserPassAuthenticationCtx func(context.Context, string, string) (context.Context, interface{}, error) - -// TokenAuthentication authentication function -type TokenAuthentication func(string) (interface{}, error) - -// TokenAuthenticationCtx authentication function with context.Context -type TokenAuthenticationCtx func(context.Context, string) (context.Context, interface{}, error) - -// ScopedTokenAuthentication authentication function -type ScopedTokenAuthentication func(string, []string) (interface{}, error) - -// ScopedTokenAuthenticationCtx authentication function with context.Context -type ScopedTokenAuthenticationCtx func(context.Context, string, []string) (context.Context, interface{}, error) - -var DefaultRealmName = "API" - -type secCtxKey uint8 - -const ( - failedBasicAuth secCtxKey = iota - oauth2SchemeName -) - -func FailedBasicAuth(r *http.Request) string { - return FailedBasicAuthCtx(r.Context()) -} - -func FailedBasicAuthCtx(ctx context.Context) string { - v, ok := ctx.Value(failedBasicAuth).(string) - if !ok { - return "" - } - return v -} - -func OAuth2SchemeName(r *http.Request) string { - return OAuth2SchemeNameCtx(r.Context()) -} - -func OAuth2SchemeNameCtx(ctx context.Context) string { - v, ok := ctx.Value(oauth2SchemeName).(string) - if !ok { - return "" - } - return v -} - -// BasicAuth creates a basic auth authenticator with the provided authentication function -func BasicAuth(authenticate UserPassAuthentication) runtime.Authenticator { - return BasicAuthRealm(DefaultRealmName, authenticate) -} - -// BasicAuthRealm creates a basic auth authenticator with the provided authentication function and realm name -func BasicAuthRealm(realm string, authenticate UserPassAuthentication) runtime.Authenticator { - if realm == "" { - realm = DefaultRealmName - } - - return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { - if usr, pass, ok := r.BasicAuth(); ok { - p, err := authenticate(usr, pass) - if err != nil { - *r = *r.WithContext(context.WithValue(r.Context(), failedBasicAuth, realm)) - } - return true, p, err - } - *r = *r.WithContext(context.WithValue(r.Context(), failedBasicAuth, realm)) - return false, nil, nil - }) -} - -// BasicAuthCtx creates a basic auth authenticator with the provided authentication function with support for context.Context -func BasicAuthCtx(authenticate UserPassAuthenticationCtx) runtime.Authenticator { - return BasicAuthRealmCtx(DefaultRealmName, authenticate) -} - -// BasicAuthRealmCtx creates a basic auth authenticator with the provided authentication function and realm name with support for context.Context -func BasicAuthRealmCtx(realm string, authenticate UserPassAuthenticationCtx) runtime.Authenticator { - if realm == "" { - realm = DefaultRealmName - } - - return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { - if usr, pass, ok := r.BasicAuth(); ok { - ctx, p, err := authenticate(r.Context(), usr, pass) - if err != nil { - ctx = context.WithValue(ctx, failedBasicAuth, realm) - } - *r = *r.WithContext(ctx) - return true, p, err - } - *r = *r.WithContext(context.WithValue(r.Context(), failedBasicAuth, realm)) - return false, nil, nil - }) -} - -// APIKeyAuth creates an authenticator that uses a token for authorization. -// This token can be obtained from either a header or a query string -func APIKeyAuth(name, in string, authenticate TokenAuthentication) runtime.Authenticator { - inl := strings.ToLower(in) - if inl != query && inl != header { - // panic because this is most likely a typo - panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\".")) - } - - var getToken func(*http.Request) string - switch inl { - case header: - getToken = func(r *http.Request) string { return r.Header.Get(name) } - case query: - getToken = func(r *http.Request) string { return r.URL.Query().Get(name) } - } - - return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { - token := getToken(r) - if token == "" { - return false, nil, nil - } - - p, err := authenticate(token) - return true, p, err - }) -} - -// APIKeyAuthCtx creates an authenticator that uses a token for authorization with support for context.Context. -// This token can be obtained from either a header or a query string -func APIKeyAuthCtx(name, in string, authenticate TokenAuthenticationCtx) runtime.Authenticator { - inl := strings.ToLower(in) - if inl != query && inl != header { - // panic because this is most likely a typo - panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\".")) - } - - var getToken func(*http.Request) string - switch inl { - case header: - getToken = func(r *http.Request) string { return r.Header.Get(name) } - case query: - getToken = func(r *http.Request) string { return r.URL.Query().Get(name) } - } - - return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { - token := getToken(r) - if token == "" { - return false, nil, nil - } - - ctx, p, err := authenticate(r.Context(), token) - *r = *r.WithContext(ctx) - return true, p, err - }) -} - -// ScopedAuthRequest contains both a http request and the required scopes for a particular operation -type ScopedAuthRequest struct { - Request *http.Request - RequiredScopes []string -} - -// BearerAuth for use with oauth2 flows -func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Authenticator { - const prefix = "Bearer " - return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { - var token string - hdr := r.Request.Header.Get("Authorization") - if strings.HasPrefix(hdr, prefix) { - token = strings.TrimPrefix(hdr, prefix) - } - if token == "" { - qs := r.Request.URL.Query() - token = qs.Get("access_token") - } - //#nosec - ct, _, _ := runtime.ContentType(r.Request.Header) - if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") { - token = r.Request.FormValue("access_token") - } - - if token == "" { - return false, nil, nil - } - - rctx := context.WithValue(r.Request.Context(), oauth2SchemeName, name) - *r.Request = *r.Request.WithContext(rctx) - p, err := authenticate(token, r.RequiredScopes) - return true, p, err - }) -} - -// BearerAuthCtx for use with oauth2 flows with support for context.Context. -func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runtime.Authenticator { - const prefix = "Bearer " - return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { - var token string - hdr := r.Request.Header.Get("Authorization") - if strings.HasPrefix(hdr, prefix) { - token = strings.TrimPrefix(hdr, prefix) - } - if token == "" { - qs := r.Request.URL.Query() - token = qs.Get("access_token") - } - //#nosec - ct, _, _ := runtime.ContentType(r.Request.Header) - if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") { - token = r.Request.FormValue("access_token") - } - - if token == "" { - return false, nil, nil - } - - rctx := context.WithValue(r.Request.Context(), oauth2SchemeName, name) - ctx, p, err := authenticate(rctx, token, r.RequiredScopes) - *r.Request = *r.Request.WithContext(ctx) - return true, p, err - }) -} diff --git a/vendor/github.com/go-openapi/runtime/security/authorizer.go b/vendor/github.com/go-openapi/runtime/security/authorizer.go deleted file mode 100644 index 00c1a4d..0000000 --- a/vendor/github.com/go-openapi/runtime/security/authorizer.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package security - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -// Authorized provides a default implementation of the Authorizer interface where all -// requests are authorized (successful) -func Authorized() runtime.Authorizer { - return runtime.AuthorizerFunc(func(_ *http.Request, _ interface{}) error { return nil }) -} diff --git a/vendor/github.com/go-openapi/runtime/statuses.go b/vendor/github.com/go-openapi/runtime/statuses.go deleted file mode 100644 index 3b011a0..0000000 --- a/vendor/github.com/go-openapi/runtime/statuses.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -// Statuses lists the most common HTTP status codes to default message -// taken from https://httpstatuses.com/ -var Statuses = map[int]string{ - 100: "Continue", - 101: "Switching Protocols", - 102: "Processing", - 103: "Checkpoint", - 122: "URI too long", - 200: "OK", - 201: "Created", - 202: "Accepted", - 203: "Request Processed", - 204: "No Content", - 205: "Reset Content", - 206: "Partial Content", - 207: "Multi-Status", - 208: "Already Reported", - 226: "IM Used", - 300: "Multiple Choices", - 301: "Moved Permanently", - 302: "Found", - 303: "See Other", - 304: "Not Modified", - 305: "Use Proxy", - 306: "Switch Proxy", - 307: "Temporary Redirect", - 308: "Permanent Redirect", - 400: "Bad Request", - 401: "Unauthorized", - 402: "Payment Required", - 403: "Forbidden", - 404: "Not Found", - 405: "Method Not Allowed", - 406: "Not Acceptable", - 407: "Proxy Authentication Required", - 408: "Request Timeout", - 409: "Conflict", - 410: "Gone", - 411: "Length Required", - 412: "Precondition Failed", - 413: "Request Entity Too Large", - 414: "Request-URI Too Long", - 415: "Unsupported Media Type", - 416: "Request Range Not Satisfiable", - 417: "Expectation Failed", - 418: "I'm a teapot", - 420: "Enhance Your Calm", - 422: "Unprocessable Entity", - 423: "Locked", - 424: "Failed Dependency", - 426: "Upgrade Required", - 428: "Precondition Required", - 429: "Too Many Requests", - 431: "Request Header Fields Too Large", - 444: "No Response", - 449: "Retry With", - 450: "Blocked by Windows Parental Controls", - 451: "Wrong Exchange Server", - 499: "Client Closed Request", - 500: "Internal Server Error", - 501: "Not Implemented", - 502: "Bad Gateway", - 503: "Service Unavailable", - 504: "Gateway Timeout", - 505: "HTTP Version Not Supported", - 506: "Variant Also Negotiates", - 507: "Insufficient Storage", - 508: "Loop Detected", - 509: "Bandwidth Limit Exceeded", - 510: "Not Extended", - 511: "Network Authentication Required", - 598: "Network read timeout error", - 599: "Network connect timeout error", -} diff --git a/vendor/github.com/go-openapi/runtime/text.go b/vendor/github.com/go-openapi/runtime/text.go deleted file mode 100644 index c7fd04c..0000000 --- a/vendor/github.com/go-openapi/runtime/text.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "bytes" - "encoding" - "errors" - "fmt" - "io" - "reflect" - - "github.com/go-openapi/swag" -) - -// TextConsumer creates a new text consumer -func TextConsumer() Consumer { - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - if reader == nil { - return errors.New("TextConsumer requires a reader") // early exit - } - - buf := new(bytes.Buffer) - _, err := buf.ReadFrom(reader) - if err != nil { - return err - } - b := buf.Bytes() - - // If the buffer is empty, no need to unmarshal it, which causes a panic. - if len(b) == 0 { - data = "" - return nil - } - - if tu, ok := data.(encoding.TextUnmarshaler); ok { - err := tu.UnmarshalText(b) - if err != nil { - return fmt.Errorf("text consumer: %v", err) - } - - return nil - } - - t := reflect.TypeOf(data) - if data != nil && t.Kind() == reflect.Ptr { - v := reflect.Indirect(reflect.ValueOf(data)) - if t.Elem().Kind() == reflect.String { - v.SetString(string(b)) - return nil - } - } - - return fmt.Errorf("%v (%T) is not supported by the TextConsumer, %s", - data, data, "can be resolved by supporting TextUnmarshaler interface") - }) -} - -// TextProducer creates a new text producer -func TextProducer() Producer { - return ProducerFunc(func(writer io.Writer, data interface{}) error { - if writer == nil { - return errors.New("TextProducer requires a writer") // early exit - } - - if data == nil { - return errors.New("no data given to produce text from") - } - - if tm, ok := data.(encoding.TextMarshaler); ok { - txt, err := tm.MarshalText() - if err != nil { - return fmt.Errorf("text producer: %v", err) - } - _, err = writer.Write(txt) - return err - } - - if str, ok := data.(error); ok { - _, err := writer.Write([]byte(str.Error())) - return err - } - - if str, ok := data.(fmt.Stringer); ok { - _, err := writer.Write([]byte(str.String())) - return err - } - - v := reflect.Indirect(reflect.ValueOf(data)) - if t := v.Type(); t.Kind() == reflect.Struct || t.Kind() == reflect.Slice { - b, err := swag.WriteJSON(data) - if err != nil { - return err - } - _, err = writer.Write(b) - return err - } - if v.Kind() != reflect.String { - return fmt.Errorf("%T is not a supported type by the TextProducer", data) - } - - _, err := writer.Write([]byte(v.String())) - return err - }) -} diff --git a/vendor/github.com/go-openapi/runtime/values.go b/vendor/github.com/go-openapi/runtime/values.go deleted file mode 100644 index 11f5732..0000000 --- a/vendor/github.com/go-openapi/runtime/values.go +++ /dev/null @@ -1,19 +0,0 @@ -package runtime - -// Values typically represent parameters on a http request. -type Values map[string][]string - -// GetOK returns the values collection for the given key. -// When the key is present in the map it will return true for hasKey. -// When the value is not empty it will return true for hasValue. -func (v Values) GetOK(key string) (value []string, hasKey bool, hasValue bool) { - value, hasKey = v[key] - if !hasKey { - return - } - if len(value) == 0 { - return - } - hasValue = true - return -} diff --git a/vendor/github.com/go-openapi/runtime/xml.go b/vendor/github.com/go-openapi/runtime/xml.go deleted file mode 100644 index 821c739..0000000 --- a/vendor/github.com/go-openapi/runtime/xml.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "encoding/xml" - "io" -) - -// XMLConsumer creates a new XML consumer -func XMLConsumer() Consumer { - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - dec := xml.NewDecoder(reader) - return dec.Decode(data) - }) -} - -// XMLProducer creates a new XML producer -func XMLProducer() Producer { - return ProducerFunc(func(writer io.Writer, data interface{}) error { - enc := xml.NewEncoder(writer) - return enc.Encode(data) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go b/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go deleted file mode 100644 index b30d377..0000000 --- a/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package yamlpc - -import ( - "io" - - "github.com/go-openapi/runtime" - - "gopkg.in/yaml.v2" -) - -// YAMLConsumer creates a consumer for yaml data -func YAMLConsumer() runtime.Consumer { - return runtime.ConsumerFunc(func(r io.Reader, v interface{}) error { - dec := yaml.NewDecoder(r) - return dec.Decode(v) - }) -} - -// YAMLProducer creates a producer for yaml data -func YAMLProducer() runtime.Producer { - return runtime.ProducerFunc(func(w io.Writer, v interface{}) error { - enc := yaml.NewEncoder(w) - defer enc.Close() - return enc.Encode(v) - }) -} diff --git a/vendor/github.com/go-openapi/spec/.editorconfig b/vendor/github.com/go-openapi/spec/.editorconfig deleted file mode 100644 index 3152da6..0000000 --- a/vendor/github.com/go-openapi/spec/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/spec/.gitignore b/vendor/github.com/go-openapi/spec/.gitignore deleted file mode 100644 index dd91ed6..0000000 --- a/vendor/github.com/go-openapi/spec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets.yml -coverage.out diff --git a/vendor/github.com/go-openapi/spec/.golangci.yml b/vendor/github.com/go-openapi/spec/.golangci.yml deleted file mode 100644 index 835d55e..0000000 --- a/vendor/github.com/go-openapi/spec/.golangci.yml +++ /dev/null @@ -1,42 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 45 - maligned: - suggest-new: true - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 2 - -linters: - enable-all: true - disable: - - maligned - - unparam - - lll - - gochecknoinits - - gochecknoglobals - - funlen - - godox - - gocognit - - whitespace - - wsl - - wrapcheck - - testpackage - - nlreturn - - gomnd - - exhaustivestruct - - goerr113 - - errorlint - - nestif - - godot - - gofumpt - - paralleltest - - tparallel - - thelper - - ifshort diff --git a/vendor/github.com/go-openapi/spec/.travis.yml b/vendor/github.com/go-openapi/spec/.travis.yml deleted file mode 100644 index e8ceca4..0000000 --- a/vendor/github.com/go-openapi/spec/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -arch: - - amd64 -jobs: - include: - # only run fast tests on ppc64le - - go: 1.x - arch: ppc64le - script: - - gotestsum -f short-verbose -- ./... - - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master - -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/spec/LICENSE b/vendor/github.com/go-openapi/spec/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/spec/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/spec/README.md b/vendor/github.com/go-openapi/spec/README.md deleted file mode 100644 index 18782c6..0000000 --- a/vendor/github.com/go-openapi/spec/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# OAI object model - -[![Build Status](https://travis-ci.org/go-openapi/spec.svg?branch=master)](https://travis-ci.org/go-openapi/spec) - -[![codecov](https://codecov.io/gh/go-openapi/spec/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/spec) -[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/spec/master/LICENSE) -[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/spec.svg)](https://pkg.go.dev/github.com/go-openapi/spec) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/spec)](https://goreportcard.com/report/github.com/go-openapi/spec) - -The object model for OpenAPI specification documents. - -### FAQ - -* What does this do? - -> 1. This package knows how to marshal and unmarshal Swagger API specifications into a golang object model -> 2. It knows how to resolve $ref and expand them to make a single root document - -* How does it play with the rest of the go-openapi packages ? - -> 1. This package is at the core of the go-openapi suite of packages and [code generator](https://github.com/go-swagger/go-swagger) -> 2. There is a [spec loading package](https://github.com/go-openapi/loads) to fetch specs as JSON or YAML from local or remote locations -> 3. There is a [spec validation package](https://github.com/go-openapi/validate) built on top of it -> 4. There is a [spec analysis package](https://github.com/go-openapi/analysis) built on top of it, to analyze, flatten, fix and merge spec documents - -* Does this library support OpenAPI 3? - -> No. -> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0). -> There is no plan to make it evolve toward supporting OpenAPI 3.x. -> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story. -> -> An early attempt to support Swagger 3 may be found at: https://github.com/go-openapi/spec3 diff --git a/vendor/github.com/go-openapi/spec/appveyor.yml b/vendor/github.com/go-openapi/spec/appveyor.yml deleted file mode 100644 index 0903593..0000000 --- a/vendor/github.com/go-openapi/spec/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: "0.1.{build}" - -clone_folder: C:\go-openapi\spec -shallow_clone: true # for startup speed -pull_requests: - do_not_increment_build_number: true - -#skip_tags: true -#skip_branch_with_pr: true - -# appveyor.yml -build: off - -environment: - GOPATH: c:\gopath - -stack: go 1.15 - -test_script: - - go test -v -timeout 20m ./... - -deploy: off - -notifications: - - provider: Slack - incoming_webhook: https://hooks.slack.com/services/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 - auth_token: - secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4= - channel: bots - on_build_success: false - on_build_failure: true - on_build_status_changed: true diff --git a/vendor/github.com/go-openapi/spec/bindata.go b/vendor/github.com/go-openapi/spec/bindata.go deleted file mode 100644 index afc8385..0000000 --- a/vendor/github.com/go-openapi/spec/bindata.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by go-bindata. DO NOT EDIT. -// sources: -// schemas/jsonschema-draft-04.json (4.357kB) -// schemas/v2/schema.json (40.248kB) - -package spec - -import ( - "bytes" - "compress/gzip" - "crypto/sha256" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo - digest [sha256.Size]byte -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindataFileInfo) Name() string { - return fi.name -} -func (fi bindataFileInfo) Size() int64 { - return fi.size -} -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} -func (fi bindataFileInfo) IsDir() bool { - return false -} -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _jsonschemaDraft04Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00") - -func jsonschemaDraft04JsonBytes() ([]byte, error) { - return bindataRead( - _jsonschemaDraft04Json, - "jsonschema-draft-04.json", - ) -} - -func jsonschemaDraft04Json() (*asset, error) { - bytes, err := jsonschemaDraft04JsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(0640), modTime: time.Unix(1568963823, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe1, 0x48, 0x9d, 0xb, 0x47, 0x55, 0xf0, 0x27, 0x93, 0x30, 0x25, 0x91, 0xd3, 0xfc, 0xb8, 0xf0, 0x7b, 0x68, 0x93, 0xa8, 0x2a, 0x94, 0xf2, 0x48, 0x95, 0xf8, 0xe4, 0xed, 0xf1, 0x1b, 0x82, 0xe2}} - return a, nil -} - -var _v2SchemaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\xe3\x08\xb5\x8b\x99\xbd\x82\xbc\x9e\xc2\xe8\x53\x46\x83\x3f\x33\x54\x2b\x5b\xad\x92\x79\xd9\x8f\x5d\x93\x98\xf2\xe6\xc6\x1c\xe6\x9a\x9e\xfc\x43\x82\x31\x66\x8e\x53\x77\xfe\x90\xe7\xf3\xf6\xe9\x62\x23\x3f\x10\x93\x18\xae\x72\x1a\x9d\xf9\x48\xcb\xcc\x5a\x65\xc7\x4a\x04\xf0\xf3\xd5\xd5\x05\x8a\x41\x08\xbc\x86\x86\x43\x51\x6c\xe0\x46\x57\xf6\x44\x40\x0d\xfb\xff\xa2\xc3\x7c\x3d\x39\x84\xdc\x09\x22\x64\x4f\x12\xd9\xba\xaa\xf6\xe3\xbd\x56\xdd\x91\x25\x6a\x14\x9c\x89\x34\x8e\x31\xdf\xee\x15\x7e\x2f\x39\x81\x15\x2a\x28\x95\x66\x51\xf5\xfd\x83\xc5\xfe\x15\x07\xcf\xf7\x08\xee\x1d\x8e\xb6\xc5\x52\xcc\x8c\x5a\x93\x66\xc5\xd8\x79\x38\x46\xd6\xa7\x88\x37\xc9\x2e\xe3\xd2\xa5\x7b\x4b\x3a\xdc\xa1\xdc\x9e\x29\xf1\x8c\x8a\x99\x16\x47\x8d\xd4\x78\x8b\xf6\x1c\xe9\x71\x54\x1b\x69\xa8\x4a\x93\x37\xe5\xb2\x2c\x4f\x0c\x92\xab\xa0\x73\x32\x72\x59\xd3\xf0\x2d\x8d\xed\xca\x37\x16\x19\x9e\xdb\x1c\xab\x17\x49\xc3\x0f\x37\xdc\x88\xb1\xb4\xd4\x42\xcb\x58\x5e\x6a\x52\x0b\x15\x10\x0a\xb0\x04\xe7\xf8\x58\x32\x16\x01\xa6\xcd\x01\xb2\xc2\x69\x24\x35\x38\x6f\x30\x6a\xae\x1b\xb4\x71\xaa\xad\x1d\xa0\xd6\x20\x2d\x8b\x3c\xc6\x82\x62\x27\x34\x6d\x15\x84\x7b\x43\xb1\x35\x78\xa6\x24\x77\x28\xc1\x6e\xfc\xe9\x48\x74\xf4\x15\xe3\xe1\x84\x42\x88\x40\x7a\x26\x49\x3b\x48\xb1\xa4\x19\x8e\x0c\xa7\xb5\x01\x6c\x0c\x97\x61\x8a\xc2\x32\xd8\x8c\x44\x69\x24\xbf\x65\x1d\x74\xd6\xe5\x44\xef\xec\x48\x5e\xb7\x8a\xa3\x29\x8e\x41\x64\xce\x1f\x88\xdc\x00\x47\x4b\x40\x98\x6e\xd1\x0d\x8e\x48\x98\x63\x5c\x21\xb1\x4c\x05\x0a\x58\x98\xc5\x6d\x4f\x0a\x77\x53\x4f\x8b\xc4\x44\x1f\xb2\xdf\x8d\x3b\xea\x9f\xfe\xf6\xf2\xc5\xff\x5d\x7f\xfe\x9f\xfb\x67\x8f\xff\xf3\xe9\x69\xd1\xfe\xb3\xc7\xfd\x3c\xf8\x3f\x71\x94\x82\x23\xd1\x72\x00\xb7\x42\x99\x6c\xc0\x60\x7b\x0f\x79\xea\xa8\x53\x4b\x56\x31\xfa\x0b\x52\x9f\x96\xdb\xcd\x2f\xd7\x67\xcd\x04\x19\x85\xfe\xdb\x02\x9a\x59\x03\xad\x63\x3c\xea\xff\x2e\x18\xfd\x00\xd9\xe2\x56\x60\x59\x93\xb9\xb6\xb2\x3e\x3c\x2c\xab\x0f\xa7\xb2\x89\x43\xc7\xf6\xd5\xce\x2e\xad\xa6\xa9\xed\xa6\xc6\x5a\xb4\xa6\x67\xdf\x8c\x26\x7b\x50\x5a\x91\x08\x2e\x6d\xd4\x3a\xc1\x9d\xf2\xdb\xde\x1e\xb2\x2c\x6c\xa5\x64\xc9\x16\xb4\x90\xaa\x4a\xb7\x0c\xde\x13\xc3\x2a\x9a\x11\x9b\x7a\x1b\x3d\x95\x97\x37\x31\x6b\x69\x7e\x34\xc0\x67\x1f\x66\x19\x49\xef\xf1\x25\xf5\xac\x0e\xea\x0a\x28\x8d\x4d\x7e\xd9\x57\x4b\x49\xe5\xc6\xb3\x25\xfd\xe6\x57\x42\x25\xac\xcd\xcf\x36\x74\x8e\xca\x24\x47\xe7\x80\xa8\x92\x72\xbd\x3d\x84\x2d\x65\xe2\x82\x1a\x9c\xc4\x44\x92\x1b\x10\x79\x8a\xc4\x4a\x2f\x60\x51\x04\x81\xaa\xf0\xa3\x95\x27\xd7\x12\x7b\xa3\x96\x03\x45\x96\xc1\x8a\x07\xc9\xb2\xb0\x95\x52\x8c\xef\x48\x9c\xc6\x7e\x94\xca\xc2\x0e\x07\x12\x44\xa9\x20\x37\xf0\xae\x0f\x49\xa3\x96\x9d\x4b\x42\x7b\x70\x59\x14\xee\xe0\xb2\x0f\x49\xa3\x96\x4b\x97\xbf\x00\x5d\x4b\x4f\xfc\xbb\x2b\xee\x92\xb9\x17\xb5\xaa\xb8\x0b\x97\x17\x9b\x43\xfd\xd6\xc2\xb2\xc2\x2e\x29\xcf\xfd\x87\x4a\x55\xda\x25\x63\x1f\x5a\x65\x69\x2b\x2d\x3d\x67\xe9\x41\xae\x5e\xc1\x6e\x2b\xd4\xdb\x3e\xa8\xd3\x26\xd2\x48\x92\x24\xca\x61\x86\x8f\x8c\xbb\xf2\x8e\x91\xdf\x1f\x06\x19\x33\xf3\x03\x4d\xba\xcd\xe2\x2d\xfb\x69\xe9\x16\x15\x13\xd5\x56\x85\x4e\x3c\x5b\x8a\xbf\x25\x72\x83\xee\x5e\x20\x22\xf2\xc8\xaa\x7b\xdb\x8e\xe4\x29\x58\xca\x38\xb7\x3f\x2e\x59\xb8\xbd\xa8\x16\x16\xf7\xdb\x79\x51\x9f\x5a\xb4\x8d\x87\x3a\x6e\xbc\x3e\xc5\xb4\xcd\x58\xf9\xf5\x3c\xb9\x6f\x49\xaf\x57\xc1\xfa\x1c\x5d\x6d\x88\x8a\x8b\xd3\x28\xcc\xb7\xef\x10\x8a\x4a\x74\xa9\x4a\xa7\x62\xbf\x0d\x76\x23\x6f\x59\xd9\x31\xee\x40\x11\xfb\x28\xec\x8d\x22\x1c\x13\x5a\x64\x94\x23\x16\x60\xbb\xd2\x7c\xa0\x98\xb2\xe5\x6e\xbc\x54\x33\xe0\x3e\xb9\x52\x17\xdb\xb7\x1b\xc8\x12\x20\x8c\x23\xca\x64\x7e\x78\xa3\x62\x5b\x75\x56\xd9\x9e\x2a\x91\x27\xb0\x70\x34\x1f\x90\x89\xb5\x86\x73\x7e\x71\xda\x1e\xfb\x3a\x72\xdc\x5e\x79\x88\xcb\x74\x79\xd9\x64\xe4\xd4\xc2\x9e\xce\xb1\xfe\x85\x5a\xc0\xe9\x0c\x34\x3d\xd0\x43\xce\xa1\x36\x39\xd5\xa1\x4e\xf5\xf8\xb1\xa9\x23\x08\x75\x84\xac\x53\x6c\x3a\xc5\xa6\x53\x6c\x3a\xc5\xa6\x7f\xc5\xd8\xf4\x51\xfd\xff\x25\x4e\xfa\x33\x05\xbe\x9d\x60\xd2\x04\x93\x6a\x5f\x33\x9b\x98\x50\xd2\xe1\x50\x52\xc6\xcc\xdb\x38\x91\xdb\xe6\xaa\xa2\x8f\xa1\x6a\xa6\xd4\xc6\x56\xd6\x8c\x40\x02\x68\x48\xe8\x1a\xe1\x9a\xd9\x2e\xb7\x05\xc3\x34\xda\x2a\xbb\xcd\x12\x36\x98\x22\x50\x4c\xa1\x1b\xc5\xd5\x84\xf0\xbe\x24\x84\xf7\x2f\x22\x37\xef\x94\xd7\x9f\xa0\xde\x04\xf5\x26\xa8\x37\x41\x3d\x64\x40\x3d\xe5\xf2\xde\x60\x89\x27\xb4\x37\xa1\xbd\xda\xd7\xd2\x2c\x26\xc0\x37\x01\x3e\x1b\xef\x5f\x06\xe0\x6b\x7c\x5c\x91\x08\x26\x10\x38\x81\xc0\x09\x04\x76\x4a\x3d\x81\xc0\xbf\x12\x08\x4c\xb0\xdc\x7c\x99\x00\xd0\x75\x70\xb4\xf8\x5a\x7c\xea\xde\x3e\x39\x08\x30\x5a\x27\x35\xed\xb4\x65\xad\x69\x74\x10\x88\x79\xe2\x30\x52\x19\xd6\x04\x21\xa7\x95\xd5\x0e\x03\xf8\xda\x20\xd7\x84\xb4\x26\xa4\x35\x21\xad\x09\x69\x21\x03\x69\x51\x46\xff\xff\x18\x9b\x54\xed\x87\x47\x06\x9d\x4e\x73\x6e\x9a\xb3\xa9\xce\x83\x5e\x4b\xc6\x71\x20\x45\xd7\x72\xf5\x40\x72\x0e\x34\x6c\xf4\x6c\xf3\xba\x5e\x4b\x97\x0e\x52\xb8\xbe\x8b\x79\xa0\x10\x86\xa1\x75\xb0\x6f\xec\xc8\xf4\x3d\x4d\x7b\x86\xc2\x02\x31\x12\x51\xbf\x07\x94\xad\x10\xd6\x2e\x79\xcf\xe9\x1c\xf5\x1e\x31\x23\x5c\x18\xfb\x9c\xfb\x70\xe0\x62\xbd\xf7\xb5\x94\xcf\xf3\xf6\xfa\xc5\x4e\x9c\x85\x76\x1d\xae\x37\xbc\xde\xa3\x41\xcb\x29\xd0\x5e\x70\x67\x50\x93\x6d\x98\xa8\xd3\x67\x0f\x68\xb1\xeb\x38\x47\x07\x10\x1b\xd2\xe2\x18\x68\x6d\x40\xbb\xa3\x40\xba\x21\xf2\x8e\x81\xfb\xf6\x92\x77\x2f\x70\xe8\xdb\xb2\x36\xbf\x30\x91\xc5\x21\xe7\x45\xcc\x34\x0c\x48\x8e\xd0\xf2\x9b\x7c\x3c\xbd\x1c\x04\x3e\x07\xe8\x7c\x2f\x84\x7a\x48\x4d\x1f\xba\xe1\x76\x45\x7b\x60\xe0\x01\xca\xee\x04\xca\x31\xbe\x73\x5f\xa3\x70\x0c\xad\x1f\xa5\xf5\x76\xd5\xbb\xd2\x7e\xfb\x30\x90\xcf\xfa\x67\x7a\xe6\xc3\x37\x42\x19\xe2\xc9\x9c\x61\x4c\xe7\xd1\x77\x55\x86\x6e\x8f\x7b\x85\x42\x33\xa3\xaa\x57\xae\xfd\xd5\xcc\x9c\x56\x68\xe2\xde\x0e\xa8\x2c\xa9\xb0\x7d\xf0\x54\x2d\x80\xf2\x48\x39\x3d\x98\x1a\x6d\x0b\x9d\xba\x53\xfb\xce\xf8\xd1\x7e\xbb\x60\x4f\x06\xf5\xce\xda\xab\xeb\xca\xcb\xd5\xac\x20\xda\x72\x3b\xa2\x4b\x38\xd7\xb5\x89\xbe\x42\xd9\xb9\x73\xc4\x0c\x6d\xb7\xd9\xf8\x8d\xbd\x3e\x9c\xf5\x53\x68\x48\x14\x36\x8f\x09\xc5\x92\xf1\x21\xd1\x09\x07\x1c\xbe\xa7\x91\xf3\x6a\xc8\xc1\x57\xb0\xdd\xc5\xc6\x1d\xad\x76\x1d\xa8\x82\x0e\x4c\x38\xfe\xa5\x8c\xc5\x0a\x40\x5d\xa1\xbb\x98\xd1\xfb\x74\x61\xed\x1a\x98\xaf\x3c\x8c\x1e\xe3\xc2\x92\x29\x74\x3e\x99\xd0\xf9\x41\x50\xd0\x38\x4b\x57\x7e\x5b\x7a\x0e\xe6\xce\x4e\xd7\x19\x35\x57\xbb\x3c\x3c\xd2\x5e\x4f\x4b\x4c\xf7\x0f\x4d\x2b\x91\x5d\x94\xa6\x95\xc8\x69\x25\x72\x5a\x89\x7c\xb8\x95\xc8\x07\x80\x8c\xda\x9c\x64\x7b\xb7\x71\xdf\x57\x12\x4b\x9a\x1f\x72\x0c\x13\x03\xad\x3c\xd5\x4e\xde\x8e\x57\x13\x6d\x34\x86\xcf\x97\xe6\xa4\x68\xc4\xb0\xf6\xc9\xc2\xeb\x8d\x0b\xd7\xcd\xfe\xba\xa6\xf5\x30\xeb\x30\x33\xbe\xc7\x56\x27\xab\x08\xd9\x6d\xbb\x09\xee\x7c\x2d\xcf\xee\x87\x38\xac\xc8\xdd\x90\x9a\x58\x4a\x4e\x96\xa9\x79\x79\xf3\xde\x20\xf0\x96\xe3\x24\x19\xeb\xba\xf2\x53\x19\xab\x12\xaf\x47\xb3\xa0\x3e\xef\x9b\x8d\x6d\x6d\x7b\xde\x3b\x3b\x1a\xc0\x3f\x95\x7e\xed\x78\xfb\x76\xb8\xaf\xb3\xdd\xc5\xeb\x95\xed\x5a\x62\x41\x82\xb3\x54\x6e\x80\x4a\x92\x6f\x36\xbd\x34\xae\xde\x6f\xa4\xc0\xbc\x08\xe3\x84\xfc\x1d\xb6\xe3\xd0\x62\x38\x95\x9b\x57\xe7\x71\x12\x91\x80\xc8\x31\x69\x5e\x60\x21\x6e\x19\x0f\xc7\xa4\x79\x96\x28\x3e\x47\x54\x65\x41\x36\x08\x40\x88\x1f\x58\x08\x56\xaa\xd5\xbf\xaf\xad\x96\xd7\xd6\xcf\x87\xf5\x34\x0f\x71\x93\x6e\x26\xed\x98\x5b\x9f\x4f\xcf\x95\x34\xc6\xd7\x11\xfa\xb0\x81\x22\x1a\xdb\xdf\x8e\xdc\xc3\xb9\xf8\xdd\x5d\x3c\x74\xe6\xea\xb7\x8b\xbf\xf5\x6e\xb3\x46\x2e\x64\xf4\xab\x3c\x4e\xcf\x36\x1d\xfe\xfa\xb8\x36\xba\x8a\xd8\xad\xf6\xc6\x41\x2a\x37\x8c\x17\x0f\xda\xfe\xda\xe7\x65\xbc\x71\x2c\x36\x57\x8a\x47\x12\x4c\xf1\xbd\x77\x6b\xa4\x50\x7e\x77\x7b\x22\x60\x89\xef\xcd\xf5\xb9\x0c\x97\x79\x0d\x2b\x35\x43\xcb\x3d\x24\xf1\x78\xfc\xf8\xcb\x1f\x15\x06\xe2\x78\xd8\x51\x21\xd9\x1f\xf0\xf5\x8f\x86\xa4\x50\xfa\xb1\x47\x43\xa5\xdd\x69\x14\xe8\xa3\xc0\x86\x91\xa7\x81\x50\xb4\x7c\xc0\x81\x80\x77\x7a\x9f\xc6\xc2\xa9\x8c\x05\x33\xb0\x3b\x31\xa4\xf4\xd7\x1b\x26\x55\x97\x7c\x65\xf8\x69\x1a\x84\x8e\x41\x78\xd9\xec\xc5\x11\x16\x1e\x74\x91\xf5\x56\xf5\x57\x49\x47\x5c\x92\xa9\x1e\x99\x36\xf4\xdb\xb1\x0e\xd3\x78\x02\xb0\x9b\x25\xcb\xe9\xe9\x1d\x0d\x44\x01\x42\x08\x91\x64\xd9\xdd\x37\x08\x17\xef\xf9\xe5\x0f\xbd\x46\x91\xf5\xf9\x89\x92\x37\xdd\x89\x59\x44\x1f\x9c\xee\x34\x1e\xbe\x47\x83\x32\x72\x8e\x37\xdf\xac\x69\x38\xef\x75\xb0\xda\xdb\xac\x83\x94\x2f\x39\xa6\x62\x05\x1c\x25\x9c\x49\x16\xb0\xa8\x3c\xc7\x7e\x76\x71\x3e\x6f\xb5\x24\xe7\xe8\xb7\xb9\xc7\x6c\x43\x92\xee\x21\xd4\x17\xa1\x7f\xba\x35\xfe\xae\x39\xbc\xde\xba\x69\xd9\x8e\xe1\x62\xde\x64\x7d\x16\x88\x1b\xed\x29\x11\xfd\x4f\xa9\xff\x99\x90\xc4\xf6\xf4\xf9\x6e\xe9\x28\x23\xd7\xca\xe5\xee\xee\x9f\x63\xb1\x5b\xfb\x10\xd7\x2f\x1d\xf2\xe3\xbf\xb9\xb5\x6f\xa4\x6d\x7d\x25\x79\xfb\x24\x31\xea\x56\xbe\x5d\x53\xcd\x2d\x36\xa3\x6d\xdf\xab\x1c\xb8\x6d\x6f\xc0\x98\xa7\xdd\xaa\x86\x8c\x1d\x39\xa3\x9d\x70\x2b\x9b\x68\xd9\xfd\x33\xfe\xa9\xb6\x4a\x2e\x63\x0f\xcf\x68\x27\xd9\x4c\xb9\x46\x6d\xcb\xbe\xa1\xa8\xd6\x5f\xc6\xd6\x9f\xf1\x4f\xf4\xd4\xb4\x78\xd0\xd6\xf4\x13\x3c\x3b\xac\xd0\xdc\x90\x34\xda\xc9\xb4\x9a\x1a\x8d\xbd\x93\x87\xd4\xe2\x21\x1b\xb3\x2b\xd1\xbe\xe7\x69\xd4\x53\x67\xd5\x40\xa0\xe3\x19\x3f\x6d\x1a\xbc\x0e\x86\x3c\x10\xb4\x3d\x2a\xcd\x78\x32\xe6\xab\xbd\x36\xc9\xf4\x3a\x58\xae\xc3\xf4\x47\xea\xbf\xfb\x47\xff\x0d\x00\x00\xff\xff\xd2\x32\x5a\x28\x38\x9d\x00\x00") - -func v2SchemaJsonBytes() ([]byte, error) { - return bindataRead( - _v2SchemaJson, - "v2/schema.json", - ) -} - -func v2SchemaJson() (*asset, error) { - bytes, err := v2SchemaJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "v2/schema.json", size: 40248, mode: os.FileMode(0640), modTime: time.Unix(1568964748, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x88, 0x5e, 0xf, 0xbf, 0x17, 0x74, 0x0, 0xb2, 0x5a, 0x7f, 0xbc, 0x58, 0xcd, 0xc, 0x25, 0x73, 0xd5, 0x29, 0x1c, 0x7a, 0xd0, 0xce, 0x79, 0xd4, 0x89, 0x31, 0x27, 0x90, 0xf2, 0xff, 0xe6}} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// AssetString returns the asset contents as a string (instead of a []byte). -func AssetString(name string) (string, error) { - data, err := Asset(name) - return string(data), err -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// MustAssetString is like AssetString but panics when Asset would return an -// error. It simplifies safe initialization of global variables. -func MustAssetString(name string) string { - return string(MustAsset(name)) -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetDigest returns the digest of the file with the given name. It returns an -// error if the asset could not be found or the digest could not be loaded. -func AssetDigest(name string) ([sha256.Size]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) - } - return a.digest, nil - } - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) -} - -// Digests returns a map of all known files and their checksums. -func Digests() (map[string][sha256.Size]byte, error) { - mp := make(map[string][sha256.Size]byte, len(_bindata)) - for name := range _bindata { - a, err := _bindata[name]() - if err != nil { - return nil, err - } - mp[name] = a.digest - } - return mp, nil -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "jsonschema-draft-04.json": jsonschemaDraft04Json, - - "v2/schema.json": v2SchemaJson, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"}, -// AssetDir("data/img") would return []string{"a.png", "b.png"}, -// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - canonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(canonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "jsonschema-draft-04.json": {jsonschemaDraft04Json, map[string]*bintree{}}, - "v2": {nil, map[string]*bintree{ - "schema.json": {v2SchemaJson, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory. -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) -} - -// RestoreAssets restores an asset under the given directory recursively. -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - canonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) -} diff --git a/vendor/github.com/go-openapi/spec/cache.go b/vendor/github.com/go-openapi/spec/cache.go deleted file mode 100644 index 122993b..0000000 --- a/vendor/github.com/go-openapi/spec/cache.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "sync" -) - -// ResolutionCache a cache for resolving urls -type ResolutionCache interface { - Get(string) (interface{}, bool) - Set(string, interface{}) -} - -type simpleCache struct { - lock sync.RWMutex - store map[string]interface{} -} - -func (s *simpleCache) ShallowClone() ResolutionCache { - store := make(map[string]interface{}, len(s.store)) - s.lock.RLock() - for k, v := range s.store { - store[k] = v - } - s.lock.RUnlock() - - return &simpleCache{ - store: store, - } -} - -// Get retrieves a cached URI -func (s *simpleCache) Get(uri string) (interface{}, bool) { - s.lock.RLock() - v, ok := s.store[uri] - - s.lock.RUnlock() - return v, ok -} - -// Set caches a URI -func (s *simpleCache) Set(uri string, data interface{}) { - s.lock.Lock() - s.store[uri] = data - s.lock.Unlock() -} - -var ( - // resCache is a package level cache for $ref resolution and expansion. - // It is initialized lazily by methods that have the need for it: no - // memory is allocated unless some expander methods are called. - // - // It is initialized with JSON schema and swagger schema, - // which do not mutate during normal operations. - // - // All subsequent utilizations of this cache are produced from a shallow - // clone of this initial version. - resCache *simpleCache - onceCache sync.Once - - _ ResolutionCache = &simpleCache{} -) - -// initResolutionCache initializes the URI resolution cache. To be wrapped in a sync.Once.Do call. -func initResolutionCache() { - resCache = defaultResolutionCache() -} - -func defaultResolutionCache() *simpleCache { - return &simpleCache{store: map[string]interface{}{ - "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), - "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), - }} -} - -func cacheOrDefault(cache ResolutionCache) ResolutionCache { - onceCache.Do(initResolutionCache) - - if cache != nil { - return cache - } - - // get a shallow clone of the base cache with swagger and json schema - return resCache.ShallowClone() -} diff --git a/vendor/github.com/go-openapi/spec/contact_info.go b/vendor/github.com/go-openapi/spec/contact_info.go deleted file mode 100644 index 2f7bb21..0000000 --- a/vendor/github.com/go-openapi/spec/contact_info.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/swag" -) - -// ContactInfo contact information for the exposed API. -// -// For more information: http://goo.gl/8us55a#contactObject -type ContactInfo struct { - ContactInfoProps - VendorExtensible -} - -// ContactInfoProps hold the properties of a ContactInfo object -type ContactInfoProps struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` - Email string `json:"email,omitempty"` -} - -// UnmarshalJSON hydrates ContactInfo from json -func (c *ContactInfo) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &c.ContactInfoProps); err != nil { - return err - } - return json.Unmarshal(data, &c.VendorExtensible) -} - -// MarshalJSON produces ContactInfo as json -func (c ContactInfo) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(c.ContactInfoProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(c.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} diff --git a/vendor/github.com/go-openapi/spec/debug.go b/vendor/github.com/go-openapi/spec/debug.go deleted file mode 100644 index fc889f6..0000000 --- a/vendor/github.com/go-openapi/spec/debug.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "fmt" - "log" - "os" - "path" - "runtime" -) - -// Debug is true when the SWAGGER_DEBUG env var is not empty. -// -// It enables a more verbose logging of this package. -var Debug = os.Getenv("SWAGGER_DEBUG") != "" - -var ( - // specLogger is a debug logger for this package - specLogger *log.Logger -) - -func init() { - debugOptions() -} - -func debugOptions() { - specLogger = log.New(os.Stdout, "spec:", log.LstdFlags) -} - -func debugLog(msg string, args ...interface{}) { - // A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog() - if Debug { - _, file1, pos1, _ := runtime.Caller(1) - specLogger.Printf("%s:%d: %s", path.Base(file1), pos1, fmt.Sprintf(msg, args...)) - } -} diff --git a/vendor/github.com/go-openapi/spec/errors.go b/vendor/github.com/go-openapi/spec/errors.go deleted file mode 100644 index 6992c7b..0000000 --- a/vendor/github.com/go-openapi/spec/errors.go +++ /dev/null @@ -1,19 +0,0 @@ -package spec - -import "errors" - -// Error codes -var ( - // ErrUnknownTypeForReference indicates that a resolved reference was found in an unsupported container type - ErrUnknownTypeForReference = errors.New("unknown type for the resolved reference") - - // ErrResolveRefNeedsAPointer indicates that a $ref target must be a valid JSON pointer - ErrResolveRefNeedsAPointer = errors.New("resolve ref: target needs to be a pointer") - - // ErrDerefUnsupportedType indicates that a resolved reference was found in an unsupported container type. - // At the moment, $ref are supported only inside: schemas, parameters, responses, path items - ErrDerefUnsupportedType = errors.New("deref: unsupported type") - - // ErrExpandUnsupportedType indicates that $ref expansion is attempted on some invalid type - ErrExpandUnsupportedType = errors.New("expand: unsupported type. Input should be of type *Parameter or *Response") -) diff --git a/vendor/github.com/go-openapi/spec/expander.go b/vendor/github.com/go-openapi/spec/expander.go deleted file mode 100644 index d4ea889..0000000 --- a/vendor/github.com/go-openapi/spec/expander.go +++ /dev/null @@ -1,594 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" -) - -// ExpandOptions provides options for the spec expander. -// -// RelativeBase is the path to the root document. This can be a remote URL or a path to a local file. -// -// If left empty, the root document is assumed to be located in the current working directory: -// all relative $ref's will be resolved from there. -// -// PathLoader injects a document loading method. By default, this resolves to the function provided by the SpecLoader package variable. -// -type ExpandOptions struct { - RelativeBase string // the path to the root document to expand. This is a file, not a directory - SkipSchemas bool // do not expand schemas, just paths, parameters and responses - ContinueOnError bool // continue expanding even after and error is found - PathLoader func(string) (json.RawMessage, error) `json:"-"` // the document loading method that takes a path as input and yields a json document - AbsoluteCircularRef bool // circular $ref remaining after expansion remain absolute URLs -} - -func optionsOrDefault(opts *ExpandOptions) *ExpandOptions { - if opts != nil { - clone := *opts // shallow clone to avoid internal changes to be propagated to the caller - if clone.RelativeBase != "" { - clone.RelativeBase = normalizeBase(clone.RelativeBase) - } - // if the relative base is empty, let the schema loader choose a pseudo root document - return &clone - } - return &ExpandOptions{} -} - -// ExpandSpec expands the references in a swagger spec -func ExpandSpec(spec *Swagger, options *ExpandOptions) error { - options = optionsOrDefault(options) - resolver := defaultSchemaLoader(spec, options, nil, nil) - - specBasePath := options.RelativeBase - - if !options.SkipSchemas { - for key, definition := range spec.Definitions { - parentRefs := make([]string, 0, 10) - parentRefs = append(parentRefs, fmt.Sprintf("#/definitions/%s", key)) - - def, err := expandSchema(definition, parentRefs, resolver, specBasePath) - if resolver.shouldStopOnError(err) { - return err - } - if def != nil { - spec.Definitions[key] = *def - } - } - } - - for key := range spec.Parameters { - parameter := spec.Parameters[key] - if err := expandParameterOrResponse(¶meter, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Parameters[key] = parameter - } - - for key := range spec.Responses { - response := spec.Responses[key] - if err := expandParameterOrResponse(&response, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Responses[key] = response - } - - if spec.Paths != nil { - for key := range spec.Paths.Paths { - pth := spec.Paths.Paths[key] - if err := expandPathItem(&pth, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Paths.Paths[key] = pth - } - } - - return nil -} - -const rootBase = ".root" - -// baseForRoot loads in the cache the root document and produces a fake ".root" base path entry -// for further $ref resolution -// -// Setting the cache is optional and this parameter may safely be left to nil. -func baseForRoot(root interface{}, cache ResolutionCache) string { - if root == nil { - return "" - } - - // cache the root document to resolve $ref's - normalizedBase := normalizeBase(rootBase) - cache.Set(normalizedBase, root) - - return normalizedBase -} - -// ExpandSchema expands the refs in the schema object with reference to the root object. -// -// go-openapi/validate uses this function. -// -// Notice that it is impossible to reference a json schema in a different document other than root -// (use ExpandSchemaWithBasePath to resolve external references). -// -// Setting the cache is optional and this parameter may safely be left to nil. -func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { - cache = cacheOrDefault(cache) - if root == nil { - root = schema - } - - opts := &ExpandOptions{ - // when a root is specified, cache the root as an in-memory document for $ref retrieval - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - } - - return ExpandSchemaWithBasePath(schema, cache, opts) -} - -// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options. -// -// Setting the cache is optional and this parameter may safely be left to nil. -func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error { - if schema == nil { - return nil - } - - cache = cacheOrDefault(cache) - - opts = optionsOrDefault(opts) - - resolver := defaultSchemaLoader(nil, opts, cache, nil) - - parentRefs := make([]string, 0, 10) - s, err := expandSchema(*schema, parentRefs, resolver, opts.RelativeBase) - if err != nil { - return err - } - if s != nil { - // guard for when continuing on error - *schema = *s - } - - return nil -} - -func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Items == nil { - return &target, nil - } - - // array - if target.Items.Schema != nil { - t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - *target.Items.Schema = *t - } - - // tuple - for i := range target.Items.Schemas { - t, err := expandSchema(target.Items.Schemas[i], parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - target.Items.Schemas[i] = *t - } - - return &target, nil -} - -func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Ref.String() == "" && target.Ref.IsRoot() { - newRef := normalizeRef(&target.Ref, basePath) - target.Ref = *newRef - return &target, nil - } - - // change the base path of resolution when an ID is encountered - // otherwise the basePath should inherit the parent's - if target.ID != "" { - basePath, _ = resolver.setSchemaID(target, target.ID, basePath) - } - - if target.Ref.String() != "" { - return expandSchemaRef(target, parentRefs, resolver, basePath) - } - - for k := range target.Definitions { - tt, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if tt != nil { - target.Definitions[k] = *tt - } - } - - t, err := expandItems(target, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target = *t - } - - for i := range target.AllOf { - t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.AllOf[i] = *t - } - } - - for i := range target.AnyOf { - t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.AnyOf[i] = *t - } - } - - for i := range target.OneOf { - t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.OneOf[i] = *t - } - } - - if target.Not != nil { - t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.Not = *t - } - } - - for k := range target.Properties { - t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.Properties[k] = *t - } - } - - if target.AdditionalProperties != nil && target.AdditionalProperties.Schema != nil { - t, err := expandSchema(*target.AdditionalProperties.Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.AdditionalProperties.Schema = *t - } - } - - for k := range target.PatternProperties { - t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.PatternProperties[k] = *t - } - } - - for k := range target.Dependencies { - if target.Dependencies[k].Schema != nil { - t, err := expandSchema(*target.Dependencies[k].Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.Dependencies[k].Schema = *t - } - } - } - - if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil { - t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.AdditionalItems.Schema = *t - } - } - return &target, nil -} - -func expandSchemaRef(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - // if a Ref is found, all sibling fields are skipped - // Ref also changes the resolution scope of children expandSchema - - // here the resolution scope is changed because a $ref was encountered - normalizedRef := normalizeRef(&target.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if resolver.isCircular(normalizedRef, basePath, parentRefs...) { - // this means there is a cycle in the recursion tree: return the Ref - // - circular refs cannot be expanded. We leave them as ref. - // - denormalization means that a new local file ref is set relative to the original basePath - debugLog("short circuit circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s", - basePath, normalizedBasePath, normalizedRef.String()) - if !resolver.options.AbsoluteCircularRef { - target.Ref = denormalizeRef(normalizedRef, resolver.context.basePath, resolver.context.rootID) - } else { - target.Ref = *normalizedRef - } - return &target, nil - } - - var t *Schema - err := resolver.Resolve(&target.Ref, &t, basePath) - if resolver.shouldStopOnError(err) { - return nil, err - } - - if t == nil { - // guard for when continuing on error - return &target, nil - } - - parentRefs = append(parentRefs, normalizedRef.String()) - transitiveResolver := resolver.transitiveResolver(basePath, target.Ref) - - basePath = resolver.updateBasePath(transitiveResolver, normalizedBasePath) - - return expandSchema(*t, parentRefs, transitiveResolver, basePath) -} - -func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { - if pathItem == nil { - return nil - } - - parentRefs := make([]string, 0, 10) - if err := resolver.deref(pathItem, parentRefs, basePath); resolver.shouldStopOnError(err) { - return err - } - - if pathItem.Ref.String() != "" { - transitiveResolver := resolver.transitiveResolver(basePath, pathItem.Ref) - basePath = transitiveResolver.updateBasePath(resolver, basePath) - resolver = transitiveResolver - } - - pathItem.Ref = Ref{} - for i := range pathItem.Parameters { - if err := expandParameterOrResponse(&(pathItem.Parameters[i]), resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - } - - ops := []*Operation{ - pathItem.Get, - pathItem.Head, - pathItem.Options, - pathItem.Put, - pathItem.Post, - pathItem.Patch, - pathItem.Delete, - } - for _, op := range ops { - if err := expandOperation(op, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - } - - return nil -} - -func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error { - if op == nil { - return nil - } - - for i := range op.Parameters { - param := op.Parameters[i] - if err := expandParameterOrResponse(¶m, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - op.Parameters[i] = param - } - - if op.Responses == nil { - return nil - } - - responses := op.Responses - if err := expandParameterOrResponse(responses.Default, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - - for code := range responses.StatusCodeResponses { - response := responses.StatusCodeResponses[code] - if err := expandParameterOrResponse(&response, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - responses.StatusCodeResponses[code] = response - } - - return nil -} - -// ExpandResponseWithRoot expands a response based on a root document, not a fetchable document -// -// Notice that it is impossible to reference a json schema in a different document other than root -// (use ExpandResponse to resolve external references). -// -// Setting the cache is optional and this parameter may safely be left to nil. -func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error { - cache = cacheOrDefault(cache) - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - } - resolver := defaultSchemaLoader(root, opts, cache, nil) - - return expandParameterOrResponse(response, resolver, opts.RelativeBase) -} - -// ExpandResponse expands a response based on a basepath -// -// All refs inside response will be resolved relative to basePath -func ExpandResponse(response *Response, basePath string) error { - opts := optionsOrDefault(&ExpandOptions{ - RelativeBase: basePath, - }) - resolver := defaultSchemaLoader(nil, opts, nil, nil) - - return expandParameterOrResponse(response, resolver, opts.RelativeBase) -} - -// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document. -// -// Notice that it is impossible to reference a json schema in a different document other than root -// (use ExpandParameter to resolve external references). -func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error { - cache = cacheOrDefault(cache) - - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - } - resolver := defaultSchemaLoader(root, opts, cache, nil) - - return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) -} - -// ExpandParameter expands a parameter based on a basepath. -// This is the exported version of expandParameter -// all refs inside parameter will be resolved relative to basePath -func ExpandParameter(parameter *Parameter, basePath string) error { - opts := optionsOrDefault(&ExpandOptions{ - RelativeBase: basePath, - }) - resolver := defaultSchemaLoader(nil, opts, nil, nil) - - return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) -} - -func getRefAndSchema(input interface{}) (*Ref, *Schema, error) { - var ( - ref *Ref - sch *Schema - ) - - switch refable := input.(type) { - case *Parameter: - if refable == nil { - return nil, nil, nil - } - ref = &refable.Ref - sch = refable.Schema - case *Response: - if refable == nil { - return nil, nil, nil - } - ref = &refable.Ref - sch = refable.Schema - default: - return nil, nil, fmt.Errorf("unsupported type: %T: %w", input, ErrExpandUnsupportedType) - } - - return ref, sch, nil -} - -func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePath string) error { - ref, _, err := getRefAndSchema(input) - if err != nil { - return err - } - - if ref == nil { - return nil - } - - parentRefs := make([]string, 0, 10) - if err = resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) { - return err - } - - ref, sch, _ := getRefAndSchema(input) - if ref.String() != "" { - transitiveResolver := resolver.transitiveResolver(basePath, *ref) - basePath = resolver.updateBasePath(transitiveResolver, basePath) - resolver = transitiveResolver - } - - if sch == nil { - // nothing to be expanded - if ref != nil { - *ref = Ref{} - } - return nil - } - - if sch.Ref.String() != "" { - rebasedRef, ern := NewRef(normalizeURI(sch.Ref.String(), basePath)) - if ern != nil { - return ern - } - - switch { - case resolver.isCircular(&rebasedRef, basePath, parentRefs...): - // this is a circular $ref: stop expansion - if !resolver.options.AbsoluteCircularRef { - sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID) - } else { - sch.Ref = rebasedRef - } - case !resolver.options.SkipSchemas: - // schema expanded to a $ref in another root - sch.Ref = rebasedRef - debugLog("rebased to: %s", sch.Ref.String()) - default: - // skip schema expansion but rebase $ref to schema - sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID) - } - } - - if ref != nil { - *ref = Ref{} - } - - // expand schema - if !resolver.options.SkipSchemas { - s, err := expandSchema(*sch, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return err - } - if s == nil { - // guard for when continuing on error - return nil - } - *sch = *s - } - - return nil -} diff --git a/vendor/github.com/go-openapi/spec/external_docs.go b/vendor/github.com/go-openapi/spec/external_docs.go deleted file mode 100644 index 88add91..0000000 --- a/vendor/github.com/go-openapi/spec/external_docs.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// ExternalDocumentation allows referencing an external resource for -// extended documentation. -// -// For more information: http://goo.gl/8us55a#externalDocumentationObject -type ExternalDocumentation struct { - Description string `json:"description,omitempty"` - URL string `json:"url,omitempty"` -} diff --git a/vendor/github.com/go-openapi/spec/go.mod b/vendor/github.com/go-openapi/spec/go.mod deleted file mode 100644 index 63d9e82..0000000 --- a/vendor/github.com/go-openapi/spec/go.mod +++ /dev/null @@ -1,13 +0,0 @@ -module github.com/go-openapi/spec - -require ( - github.com/go-openapi/jsonpointer v0.19.5 - github.com/go-openapi/jsonreference v0.19.5 - github.com/go-openapi/swag v0.19.14 - github.com/stretchr/testify v1.6.1 - golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect - golang.org/x/text v0.3.5 // indirect - gopkg.in/yaml.v2 v2.4.0 -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/spec/go.sum b/vendor/github.com/go-openapi/spec/go.sum deleted file mode 100644 index 9e86ed9..0000000 --- a/vendor/github.com/go-openapi/spec/go.sum +++ /dev/null @@ -1,65 +0,0 @@ -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/go-openapi/spec/header.go b/vendor/github.com/go-openapi/spec/header.go deleted file mode 100644 index 9dfd17b..0000000 --- a/vendor/github.com/go-openapi/spec/header.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - jsonArray = "array" -) - -// HeaderProps describes a response header -type HeaderProps struct { - Description string `json:"description,omitempty"` -} - -// Header describes a header for a response of the API -// -// For more information: http://goo.gl/8us55a#headerObject -type Header struct { - CommonValidations - SimpleSchema - VendorExtensible - HeaderProps -} - -// ResponseHeader creates a new header instance for use in a response -func ResponseHeader() *Header { - return new(Header) -} - -// WithDescription sets the description on this response, allows for chaining -func (h *Header) WithDescription(description string) *Header { - h.Description = description - return h -} - -// Typed a fluent builder method for the type of parameter -func (h *Header) Typed(tpe, format string) *Header { - h.Type = tpe - h.Format = format - return h -} - -// CollectionOf a fluent builder method for an array item -func (h *Header) CollectionOf(items *Items, format string) *Header { - h.Type = jsonArray - h.Items = items - h.CollectionFormat = format - return h -} - -// WithDefault sets the default value on this item -func (h *Header) WithDefault(defaultValue interface{}) *Header { - h.Default = defaultValue - return h -} - -// WithMaxLength sets a max length value -func (h *Header) WithMaxLength(max int64) *Header { - h.MaxLength = &max - return h -} - -// WithMinLength sets a min length value -func (h *Header) WithMinLength(min int64) *Header { - h.MinLength = &min - return h -} - -// WithPattern sets a pattern value -func (h *Header) WithPattern(pattern string) *Header { - h.Pattern = pattern - return h -} - -// WithMultipleOf sets a multiple of value -func (h *Header) WithMultipleOf(number float64) *Header { - h.MultipleOf = &number - return h -} - -// WithMaximum sets a maximum number value -func (h *Header) WithMaximum(max float64, exclusive bool) *Header { - h.Maximum = &max - h.ExclusiveMaximum = exclusive - return h -} - -// WithMinimum sets a minimum number value -func (h *Header) WithMinimum(min float64, exclusive bool) *Header { - h.Minimum = &min - h.ExclusiveMinimum = exclusive - return h -} - -// WithEnum sets a the enum values (replace) -func (h *Header) WithEnum(values ...interface{}) *Header { - h.Enum = append([]interface{}{}, values...) - return h -} - -// WithMaxItems sets the max items -func (h *Header) WithMaxItems(size int64) *Header { - h.MaxItems = &size - return h -} - -// WithMinItems sets the min items -func (h *Header) WithMinItems(size int64) *Header { - h.MinItems = &size - return h -} - -// UniqueValues dictates that this array can only have unique items -func (h *Header) UniqueValues() *Header { - h.UniqueItems = true - return h -} - -// AllowDuplicates this array can have duplicates -func (h *Header) AllowDuplicates() *Header { - h.UniqueItems = false - return h -} - -// WithValidations is a fluent method to set header validations -func (h *Header) WithValidations(val CommonValidations) *Header { - h.SetValidations(SchemaValidations{CommonValidations: val}) - return h -} - -// MarshalJSON marshal this to JSON -func (h Header) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(h.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(h.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(h.HeaderProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2, b3), nil -} - -// UnmarshalJSON unmarshals this header from JSON -func (h *Header) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &h.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &h.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &h.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &h.HeaderProps) -} - -// JSONLookup look up a value by the json property name -func (h Header) JSONLookup(token string) (interface{}, error) { - if ex, ok := h.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(h.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(h.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(h.HeaderProps, token) - return r, err -} diff --git a/vendor/github.com/go-openapi/spec/info.go b/vendor/github.com/go-openapi/spec/info.go deleted file mode 100644 index c458b49..0000000 --- a/vendor/github.com/go-openapi/spec/info.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// Extensions vendor specific extensions -type Extensions map[string]interface{} - -// Add adds a value to these extensions -func (e Extensions) Add(key string, value interface{}) { - realKey := strings.ToLower(key) - e[realKey] = value -} - -// GetString gets a string value from the extensions -func (e Extensions) GetString(key string) (string, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - str, ok := v.(string) - return str, ok - } - return "", false -} - -// GetBool gets a string value from the extensions -func (e Extensions) GetBool(key string) (bool, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - str, ok := v.(bool) - return str, ok - } - return false, false -} - -// GetStringSlice gets a string value from the extensions -func (e Extensions) GetStringSlice(key string) ([]string, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - arr, isSlice := v.([]interface{}) - if !isSlice { - return nil, false - } - var strs []string - for _, iface := range arr { - str, isString := iface.(string) - if !isString { - return nil, false - } - strs = append(strs, str) - } - return strs, ok - } - return nil, false -} - -// VendorExtensible composition block. -type VendorExtensible struct { - Extensions Extensions -} - -// AddExtension adds an extension to this extensible object -func (v *VendorExtensible) AddExtension(key string, value interface{}) { - if value == nil { - return - } - if v.Extensions == nil { - v.Extensions = make(map[string]interface{}) - } - v.Extensions.Add(key, value) -} - -// MarshalJSON marshals the extensions to json -func (v VendorExtensible) MarshalJSON() ([]byte, error) { - toser := make(map[string]interface{}) - for k, v := range v.Extensions { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - toser[k] = v - } - } - return json.Marshal(toser) -} - -// UnmarshalJSON for this extensible object -func (v *VendorExtensible) UnmarshalJSON(data []byte) error { - var d map[string]interface{} - if err := json.Unmarshal(data, &d); err != nil { - return err - } - for k, vv := range d { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - if v.Extensions == nil { - v.Extensions = map[string]interface{}{} - } - v.Extensions[k] = vv - } - } - return nil -} - -// InfoProps the properties for an info definition -type InfoProps struct { - Description string `json:"description,omitempty"` - Title string `json:"title,omitempty"` - TermsOfService string `json:"termsOfService,omitempty"` - Contact *ContactInfo `json:"contact,omitempty"` - License *License `json:"license,omitempty"` - Version string `json:"version,omitempty"` -} - -// Info object provides metadata about the API. -// The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience. -// -// For more information: http://goo.gl/8us55a#infoObject -type Info struct { - VendorExtensible - InfoProps -} - -// JSONLookup look up a value by the json property name -func (i Info) JSONLookup(token string) (interface{}, error) { - if ex, ok := i.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(i.InfoProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (i Info) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(i.InfoProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(i.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (i *Info) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &i.InfoProps); err != nil { - return err - } - return json.Unmarshal(data, &i.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/items.go b/vendor/github.com/go-openapi/spec/items.go deleted file mode 100644 index e2afb21..0000000 --- a/vendor/github.com/go-openapi/spec/items.go +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - jsonRef = "$ref" -) - -// SimpleSchema describe swagger simple schemas for parameters and headers -type SimpleSchema struct { - Type string `json:"type,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Format string `json:"format,omitempty"` - Items *Items `json:"items,omitempty"` - CollectionFormat string `json:"collectionFormat,omitempty"` - Default interface{} `json:"default,omitempty"` - Example interface{} `json:"example,omitempty"` -} - -// TypeName return the type (or format) of a simple schema -func (s *SimpleSchema) TypeName() string { - if s.Format != "" { - return s.Format - } - return s.Type -} - -// ItemsTypeName yields the type of items in a simple schema array -func (s *SimpleSchema) ItemsTypeName() string { - if s.Items == nil { - return "" - } - return s.Items.TypeName() -} - -// Items a limited subset of JSON-Schema's items object. -// It is used by parameter definitions that are not located in "body". -// -// For more information: http://goo.gl/8us55a#items-object -type Items struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible -} - -// NewItems creates a new instance of items -func NewItems() *Items { - return &Items{} -} - -// Typed a fluent builder method for the type of item -func (i *Items) Typed(tpe, format string) *Items { - i.Type = tpe - i.Format = format - return i -} - -// AsNullable flags this schema as nullable. -func (i *Items) AsNullable() *Items { - i.Nullable = true - return i -} - -// CollectionOf a fluent builder method for an array item -func (i *Items) CollectionOf(items *Items, format string) *Items { - i.Type = jsonArray - i.Items = items - i.CollectionFormat = format - return i -} - -// WithDefault sets the default value on this item -func (i *Items) WithDefault(defaultValue interface{}) *Items { - i.Default = defaultValue - return i -} - -// WithMaxLength sets a max length value -func (i *Items) WithMaxLength(max int64) *Items { - i.MaxLength = &max - return i -} - -// WithMinLength sets a min length value -func (i *Items) WithMinLength(min int64) *Items { - i.MinLength = &min - return i -} - -// WithPattern sets a pattern value -func (i *Items) WithPattern(pattern string) *Items { - i.Pattern = pattern - return i -} - -// WithMultipleOf sets a multiple of value -func (i *Items) WithMultipleOf(number float64) *Items { - i.MultipleOf = &number - return i -} - -// WithMaximum sets a maximum number value -func (i *Items) WithMaximum(max float64, exclusive bool) *Items { - i.Maximum = &max - i.ExclusiveMaximum = exclusive - return i -} - -// WithMinimum sets a minimum number value -func (i *Items) WithMinimum(min float64, exclusive bool) *Items { - i.Minimum = &min - i.ExclusiveMinimum = exclusive - return i -} - -// WithEnum sets a the enum values (replace) -func (i *Items) WithEnum(values ...interface{}) *Items { - i.Enum = append([]interface{}{}, values...) - return i -} - -// WithMaxItems sets the max items -func (i *Items) WithMaxItems(size int64) *Items { - i.MaxItems = &size - return i -} - -// WithMinItems sets the min items -func (i *Items) WithMinItems(size int64) *Items { - i.MinItems = &size - return i -} - -// UniqueValues dictates that this array can only have unique items -func (i *Items) UniqueValues() *Items { - i.UniqueItems = true - return i -} - -// AllowDuplicates this array can have duplicates -func (i *Items) AllowDuplicates() *Items { - i.UniqueItems = false - return i -} - -// WithValidations is a fluent method to set Items validations -func (i *Items) WithValidations(val CommonValidations) *Items { - i.SetValidations(SchemaValidations{CommonValidations: val}) - return i -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (i *Items) UnmarshalJSON(data []byte) error { - var validations CommonValidations - if err := json.Unmarshal(data, &validations); err != nil { - return err - } - var ref Refable - if err := json.Unmarshal(data, &ref); err != nil { - return err - } - var simpleSchema SimpleSchema - if err := json.Unmarshal(data, &simpleSchema); err != nil { - return err - } - var vendorExtensible VendorExtensible - if err := json.Unmarshal(data, &vendorExtensible); err != nil { - return err - } - i.Refable = ref - i.CommonValidations = validations - i.SimpleSchema = simpleSchema - i.VendorExtensible = vendorExtensible - return nil -} - -// MarshalJSON converts this items object to JSON -func (i Items) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(i.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(i.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(i.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(i.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b4, b3, b1, b2), nil -} - -// JSONLookup look up a value by the json property name -func (i Items) JSONLookup(token string) (interface{}, error) { - if token == jsonRef { - return &i.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(i.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(i.SimpleSchema, token) - return r, err -} diff --git a/vendor/github.com/go-openapi/spec/license.go b/vendor/github.com/go-openapi/spec/license.go deleted file mode 100644 index b42f803..0000000 --- a/vendor/github.com/go-openapi/spec/license.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/swag" -) - -// License information for the exposed API. -// -// For more information: http://goo.gl/8us55a#licenseObject -type License struct { - LicenseProps - VendorExtensible -} - -// LicenseProps holds the properties of a License object -type LicenseProps struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` -} - -// UnmarshalJSON hydrates License from json -func (l *License) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &l.LicenseProps); err != nil { - return err - } - return json.Unmarshal(data, &l.VendorExtensible) -} - -// MarshalJSON produces License as json -func (l License) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(l.LicenseProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(l.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} diff --git a/vendor/github.com/go-openapi/spec/normalizer.go b/vendor/github.com/go-openapi/spec/normalizer.go deleted file mode 100644 index d6c4839..0000000 --- a/vendor/github.com/go-openapi/spec/normalizer.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "net/url" - "path" - "strings" -) - -const fileScheme = "file" - -// normalizeURI ensures that all $ref paths used internally by the expander are canonicalized. -// -// NOTE(windows): there is a tolerance over the strict URI format on windows. -// -// The normalizer accepts relative file URLs like 'Path\File.JSON' as well as absolute file URLs like -// 'C:\Path\file.Yaml'. -// -// Both are canonicalized with a "file://" scheme, slashes and a lower-cased path: -// 'file:///c:/path/file.yaml' -// -// URLs can be specified with a file scheme, like in 'file:///folder/file.json' or -// 'file:///c:\folder\File.json'. -// -// URLs like file://C:\folder are considered invalid (i.e. there is no host 'c:\folder') and a "repair" -// is attempted. -// -// The base path argument is assumed to be canonicalized (e.g. using normalizeBase()). -func normalizeURI(refPath, base string) string { - refURL, err := url.Parse(refPath) - if err != nil { - specLogger.Printf("warning: invalid URI in $ref %q: %v", refPath, err) - refURL, refPath = repairURI(refPath) - } - - fixWindowsURI(refURL, refPath) // noop on non-windows OS - - refURL.Path = path.Clean(refURL.Path) - if refURL.Path == "." { - refURL.Path = "" - } - - r := MustCreateRef(refURL.String()) - if r.IsCanonical() { - return refURL.String() - } - - baseURL, _ := url.Parse(base) - if path.IsAbs(refURL.Path) { - baseURL.Path = refURL.Path - } else if refURL.Path != "" { - baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path) - } - // copying fragment from ref to base - baseURL.Fragment = refURL.Fragment - - return baseURL.String() -} - -// denormalizeRef returns the simplest notation for a normalized $ref, given the path of the original root document. -// -// When calling this, we assume that: -// * $ref is a canonical URI -// * originalRelativeBase is a canonical URI -// -// denormalizeRef is currently used when we rewrite a $ref after a circular $ref has been detected. -// In this case, expansion stops and normally renders the internal canonical $ref. -// -// This internal $ref is eventually rebased to the original RelativeBase used for the expansion. -// -// There is a special case for schemas that are anchored with an "id": -// in that case, the rebasing is performed // against the id only if this is an anchor for the initial root document. -// All other intermediate "id"'s found along the way are ignored for the purpose of rebasing. -// -func denormalizeRef(ref *Ref, originalRelativeBase, id string) Ref { - debugLog("denormalizeRef called:\n$ref: %q\noriginal: %s\nroot ID:%s", ref.String(), originalRelativeBase, id) - - if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly { - // short circuit: $ref to current doc - return *ref - } - - if id != "" { - idBaseURL, err := url.Parse(id) - if err == nil { // if the schema id is not usable as a URI, ignore it - if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchaged (do not want $ref: "") - // $ref relative to the ID of the schema in the root document - return ref - } - } - } - - originalRelativeBaseURL, _ := url.Parse(originalRelativeBase) - - r, _ := rebase(ref, originalRelativeBaseURL, false) - - return r -} - -func rebase(ref *Ref, v *url.URL, notEqual bool) (Ref, bool) { - var newBase url.URL - - u := ref.GetURL() - - if u.Scheme != v.Scheme || u.Host != v.Host { - return *ref, false - } - - docPath := v.Path - v.Path = path.Dir(v.Path) - - if v.Path == "." { - v.Path = "" - } else if !strings.HasSuffix(v.Path, "/") { - v.Path += "/" - } - - newBase.Fragment = u.Fragment - - if strings.HasPrefix(u.Path, docPath) { - newBase.Path = strings.TrimPrefix(u.Path, docPath) - } else { - newBase.Path = strings.TrimPrefix(u.Path, v.Path) - } - - if notEqual && newBase.Path == "" && newBase.Fragment == "" { - // do not want rebasing to end up in an empty $ref - return *ref, false - } - - if path.IsAbs(newBase.Path) { - // whenever we end up with an absolute path, specify the scheme and host - newBase.Scheme = v.Scheme - newBase.Host = v.Host - } - - return MustCreateRef(newBase.String()), true -} - -// normalizeRef canonicalize a Ref, using a canonical relativeBase as its absolute anchor -func normalizeRef(ref *Ref, relativeBase string) *Ref { - r := MustCreateRef(normalizeURI(ref.String(), relativeBase)) - return &r -} - -// normalizeBase performs a normalization of the input base path. -// -// This always yields a canonical URI (absolute), usable for the document cache. -// -// It ensures that all further internal work on basePath may safely assume -// a non-empty, cross-platform, canonical URI (i.e. absolute). -// -// This normalization tolerates windows paths (e.g. C:\x\y\File.dat) and transform this -// in a file:// URL with lower cased drive letter and path. -// -// See also: https://en.wikipedia.org/wiki/File_URI_scheme -func normalizeBase(in string) string { - u, err := url.Parse(in) - if err != nil { - specLogger.Printf("warning: invalid URI in RelativeBase %q: %v", in, err) - u, in = repairURI(in) - } - - u.Fragment = "" // any fragment in the base is irrelevant - - fixWindowsURI(u, in) // noop on non-windows OS - - u.Path = path.Clean(u.Path) - if u.Path == "." { // empty after Clean() - u.Path = "" - } - - if u.Scheme != "" { - if path.IsAbs(u.Path) || u.Scheme != fileScheme { - // this is absolute or explicitly not a local file: we're good - return u.String() - } - } - - // no scheme or file scheme with relative path: assume file and make it absolute - // enforce scheme file://... with absolute path. - // - // If the input path is relative, we anchor the path to the current working directory. - // NOTE: we may end up with a host component. Leave it unchanged: e.g. file://host/folder/file.json - - u.Scheme = fileScheme - u.Path = absPath(u.Path) // platform-dependent - u.RawQuery = "" // any query component is irrelevant for a base - return u.String() -} diff --git a/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go b/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go deleted file mode 100644 index c8a0645..0000000 --- a/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go +++ /dev/null @@ -1,43 +0,0 @@ -// +build !windows - -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "net/url" - "path/filepath" -) - -// absPath makes a file path absolute and compatible with a URI path component. -// -// The parameter must be a path, not an URI. -func absPath(in string) string { - anchored, err := filepath.Abs(in) - if err != nil { - specLogger.Printf("warning: could not resolve current working directory: %v", err) - return in - } - return anchored -} - -func repairURI(in string) (*url.URL, string) { - u, _ := url.Parse("") - debugLog("repaired URI: original: %q, repaired: %q", in, "") - return u, "" -} - -func fixWindowsURI(u *url.URL, in string) { -} diff --git a/vendor/github.com/go-openapi/spec/normalizer_windows.go b/vendor/github.com/go-openapi/spec/normalizer_windows.go deleted file mode 100644 index fe2d1ec..0000000 --- a/vendor/github.com/go-openapi/spec/normalizer_windows.go +++ /dev/null @@ -1,154 +0,0 @@ -// -build windows - -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "net/url" - "os" - "path" - "path/filepath" - "strings" -) - -// absPath makes a file path absolute and compatible with a URI path component -// -// The parameter must be a path, not an URI. -func absPath(in string) string { - // NOTE(windows): filepath.Abs exhibits a special behavior on windows for empty paths. - // See https://github.com/golang/go/issues/24441 - if in == "" { - in = "." - } - - anchored, err := filepath.Abs(in) - if err != nil { - specLogger.Printf("warning: could not resolve current working directory: %v", err) - return in - } - - pth := strings.ReplaceAll(strings.ToLower(anchored), `\`, `/`) - if !strings.HasPrefix(pth, "/") { - pth = "/" + pth - } - - return path.Clean(pth) -} - -// repairURI tolerates invalid file URIs with common typos -// such as 'file://E:\folder\file', that break the regular URL parser. -// -// Adopting the same defaults as for unixes (e.g. return an empty path) would -// result into a counter-intuitive result for that case (e.g. E:\folder\file is -// eventually resolved as the current directory). The repair will detect the missing "/". -// -// Note that this only works for the file scheme. -func repairURI(in string) (*url.URL, string) { - const prefix = fileScheme + "://" - if !strings.HasPrefix(in, prefix) { - // giving up: resolve to empty path - u, _ := url.Parse("") - - return u, "" - } - - // attempt the repair, stripping the scheme should be sufficient - u, _ := url.Parse(strings.TrimPrefix(in, prefix)) - debugLog("repaired URI: original: %q, repaired: %q", in, u.String()) - - return u, u.String() -} - -// fixWindowsURI tolerates an absolute file path on windows such as C:\Base\File.yaml or \\host\share\Base\File.yaml -// and makes it a canonical URI: file:///c:/base/file.yaml -// -// Catch 22 notes for Windows: -// -// * There may be a drive letter on windows (it is lower-cased) -// * There may be a share UNC, e.g. \\server\folder\data.xml -// * Paths are case insensitive -// * Paths may already contain slashes -// * Paths must be slashed -// -// NOTE: there is no escaping. "/" may be valid separators just like "\". -// We don't use ToSlash() (which escapes everything) because windows now also -// tolerates the use of "/". Hence, both C:\File.yaml and C:/File.yaml will work. -func fixWindowsURI(u *url.URL, in string) { - drive := filepath.VolumeName(in) - - if len(drive) > 0 { - if len(u.Scheme) == 1 && strings.EqualFold(u.Scheme, drive[:1]) { // a path with a drive letter - u.Scheme = fileScheme - u.Host = "" - u.Path = strings.Join([]string{drive, u.Opaque, u.Path}, `/`) // reconstruct the full path component (no fragment, no query) - } else if u.Host == "" && strings.HasPrefix(u.Path, drive) { // a path with a \\host volume - // NOTE: the special host@port syntax for UNC is not supported (yet) - u.Scheme = fileScheme - - // this is a modified version of filepath.Dir() to apply on the VolumeName itself - i := len(drive) - 1 - for i >= 0 && !os.IsPathSeparator(drive[i]) { - i-- - } - host := drive[:i] // \\host\share => host - - u.Path = strings.TrimPrefix(u.Path, host) - u.Host = strings.TrimPrefix(host, `\\`) - } - - u.Opaque = "" - u.Path = strings.ReplaceAll(strings.ToLower(u.Path), `\`, `/`) - - // ensure we form an absolute path - if !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - - u.Path = path.Clean(u.Path) - - return - } - - if u.Scheme == fileScheme { - // Handle dodgy cases for file://{...} URIs on windows. - // A canonical URI should always be followed by an absolute path. - // - // Examples: - // * file:///folder/file => valid, unchanged - // * file:///c:\folder\file => slashed - // * file:///./folder/file => valid, cleaned to remove the dot - // * file:///.\folder\file => remapped to cwd - // * file:///. => dodgy, remapped to / (consistent with the behavior on unix) - // * file:///.. => dodgy, remapped to / (consistent with the behavior on unix) - if (!path.IsAbs(u.Path) && !filepath.IsAbs(u.Path)) || (strings.HasPrefix(u.Path, `/.`) && strings.Contains(u.Path, `\`)) { - // ensure we form an absolute path - u.Path, _ = filepath.Abs(strings.TrimLeft(u.Path, `/`)) - if !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - } - u.Path = strings.ToLower(u.Path) - } - - // NOTE: lower case normalization does not propagate to inner resources, - // generated when rebasing: when joining a relative URI with a file to an absolute base, - // only the base is currently lower-cased. - // - // For now, we assume this is good enough for most use cases - // and try not to generate too many differences - // between the output produced on different platforms. - u.Path = path.Clean(strings.ReplaceAll(u.Path, `\`, `/`)) -} diff --git a/vendor/github.com/go-openapi/spec/operation.go b/vendor/github.com/go-openapi/spec/operation.go deleted file mode 100644 index 995ce6a..0000000 --- a/vendor/github.com/go-openapi/spec/operation.go +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "sort" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -func init() { - gob.Register(map[string]interface{}{}) - gob.Register([]interface{}{}) -} - -// OperationProps describes an operation -// -// NOTES: -// - schemes, when present must be from [http, https, ws, wss]: see validate -// - Security is handled as a special case: see MarshalJSON function -type OperationProps struct { - Description string `json:"description,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` - Tags []string `json:"tags,omitempty"` - Summary string `json:"summary,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - ID string `json:"operationId,omitempty"` - Deprecated bool `json:"deprecated,omitempty"` - Security []map[string][]string `json:"security,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` - Responses *Responses `json:"responses,omitempty"` -} - -// MarshalJSON takes care of serializing operation properties to JSON -// -// We use a custom marhaller here to handle a special cases related to -// the Security field. We need to preserve zero length slice -// while omitting the field when the value is nil/unset. -func (op OperationProps) MarshalJSON() ([]byte, error) { - type Alias OperationProps - if op.Security == nil { - return json.Marshal(&struct { - Security []map[string][]string `json:"security,omitempty"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) - } - return json.Marshal(&struct { - Security []map[string][]string `json:"security"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) -} - -// Operation describes a single API operation on a path. -// -// For more information: http://goo.gl/8us55a#operationObject -type Operation struct { - VendorExtensible - OperationProps -} - -// SuccessResponse gets a success response model -func (o *Operation) SuccessResponse() (*Response, int, bool) { - if o.Responses == nil { - return nil, 0, false - } - - responseCodes := make([]int, 0, len(o.Responses.StatusCodeResponses)) - for k := range o.Responses.StatusCodeResponses { - if k >= 200 && k < 300 { - responseCodes = append(responseCodes, k) - } - } - if len(responseCodes) > 0 { - sort.Ints(responseCodes) - v := o.Responses.StatusCodeResponses[responseCodes[0]] - return &v, responseCodes[0], true - } - - return o.Responses.Default, 0, false -} - -// JSONLookup look up a value by the json property name -func (o Operation) JSONLookup(token string) (interface{}, error) { - if ex, ok := o.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(o.OperationProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (o *Operation) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &o.OperationProps); err != nil { - return err - } - return json.Unmarshal(data, &o.VendorExtensible) -} - -// MarshalJSON converts this items object to JSON -func (o Operation) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(o.OperationProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(o.VendorExtensible) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -// NewOperation creates a new operation instance. -// It expects an ID as parameter but not passing an ID is also valid. -func NewOperation(id string) *Operation { - op := new(Operation) - op.ID = id - return op -} - -// WithID sets the ID property on this operation, allows for chaining. -func (o *Operation) WithID(id string) *Operation { - o.ID = id - return o -} - -// WithDescription sets the description on this operation, allows for chaining -func (o *Operation) WithDescription(description string) *Operation { - o.Description = description - return o -} - -// WithSummary sets the summary on this operation, allows for chaining -func (o *Operation) WithSummary(summary string) *Operation { - o.Summary = summary - return o -} - -// WithExternalDocs sets/removes the external docs for/from this operation. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (o *Operation) WithExternalDocs(description, url string) *Operation { - if description == "" && url == "" { - o.ExternalDocs = nil - return o - } - - if o.ExternalDocs == nil { - o.ExternalDocs = &ExternalDocumentation{} - } - o.ExternalDocs.Description = description - o.ExternalDocs.URL = url - return o -} - -// Deprecate marks the operation as deprecated -func (o *Operation) Deprecate() *Operation { - o.Deprecated = true - return o -} - -// Undeprecate marks the operation as not deprected -func (o *Operation) Undeprecate() *Operation { - o.Deprecated = false - return o -} - -// WithConsumes adds media types for incoming body values -func (o *Operation) WithConsumes(mediaTypes ...string) *Operation { - o.Consumes = append(o.Consumes, mediaTypes...) - return o -} - -// WithProduces adds media types for outgoing body values -func (o *Operation) WithProduces(mediaTypes ...string) *Operation { - o.Produces = append(o.Produces, mediaTypes...) - return o -} - -// WithTags adds tags for this operation -func (o *Operation) WithTags(tags ...string) *Operation { - o.Tags = append(o.Tags, tags...) - return o -} - -// AddParam adds a parameter to this operation, when a parameter for that location -// and with that name already exists it will be replaced -func (o *Operation) AddParam(param *Parameter) *Operation { - if param == nil { - return o - } - - for i, p := range o.Parameters { - if p.Name == param.Name && p.In == param.In { - params := append(o.Parameters[:i], *param) - params = append(params, o.Parameters[i+1:]...) - o.Parameters = params - return o - } - } - - o.Parameters = append(o.Parameters, *param) - return o -} - -// RemoveParam removes a parameter from the operation -func (o *Operation) RemoveParam(name, in string) *Operation { - for i, p := range o.Parameters { - if p.Name == name && p.In == in { - o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...) - return o - } - } - return o -} - -// SecuredWith adds a security scope to this operation. -func (o *Operation) SecuredWith(name string, scopes ...string) *Operation { - o.Security = append(o.Security, map[string][]string{name: scopes}) - return o -} - -// WithDefaultResponse adds a default response to the operation. -// Passing a nil value will remove the response -func (o *Operation) WithDefaultResponse(response *Response) *Operation { - return o.RespondsWith(0, response) -} - -// RespondsWith adds a status code response to the operation. -// When the code is 0 the value of the response will be used as default response value. -// When the value of the response is nil it will be removed from the operation -func (o *Operation) RespondsWith(code int, response *Response) *Operation { - if o.Responses == nil { - o.Responses = new(Responses) - } - if code == 0 { - o.Responses.Default = response - return o - } - if response == nil { - delete(o.Responses.StatusCodeResponses, code) - return o - } - if o.Responses.StatusCodeResponses == nil { - o.Responses.StatusCodeResponses = make(map[int]Response) - } - o.Responses.StatusCodeResponses[code] = *response - return o -} - -type opsAlias OperationProps - -type gobAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *opsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for Operation, including empty security requirements -func (o Operation) GobEncode() ([]byte, error) { - raw := struct { - Ext VendorExtensible - Props OperationProps - }{ - Ext: o.VendorExtensible, - Props: o.OperationProps, - } - var b bytes.Buffer - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Operation, including empty security requirements -func (o *Operation) GobDecode(b []byte) error { - var raw struct { - Ext VendorExtensible - Props OperationProps - } - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - o.VendorExtensible = raw.Ext - o.OperationProps = raw.Props - return nil -} - -// GobEncode provides a safe gob encoder for Operation, including empty security requirements -func (op OperationProps) GobEncode() ([]byte, error) { - raw := gobAlias{ - Alias: (*opsAlias)(&op), - } - - var b bytes.Buffer - if op.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(op.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(op.Security)) - for _, req := range op.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Operation, including empty security requirements -func (op *OperationProps) GobDecode(b []byte) error { - var raw gobAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *op = *(*OperationProps)(raw.Alias) - return nil -} diff --git a/vendor/github.com/go-openapi/spec/parameter.go b/vendor/github.com/go-openapi/spec/parameter.go deleted file mode 100644 index 2b2b89b..0000000 --- a/vendor/github.com/go-openapi/spec/parameter.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// QueryParam creates a query parameter -func QueryParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "query"}} -} - -// HeaderParam creates a header parameter, this is always required by default -func HeaderParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "header", Required: true}} -} - -// PathParam creates a path parameter, this is always required -func PathParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "path", Required: true}} -} - -// BodyParam creates a body parameter -func BodyParam(name string, schema *Schema) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}} -} - -// FormDataParam creates a body parameter -func FormDataParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}} -} - -// FileParam creates a body parameter -func FileParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}, - SimpleSchema: SimpleSchema{Type: "file"}} -} - -// SimpleArrayParam creates a param for a simple array (string, int, date etc) -func SimpleArrayParam(name, tpe, fmt string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name}, - SimpleSchema: SimpleSchema{Type: jsonArray, CollectionFormat: "csv", - Items: &Items{SimpleSchema: SimpleSchema{Type: tpe, Format: fmt}}}} -} - -// ParamRef creates a parameter that's a json reference -func ParamRef(uri string) *Parameter { - p := new(Parameter) - p.Ref = MustCreateRef(uri) - return p -} - -// ParamProps describes the specific attributes of an operation parameter -// -// NOTE: -// - Schema is defined when "in" == "body": see validate -// - AllowEmptyValue is allowed where "in" == "query" || "formData" -type ParamProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - In string `json:"in,omitempty"` - Required bool `json:"required,omitempty"` - Schema *Schema `json:"schema,omitempty"` - AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` -} - -// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). -// -// There are five possible parameter types. -// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part -// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, -// the path parameter is `itemId`. -// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`. -// * Header - Custom headers that are expected as part of the request. -// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be -// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for -// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist -// together for the same operation. -// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or -// `multipart/form-data` are used as the content type of the request (in Swagger's definition, -// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used -// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be -// declared together with a body parameter for the same operation. Form parameters have a different format based on -// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4). -// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. -// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple -// parameters that are being transferred. -// * `multipart/form-data` - each parameter takes a section in the payload with an internal header. -// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is -// `submit-name`. This type of form parameters is more commonly used for file transfers. -// -// For more information: http://goo.gl/8us55a#parameterObject -type Parameter struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible - ParamProps -} - -// JSONLookup look up a value by the json property name -func (p Parameter) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == jsonRef { - return &p.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.ParamProps, token) - return r, err -} - -// WithDescription a fluent builder method for the description of the parameter -func (p *Parameter) WithDescription(description string) *Parameter { - p.Description = description - return p -} - -// Named a fluent builder method to override the name of the parameter -func (p *Parameter) Named(name string) *Parameter { - p.Name = name - return p -} - -// WithLocation a fluent builder method to override the location of the parameter -func (p *Parameter) WithLocation(in string) *Parameter { - p.In = in - return p -} - -// Typed a fluent builder method for the type of the parameter value -func (p *Parameter) Typed(tpe, format string) *Parameter { - p.Type = tpe - p.Format = format - return p -} - -// CollectionOf a fluent builder method for an array parameter -func (p *Parameter) CollectionOf(items *Items, format string) *Parameter { - p.Type = jsonArray - p.Items = items - p.CollectionFormat = format - return p -} - -// WithDefault sets the default value on this parameter -func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter { - p.AsOptional() // with default implies optional - p.Default = defaultValue - return p -} - -// AllowsEmptyValues flags this parameter as being ok with empty values -func (p *Parameter) AllowsEmptyValues() *Parameter { - p.AllowEmptyValue = true - return p -} - -// NoEmptyValues flags this parameter as not liking empty values -func (p *Parameter) NoEmptyValues() *Parameter { - p.AllowEmptyValue = false - return p -} - -// AsOptional flags this parameter as optional -func (p *Parameter) AsOptional() *Parameter { - p.Required = false - return p -} - -// AsRequired flags this parameter as required -func (p *Parameter) AsRequired() *Parameter { - if p.Default != nil { // with a default required makes no sense - return p - } - p.Required = true - return p -} - -// WithMaxLength sets a max length value -func (p *Parameter) WithMaxLength(max int64) *Parameter { - p.MaxLength = &max - return p -} - -// WithMinLength sets a min length value -func (p *Parameter) WithMinLength(min int64) *Parameter { - p.MinLength = &min - return p -} - -// WithPattern sets a pattern value -func (p *Parameter) WithPattern(pattern string) *Parameter { - p.Pattern = pattern - return p -} - -// WithMultipleOf sets a multiple of value -func (p *Parameter) WithMultipleOf(number float64) *Parameter { - p.MultipleOf = &number - return p -} - -// WithMaximum sets a maximum number value -func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter { - p.Maximum = &max - p.ExclusiveMaximum = exclusive - return p -} - -// WithMinimum sets a minimum number value -func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter { - p.Minimum = &min - p.ExclusiveMinimum = exclusive - return p -} - -// WithEnum sets a the enum values (replace) -func (p *Parameter) WithEnum(values ...interface{}) *Parameter { - p.Enum = append([]interface{}{}, values...) - return p -} - -// WithMaxItems sets the max items -func (p *Parameter) WithMaxItems(size int64) *Parameter { - p.MaxItems = &size - return p -} - -// WithMinItems sets the min items -func (p *Parameter) WithMinItems(size int64) *Parameter { - p.MinItems = &size - return p -} - -// UniqueValues dictates that this array can only have unique items -func (p *Parameter) UniqueValues() *Parameter { - p.UniqueItems = true - return p -} - -// AllowDuplicates this array can have duplicates -func (p *Parameter) AllowDuplicates() *Parameter { - p.UniqueItems = false - return p -} - -// WithValidations is a fluent method to set parameter validations -func (p *Parameter) WithValidations(val CommonValidations) *Parameter { - p.SetValidations(SchemaValidations{CommonValidations: val}) - return p -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Parameter) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &p.ParamProps) -} - -// MarshalJSON converts this items object to JSON -func (p Parameter) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(p.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.ParamProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b3, b1, b2, b4, b5), nil -} diff --git a/vendor/github.com/go-openapi/spec/path_item.go b/vendor/github.com/go-openapi/spec/path_item.go deleted file mode 100644 index 68fc8e9..0000000 --- a/vendor/github.com/go-openapi/spec/path_item.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// PathItemProps the path item specific properties -type PathItemProps struct { - Get *Operation `json:"get,omitempty"` - Put *Operation `json:"put,omitempty"` - Post *Operation `json:"post,omitempty"` - Delete *Operation `json:"delete,omitempty"` - Options *Operation `json:"options,omitempty"` - Head *Operation `json:"head,omitempty"` - Patch *Operation `json:"patch,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` -} - -// PathItem describes the operations available on a single path. -// A Path Item may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). -// The path itself is still exposed to the documentation viewer but they will -// not know which operations and parameters are available. -// -// For more information: http://goo.gl/8us55a#pathItemObject -type PathItem struct { - Refable - VendorExtensible - PathItemProps -} - -// JSONLookup look up a value by the json property name -func (p PathItem) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == jsonRef { - return &p.Ref, nil - } - r, _, err := jsonpointer.GetForToken(p.PathItemProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *PathItem) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &p.PathItemProps) -} - -// MarshalJSON converts this items object to JSON -func (p PathItem) MarshalJSON() ([]byte, error) { - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.PathItemProps) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b3, b4, b5) - return concated, nil -} diff --git a/vendor/github.com/go-openapi/spec/paths.go b/vendor/github.com/go-openapi/spec/paths.go deleted file mode 100644 index 9dc82a2..0000000 --- a/vendor/github.com/go-openapi/spec/paths.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/go-openapi/swag" -) - -// Paths holds the relative paths to the individual endpoints. -// The path is appended to the [`basePath`](http://goo.gl/8us55a#swaggerBasePath) in order -// to construct the full URL. -// The Paths may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). -// -// For more information: http://goo.gl/8us55a#pathsObject -type Paths struct { - VendorExtensible - Paths map[string]PathItem `json:"-"` // custom serializer to flatten this, each entry must start with "/" -} - -// JSONLookup look up a value by the json property name -func (p Paths) JSONLookup(token string) (interface{}, error) { - if pi, ok := p.Paths[token]; ok { - return &pi, nil - } - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - return nil, fmt.Errorf("object has no field %q", token) -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Paths) UnmarshalJSON(data []byte) error { - var res map[string]json.RawMessage - if err := json.Unmarshal(data, &res); err != nil { - return err - } - for k, v := range res { - if strings.HasPrefix(strings.ToLower(k), "x-") { - if p.Extensions == nil { - p.Extensions = make(map[string]interface{}) - } - var d interface{} - if err := json.Unmarshal(v, &d); err != nil { - return err - } - p.Extensions[k] = d - } - if strings.HasPrefix(k, "/") { - if p.Paths == nil { - p.Paths = make(map[string]PathItem) - } - var pi PathItem - if err := json.Unmarshal(v, &pi); err != nil { - return err - } - p.Paths[k] = pi - } - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (p Paths) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - - pths := make(map[string]PathItem) - for k, v := range p.Paths { - if strings.HasPrefix(k, "/") { - pths[k] = v - } - } - b2, err := json.Marshal(pths) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} diff --git a/vendor/github.com/go-openapi/spec/properties.go b/vendor/github.com/go-openapi/spec/properties.go deleted file mode 100644 index 2af1378..0000000 --- a/vendor/github.com/go-openapi/spec/properties.go +++ /dev/null @@ -1,91 +0,0 @@ -package spec - -import ( - "bytes" - "encoding/json" - "reflect" - "sort" -) - -// OrderSchemaItem holds a named schema (e.g. from a property of an object) -type OrderSchemaItem struct { - Name string - Schema -} - -// OrderSchemaItems is a sortable slice of named schemas. -// The ordering is defined by the x-order schema extension. -type OrderSchemaItems []OrderSchemaItem - -// MarshalJSON produces a json object with keys defined by the name schemas -// of the OrderSchemaItems slice, keeping the original order of the slice. -func (items OrderSchemaItems) MarshalJSON() ([]byte, error) { - buf := bytes.NewBuffer(nil) - buf.WriteString("{") - for i := range items { - if i > 0 { - buf.WriteString(",") - } - buf.WriteString("\"") - buf.WriteString(items[i].Name) - buf.WriteString("\":") - bs, err := json.Marshal(&items[i].Schema) - if err != nil { - return nil, err - } - buf.Write(bs) - } - buf.WriteString("}") - return buf.Bytes(), nil -} - -func (items OrderSchemaItems) Len() int { return len(items) } -func (items OrderSchemaItems) Swap(i, j int) { items[i], items[j] = items[j], items[i] } -func (items OrderSchemaItems) Less(i, j int) (ret bool) { - ii, oki := items[i].Extensions.GetString("x-order") - ij, okj := items[j].Extensions.GetString("x-order") - if oki { - if okj { - defer func() { - if err := recover(); err != nil { - defer func() { - if err = recover(); err != nil { - ret = items[i].Name < items[j].Name - } - }() - ret = reflect.ValueOf(ii).String() < reflect.ValueOf(ij).String() - } - }() - return reflect.ValueOf(ii).Int() < reflect.ValueOf(ij).Int() - } - return true - } else if okj { - return false - } - return items[i].Name < items[j].Name -} - -// SchemaProperties is a map representing the properties of a Schema object. -// It knows how to transform its keys into an ordered slice. -type SchemaProperties map[string]Schema - -// ToOrderedSchemaItems transforms the map of properties into a sortable slice -func (properties SchemaProperties) ToOrderedSchemaItems() OrderSchemaItems { - items := make(OrderSchemaItems, 0, len(properties)) - for k, v := range properties { - items = append(items, OrderSchemaItem{ - Name: k, - Schema: v, - }) - } - sort.Sort(items) - return items -} - -// MarshalJSON produces properties as json, keeping their order. -func (properties SchemaProperties) MarshalJSON() ([]byte, error) { - if properties == nil { - return []byte("null"), nil - } - return json.Marshal(properties.ToOrderedSchemaItems()) -} diff --git a/vendor/github.com/go-openapi/spec/ref.go b/vendor/github.com/go-openapi/spec/ref.go deleted file mode 100644 index b0ef9bd..0000000 --- a/vendor/github.com/go-openapi/spec/ref.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "net/http" - "os" - "path/filepath" - - "github.com/go-openapi/jsonreference" -) - -// Refable is a struct for things that accept a $ref property -type Refable struct { - Ref Ref -} - -// MarshalJSON marshals the ref to json -func (r Refable) MarshalJSON() ([]byte, error) { - return r.Ref.MarshalJSON() -} - -// UnmarshalJSON unmarshalss the ref from json -func (r *Refable) UnmarshalJSON(d []byte) error { - return json.Unmarshal(d, &r.Ref) -} - -// Ref represents a json reference that is potentially resolved -type Ref struct { - jsonreference.Ref -} - -// RemoteURI gets the remote uri part of the ref -func (r *Ref) RemoteURI() string { - if r.String() == "" { - return "" - } - - u := *r.GetURL() - u.Fragment = "" - return u.String() -} - -// IsValidURI returns true when the url the ref points to can be found -func (r *Ref) IsValidURI(basepaths ...string) bool { - if r.String() == "" { - return true - } - - v := r.RemoteURI() - if v == "" { - return true - } - - if r.HasFullURL { - //nolint:noctx,gosec - rr, err := http.Get(v) - if err != nil { - return false - } - defer rr.Body.Close() - - return rr.StatusCode/100 == 2 - } - - if !(r.HasFileScheme || r.HasFullFilePath || r.HasURLPathOnly) { - return false - } - - // check for local file - pth := v - if r.HasURLPathOnly { - base := "." - if len(basepaths) > 0 { - base = filepath.Dir(filepath.Join(basepaths...)) - } - p, e := filepath.Abs(filepath.ToSlash(filepath.Join(base, pth))) - if e != nil { - return false - } - pth = p - } - - fi, err := os.Stat(filepath.ToSlash(pth)) - if err != nil { - return false - } - - return !fi.IsDir() -} - -// Inherits creates a new reference from a parent and a child -// If the child cannot inherit from the parent, an error is returned -func (r *Ref) Inherits(child Ref) (*Ref, error) { - ref, err := r.Ref.Inherits(child.Ref) - if err != nil { - return nil, err - } - return &Ref{Ref: *ref}, nil -} - -// NewRef creates a new instance of a ref object -// returns an error when the reference uri is an invalid uri -func NewRef(refURI string) (Ref, error) { - ref, err := jsonreference.New(refURI) - if err != nil { - return Ref{}, err - } - return Ref{Ref: ref}, nil -} - -// MustCreateRef creates a ref object but panics when refURI is invalid. -// Use the NewRef method for a version that returns an error. -func MustCreateRef(refURI string) Ref { - return Ref{Ref: jsonreference.MustCreateRef(refURI)} -} - -// MarshalJSON marshals this ref into a JSON object -func (r Ref) MarshalJSON() ([]byte, error) { - str := r.String() - if str == "" { - if r.IsRoot() { - return []byte(`{"$ref":""}`), nil - } - return []byte("{}"), nil - } - v := map[string]interface{}{"$ref": str} - return json.Marshal(v) -} - -// UnmarshalJSON unmarshals this ref from a JSON object -func (r *Ref) UnmarshalJSON(d []byte) error { - var v map[string]interface{} - if err := json.Unmarshal(d, &v); err != nil { - return err - } - return r.fromMap(v) -} - -// GobEncode provides a safe gob encoder for Ref -func (r Ref) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw, err := r.MarshalJSON() - if err != nil { - return nil, err - } - err = gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Ref -func (r *Ref) GobDecode(b []byte) error { - var raw []byte - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - return json.Unmarshal(raw, r) -} - -func (r *Ref) fromMap(v map[string]interface{}) error { - if v == nil { - return nil - } - - if vv, ok := v["$ref"]; ok { - if str, ok := vv.(string); ok { - ref, err := jsonreference.New(str) - if err != nil { - return err - } - *r = Ref{Ref: ref} - } - } - - return nil -} diff --git a/vendor/github.com/go-openapi/spec/resolver.go b/vendor/github.com/go-openapi/spec/resolver.go deleted file mode 100644 index 47d1ee1..0000000 --- a/vendor/github.com/go-openapi/spec/resolver.go +++ /dev/null @@ -1,127 +0,0 @@ -package spec - -import ( - "fmt" - - "github.com/go-openapi/swag" -) - -func resolveAnyWithBase(root interface{}, ref *Ref, result interface{}, options *ExpandOptions) error { - options = optionsOrDefault(options) - resolver := defaultSchemaLoader(root, options, nil, nil) - - if err := resolver.Resolve(ref, result, options.RelativeBase); err != nil { - return err - } - - return nil -} - -// ResolveRefWithBase resolves a reference against a context root with preservation of base path -func ResolveRefWithBase(root interface{}, ref *Ref, options *ExpandOptions) (*Schema, error) { - result := new(Schema) - - if err := resolveAnyWithBase(root, ref, result, options); err != nil { - return nil, err - } - - return result, nil -} - -// ResolveRef resolves a reference for a schema against a context root -// ref is guaranteed to be in root (no need to go to external files) -// -// ResolveRef is ONLY called from the code generation module -func ResolveRef(root interface{}, ref *Ref) (*Schema, error) { - res, _, err := ref.GetPointer().Get(root) - if err != nil { - return nil, err - } - - switch sch := res.(type) { - case Schema: - return &sch, nil - case *Schema: - return sch, nil - case map[string]interface{}: - newSch := new(Schema) - if err = swag.DynamicJSONToStruct(sch, newSch); err != nil { - return nil, err - } - return newSch, nil - default: - return nil, fmt.Errorf("type: %T: %w", sch, ErrUnknownTypeForReference) - } -} - -// ResolveParameterWithBase resolves a parameter reference against a context root and base path -func ResolveParameterWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Parameter, error) { - result := new(Parameter) - - if err := resolveAnyWithBase(root, &ref, result, options); err != nil { - return nil, err - } - - return result, nil -} - -// ResolveParameter resolves a parameter reference against a context root -func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { - return ResolveParameterWithBase(root, ref, nil) -} - -// ResolveResponseWithBase resolves response a reference against a context root and base path -func ResolveResponseWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Response, error) { - result := new(Response) - - err := resolveAnyWithBase(root, &ref, result, options) - if err != nil { - return nil, err - } - - return result, nil -} - -// ResolveResponse resolves response a reference against a context root -func ResolveResponse(root interface{}, ref Ref) (*Response, error) { - return ResolveResponseWithBase(root, ref, nil) -} - -// ResolvePathItemWithBase resolves response a path item against a context root and base path -func ResolvePathItemWithBase(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) { - result := new(PathItem) - - if err := resolveAnyWithBase(root, &ref, result, options); err != nil { - return nil, err - } - - return result, nil -} - -// ResolvePathItem resolves response a path item against a context root and base path -// -// Deprecated: use ResolvePathItemWithBase instead -func ResolvePathItem(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) { - return ResolvePathItemWithBase(root, ref, options) -} - -// ResolveItemsWithBase resolves parameter items reference against a context root and base path. -// -// NOTE: stricly speaking, this construct is not supported by Swagger 2.0. -// Similarly, $ref are forbidden in response headers. -func ResolveItemsWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) { - result := new(Items) - - if err := resolveAnyWithBase(root, &ref, result, options); err != nil { - return nil, err - } - - return result, nil -} - -// ResolveItems resolves parameter items reference against a context root and base path. -// -// Deprecated: use ResolveItemsWithBase instead -func ResolveItems(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) { - return ResolveItemsWithBase(root, ref, options) -} diff --git a/vendor/github.com/go-openapi/spec/response.go b/vendor/github.com/go-openapi/spec/response.go deleted file mode 100644 index 0340b60..0000000 --- a/vendor/github.com/go-openapi/spec/response.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// ResponseProps properties specific to a response -type ResponseProps struct { - Description string `json:"description"` - Schema *Schema `json:"schema,omitempty"` - Headers map[string]Header `json:"headers,omitempty"` - Examples map[string]interface{} `json:"examples,omitempty"` -} - -// Response describes a single response from an API Operation. -// -// For more information: http://goo.gl/8us55a#responseObject -type Response struct { - Refable - ResponseProps - VendorExtensible -} - -// JSONLookup look up a value by the json property name -func (r Response) JSONLookup(token string) (interface{}, error) { - if ex, ok := r.Extensions[token]; ok { - return &ex, nil - } - if token == "$ref" { - return &r.Ref, nil - } - ptr, _, err := jsonpointer.GetForToken(r.ResponseProps, token) - return ptr, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (r *Response) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &r.ResponseProps); err != nil { - return err - } - if err := json.Unmarshal(data, &r.Refable); err != nil { - return err - } - return json.Unmarshal(data, &r.VendorExtensible) -} - -// MarshalJSON converts this items object to JSON -func (r Response) MarshalJSON() ([]byte, error) { - var ( - b1 []byte - err error - ) - - if r.Ref.String() == "" { - // when there is no $ref, empty description is rendered as an empty string - b1, err = json.Marshal(r.ResponseProps) - } else { - // when there is $ref inside the schema, description should be omitempty-ied - b1, err = json.Marshal(struct { - Description string `json:"description,omitempty"` - Schema *Schema `json:"schema,omitempty"` - Headers map[string]Header `json:"headers,omitempty"` - Examples map[string]interface{} `json:"examples,omitempty"` - }{ - Description: r.ResponseProps.Description, - Schema: r.ResponseProps.Schema, - Examples: r.ResponseProps.Examples, - }) - } - if err != nil { - return nil, err - } - - b2, err := json.Marshal(r.Refable) - if err != nil { - return nil, err - } - b3, err := json.Marshal(r.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2, b3), nil -} - -// NewResponse creates a new response instance -func NewResponse() *Response { - return new(Response) -} - -// ResponseRef creates a response as a json reference -func ResponseRef(url string) *Response { - resp := NewResponse() - resp.Ref = MustCreateRef(url) - return resp -} - -// WithDescription sets the description on this response, allows for chaining -func (r *Response) WithDescription(description string) *Response { - r.Description = description - return r -} - -// WithSchema sets the schema on this response, allows for chaining. -// Passing a nil argument removes the schema from this response -func (r *Response) WithSchema(schema *Schema) *Response { - r.Schema = schema - return r -} - -// AddHeader adds a header to this response -func (r *Response) AddHeader(name string, header *Header) *Response { - if header == nil { - return r.RemoveHeader(name) - } - if r.Headers == nil { - r.Headers = make(map[string]Header) - } - r.Headers[name] = *header - return r -} - -// RemoveHeader removes a header from this response -func (r *Response) RemoveHeader(name string) *Response { - delete(r.Headers, name) - return r -} - -// AddExample adds an example to this response -func (r *Response) AddExample(mediaType string, example interface{}) *Response { - if r.Examples == nil { - r.Examples = make(map[string]interface{}) - } - r.Examples[mediaType] = example - return r -} diff --git a/vendor/github.com/go-openapi/spec/responses.go b/vendor/github.com/go-openapi/spec/responses.go deleted file mode 100644 index 4efb6f8..0000000 --- a/vendor/github.com/go-openapi/spec/responses.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" - - "github.com/go-openapi/swag" -) - -// Responses is a container for the expected responses of an operation. -// The container maps a HTTP response code to the expected response. -// It is not expected from the documentation to necessarily cover all possible HTTP response codes, -// since they may not be known in advance. However, it is expected from the documentation to cover -// a successful operation response and any known errors. -// -// The `default` can be used a default response object for all HTTP codes that are not covered -// individually by the specification. -// -// The `Responses Object` MUST contain at least one response code, and it SHOULD be the response -// for a successful operation call. -// -// For more information: http://goo.gl/8us55a#responsesObject -type Responses struct { - VendorExtensible - ResponsesProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (r Responses) JSONLookup(token string) (interface{}, error) { - if token == "default" { - return r.Default, nil - } - if ex, ok := r.Extensions[token]; ok { - return &ex, nil - } - if i, err := strconv.Atoi(token); err == nil { - if scr, ok := r.StatusCodeResponses[i]; ok { - return scr, nil - } - } - return nil, fmt.Errorf("object has no field %q", token) -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (r *Responses) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &r.ResponsesProps); err != nil { - return err - } - if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { - return err - } - if reflect.DeepEqual(ResponsesProps{}, r.ResponsesProps) { - r.ResponsesProps = ResponsesProps{} - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (r Responses) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(r.ResponsesProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(r.VendorExtensible) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -// ResponsesProps describes all responses for an operation. -// It tells what is the default response and maps all responses with a -// HTTP status code. -type ResponsesProps struct { - Default *Response - StatusCodeResponses map[int]Response -} - -// MarshalJSON marshals responses as JSON -func (r ResponsesProps) MarshalJSON() ([]byte, error) { - toser := map[string]Response{} - if r.Default != nil { - toser["default"] = *r.Default - } - for k, v := range r.StatusCodeResponses { - toser[strconv.Itoa(k)] = v - } - return json.Marshal(toser) -} - -// UnmarshalJSON unmarshals responses from JSON -func (r *ResponsesProps) UnmarshalJSON(data []byte) error { - var res map[string]Response - if err := json.Unmarshal(data, &res); err != nil { - return nil - } - if v, ok := res["default"]; ok { - r.Default = &v - delete(res, "default") - } - for k, v := range res { - if nk, err := strconv.Atoi(k); err == nil { - if r.StatusCodeResponses == nil { - r.StatusCodeResponses = map[int]Response{} - } - r.StatusCodeResponses[nk] = v - } - } - return nil -} diff --git a/vendor/github.com/go-openapi/spec/schema.go b/vendor/github.com/go-openapi/spec/schema.go deleted file mode 100644 index a8d0f73..0000000 --- a/vendor/github.com/go-openapi/spec/schema.go +++ /dev/null @@ -1,646 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// BooleanProperty creates a boolean property -func BooleanProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"boolean"}}} -} - -// BoolProperty creates a boolean property -func BoolProperty() *Schema { return BooleanProperty() } - -// StringProperty creates a string property -func StringProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} -} - -// CharProperty creates a string property -func CharProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} -} - -// Float64Property creates a float64/double property -func Float64Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "double"}} -} - -// Float32Property creates a float32/float property -func Float32Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "float"}} -} - -// Int8Property creates an int8 property -func Int8Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int8"}} -} - -// Int16Property creates an int16 property -func Int16Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int16"}} -} - -// Int32Property creates an int32 property -func Int32Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int32"}} -} - -// Int64Property creates an int64 property -func Int64Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int64"}} -} - -// StrFmtProperty creates a property for the named string format -func StrFmtProperty(format string) *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: format}} -} - -// DateProperty creates a date property -func DateProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date"}} -} - -// DateTimeProperty creates a date time property -func DateTimeProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date-time"}} -} - -// MapProperty creates a map property -func MapProperty(property *Schema) *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"object"}, - AdditionalProperties: &SchemaOrBool{Allows: true, Schema: property}}} -} - -// RefProperty creates a ref property -func RefProperty(name string) *Schema { - return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} -} - -// RefSchema creates a ref property -func RefSchema(name string) *Schema { - return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} -} - -// ArrayProperty creates an array property -func ArrayProperty(items *Schema) *Schema { - if items == nil { - return &Schema{SchemaProps: SchemaProps{Type: []string{"array"}}} - } - return &Schema{SchemaProps: SchemaProps{Items: &SchemaOrArray{Schema: items}, Type: []string{"array"}}} -} - -// ComposedSchema creates a schema with allOf -func ComposedSchema(schemas ...Schema) *Schema { - s := new(Schema) - s.AllOf = schemas - return s -} - -// SchemaURL represents a schema url -type SchemaURL string - -// MarshalJSON marshal this to JSON -func (r SchemaURL) MarshalJSON() ([]byte, error) { - if r == "" { - return []byte("{}"), nil - } - v := map[string]interface{}{"$schema": string(r)} - return json.Marshal(v) -} - -// UnmarshalJSON unmarshal this from JSON -func (r *SchemaURL) UnmarshalJSON(data []byte) error { - var v map[string]interface{} - if err := json.Unmarshal(data, &v); err != nil { - return err - } - return r.fromMap(v) -} - -func (r *SchemaURL) fromMap(v map[string]interface{}) error { - if v == nil { - return nil - } - if vv, ok := v["$schema"]; ok { - if str, ok := vv.(string); ok { - u, err := url.Parse(str) - if err != nil { - return err - } - - *r = SchemaURL(u.String()) - } - } - return nil -} - -// SchemaProps describes a JSON schema (draft 4) -type SchemaProps struct { - ID string `json:"id,omitempty"` - Ref Ref `json:"-"` - Schema SchemaURL `json:"-"` - Description string `json:"description,omitempty"` - Type StringOrArray `json:"type,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Format string `json:"format,omitempty"` - Title string `json:"title,omitempty"` - Default interface{} `json:"default,omitempty"` - Maximum *float64 `json:"maximum,omitempty"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` - Minimum *float64 `json:"minimum,omitempty"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - Pattern string `json:"pattern,omitempty"` - MaxItems *int64 `json:"maxItems,omitempty"` - MinItems *int64 `json:"minItems,omitempty"` - UniqueItems bool `json:"uniqueItems,omitempty"` - MultipleOf *float64 `json:"multipleOf,omitempty"` - Enum []interface{} `json:"enum,omitempty"` - MaxProperties *int64 `json:"maxProperties,omitempty"` - MinProperties *int64 `json:"minProperties,omitempty"` - Required []string `json:"required,omitempty"` - Items *SchemaOrArray `json:"items,omitempty"` - AllOf []Schema `json:"allOf,omitempty"` - OneOf []Schema `json:"oneOf,omitempty"` - AnyOf []Schema `json:"anyOf,omitempty"` - Not *Schema `json:"not,omitempty"` - Properties SchemaProperties `json:"properties,omitempty"` - AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"` - PatternProperties SchemaProperties `json:"patternProperties,omitempty"` - Dependencies Dependencies `json:"dependencies,omitempty"` - AdditionalItems *SchemaOrBool `json:"additionalItems,omitempty"` - Definitions Definitions `json:"definitions,omitempty"` -} - -// SwaggerSchemaProps are additional properties supported by swagger schemas, but not JSON-schema (draft 4) -type SwaggerSchemaProps struct { - Discriminator string `json:"discriminator,omitempty"` - ReadOnly bool `json:"readOnly,omitempty"` - XML *XMLObject `json:"xml,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - Example interface{} `json:"example,omitempty"` -} - -// Schema the schema object allows the definition of input and output data types. -// These types can be objects, but also primitives and arrays. -// This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) -// and uses a predefined subset of it. -// On top of this subset, there are extensions provided by this specification to allow for more complete documentation. -// -// For more information: http://goo.gl/8us55a#schemaObject -type Schema struct { - VendorExtensible - SchemaProps - SwaggerSchemaProps - ExtraProps map[string]interface{} `json:"-"` -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s Schema) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - if ex, ok := s.ExtraProps[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SchemaProps, token) - if r != nil || (err != nil && !strings.HasPrefix(err.Error(), "object has no field")) { - return r, err - } - r, _, err = jsonpointer.GetForToken(s.SwaggerSchemaProps, token) - return r, err -} - -// WithID sets the id for this schema, allows for chaining -func (s *Schema) WithID(id string) *Schema { - s.ID = id - return s -} - -// WithTitle sets the title for this schema, allows for chaining -func (s *Schema) WithTitle(title string) *Schema { - s.Title = title - return s -} - -// WithDescription sets the description for this schema, allows for chaining -func (s *Schema) WithDescription(description string) *Schema { - s.Description = description - return s -} - -// WithProperties sets the properties for this schema -func (s *Schema) WithProperties(schemas map[string]Schema) *Schema { - s.Properties = schemas - return s -} - -// SetProperty sets a property on this schema -func (s *Schema) SetProperty(name string, schema Schema) *Schema { - if s.Properties == nil { - s.Properties = make(map[string]Schema) - } - s.Properties[name] = schema - return s -} - -// WithAllOf sets the all of property -func (s *Schema) WithAllOf(schemas ...Schema) *Schema { - s.AllOf = schemas - return s -} - -// WithMaxProperties sets the max number of properties an object can have -func (s *Schema) WithMaxProperties(max int64) *Schema { - s.MaxProperties = &max - return s -} - -// WithMinProperties sets the min number of properties an object must have -func (s *Schema) WithMinProperties(min int64) *Schema { - s.MinProperties = &min - return s -} - -// Typed sets the type of this schema for a single value item -func (s *Schema) Typed(tpe, format string) *Schema { - s.Type = []string{tpe} - s.Format = format - return s -} - -// AddType adds a type with potential format to the types for this schema -func (s *Schema) AddType(tpe, format string) *Schema { - s.Type = append(s.Type, tpe) - if format != "" { - s.Format = format - } - return s -} - -// AsNullable flags this schema as nullable. -func (s *Schema) AsNullable() *Schema { - s.Nullable = true - return s -} - -// CollectionOf a fluent builder method for an array parameter -func (s *Schema) CollectionOf(items Schema) *Schema { - s.Type = []string{jsonArray} - s.Items = &SchemaOrArray{Schema: &items} - return s -} - -// WithDefault sets the default value on this parameter -func (s *Schema) WithDefault(defaultValue interface{}) *Schema { - s.Default = defaultValue - return s -} - -// WithRequired flags this parameter as required -func (s *Schema) WithRequired(items ...string) *Schema { - s.Required = items - return s -} - -// AddRequired adds field names to the required properties array -func (s *Schema) AddRequired(items ...string) *Schema { - s.Required = append(s.Required, items...) - return s -} - -// WithMaxLength sets a max length value -func (s *Schema) WithMaxLength(max int64) *Schema { - s.MaxLength = &max - return s -} - -// WithMinLength sets a min length value -func (s *Schema) WithMinLength(min int64) *Schema { - s.MinLength = &min - return s -} - -// WithPattern sets a pattern value -func (s *Schema) WithPattern(pattern string) *Schema { - s.Pattern = pattern - return s -} - -// WithMultipleOf sets a multiple of value -func (s *Schema) WithMultipleOf(number float64) *Schema { - s.MultipleOf = &number - return s -} - -// WithMaximum sets a maximum number value -func (s *Schema) WithMaximum(max float64, exclusive bool) *Schema { - s.Maximum = &max - s.ExclusiveMaximum = exclusive - return s -} - -// WithMinimum sets a minimum number value -func (s *Schema) WithMinimum(min float64, exclusive bool) *Schema { - s.Minimum = &min - s.ExclusiveMinimum = exclusive - return s -} - -// WithEnum sets a the enum values (replace) -func (s *Schema) WithEnum(values ...interface{}) *Schema { - s.Enum = append([]interface{}{}, values...) - return s -} - -// WithMaxItems sets the max items -func (s *Schema) WithMaxItems(size int64) *Schema { - s.MaxItems = &size - return s -} - -// WithMinItems sets the min items -func (s *Schema) WithMinItems(size int64) *Schema { - s.MinItems = &size - return s -} - -// UniqueValues dictates that this array can only have unique items -func (s *Schema) UniqueValues() *Schema { - s.UniqueItems = true - return s -} - -// AllowDuplicates this array can have duplicates -func (s *Schema) AllowDuplicates() *Schema { - s.UniqueItems = false - return s -} - -// AddToAllOf adds a schema to the allOf property -func (s *Schema) AddToAllOf(schemas ...Schema) *Schema { - s.AllOf = append(s.AllOf, schemas...) - return s -} - -// WithDiscriminator sets the name of the discriminator field -func (s *Schema) WithDiscriminator(discriminator string) *Schema { - s.Discriminator = discriminator - return s -} - -// AsReadOnly flags this schema as readonly -func (s *Schema) AsReadOnly() *Schema { - s.ReadOnly = true - return s -} - -// AsWritable flags this schema as writeable (not read-only) -func (s *Schema) AsWritable() *Schema { - s.ReadOnly = false - return s -} - -// WithExample sets the example for this schema -func (s *Schema) WithExample(example interface{}) *Schema { - s.Example = example - return s -} - -// WithExternalDocs sets/removes the external docs for/from this schema. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (s *Schema) WithExternalDocs(description, url string) *Schema { - if description == "" && url == "" { - s.ExternalDocs = nil - return s - } - - if s.ExternalDocs == nil { - s.ExternalDocs = &ExternalDocumentation{} - } - s.ExternalDocs.Description = description - s.ExternalDocs.URL = url - return s -} - -// WithXMLName sets the xml name for the object -func (s *Schema) WithXMLName(name string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Name = name - return s -} - -// WithXMLNamespace sets the xml namespace for the object -func (s *Schema) WithXMLNamespace(namespace string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Namespace = namespace - return s -} - -// WithXMLPrefix sets the xml prefix for the object -func (s *Schema) WithXMLPrefix(prefix string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Prefix = prefix - return s -} - -// AsXMLAttribute flags this object as xml attribute -func (s *Schema) AsXMLAttribute() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = true - return s -} - -// AsXMLElement flags this object as an xml node -func (s *Schema) AsXMLElement() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = false - return s -} - -// AsWrappedXML flags this object as wrapped, this is mostly useful for array types -func (s *Schema) AsWrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = true - return s -} - -// AsUnwrappedXML flags this object as an xml node -func (s *Schema) AsUnwrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = false - return s -} - -// SetValidations defines all schema validations. -// -// NOTE: Required, ReadOnly, AllOf, AnyOf, OneOf and Not are not considered. -func (s *Schema) SetValidations(val SchemaValidations) { - s.Maximum = val.Maximum - s.ExclusiveMaximum = val.ExclusiveMaximum - s.Minimum = val.Minimum - s.ExclusiveMinimum = val.ExclusiveMinimum - s.MaxLength = val.MaxLength - s.MinLength = val.MinLength - s.Pattern = val.Pattern - s.MaxItems = val.MaxItems - s.MinItems = val.MinItems - s.UniqueItems = val.UniqueItems - s.MultipleOf = val.MultipleOf - s.Enum = val.Enum - s.MinProperties = val.MinProperties - s.MaxProperties = val.MaxProperties - s.PatternProperties = val.PatternProperties -} - -// WithValidations is a fluent method to set schema validations -func (s *Schema) WithValidations(val SchemaValidations) *Schema { - s.SetValidations(val) - return s -} - -// Validations returns a clone of the validations for this schema -func (s Schema) Validations() SchemaValidations { - return SchemaValidations{ - CommonValidations: CommonValidations{ - Maximum: s.Maximum, - ExclusiveMaximum: s.ExclusiveMaximum, - Minimum: s.Minimum, - ExclusiveMinimum: s.ExclusiveMinimum, - MaxLength: s.MaxLength, - MinLength: s.MinLength, - Pattern: s.Pattern, - MaxItems: s.MaxItems, - MinItems: s.MinItems, - UniqueItems: s.UniqueItems, - MultipleOf: s.MultipleOf, - Enum: s.Enum, - }, - MinProperties: s.MinProperties, - MaxProperties: s.MaxProperties, - PatternProperties: s.PatternProperties, - } -} - -// MarshalJSON marshal this to JSON -func (s Schema) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SchemaProps) - if err != nil { - return nil, fmt.Errorf("schema props %v", err) - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, fmt.Errorf("vendor props %v", err) - } - b3, err := s.Ref.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("ref prop %v", err) - } - b4, err := s.Schema.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("schema prop %v", err) - } - b5, err := json.Marshal(s.SwaggerSchemaProps) - if err != nil { - return nil, fmt.Errorf("common validations %v", err) - } - var b6 []byte - if s.ExtraProps != nil { - jj, err := json.Marshal(s.ExtraProps) - if err != nil { - return nil, fmt.Errorf("extra props %v", err) - } - b6 = jj - } - return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil -} - -// UnmarshalJSON marshal this from JSON -func (s *Schema) UnmarshalJSON(data []byte) error { - props := struct { - SchemaProps - SwaggerSchemaProps - }{} - if err := json.Unmarshal(data, &props); err != nil { - return err - } - - sch := Schema{ - SchemaProps: props.SchemaProps, - SwaggerSchemaProps: props.SwaggerSchemaProps, - } - - var d map[string]interface{} - if err := json.Unmarshal(data, &d); err != nil { - return err - } - - _ = sch.Ref.fromMap(d) - _ = sch.Schema.fromMap(d) - - delete(d, "$ref") - delete(d, "$schema") - for _, pn := range swag.DefaultJSONNameProvider.GetJSONNames(s) { - delete(d, pn) - } - - for k, vv := range d { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - if sch.Extensions == nil { - sch.Extensions = map[string]interface{}{} - } - sch.Extensions[k] = vv - continue - } - if sch.ExtraProps == nil { - sch.ExtraProps = map[string]interface{}{} - } - sch.ExtraProps[k] = vv - } - - *s = sch - - return nil -} diff --git a/vendor/github.com/go-openapi/spec/schema_loader.go b/vendor/github.com/go-openapi/spec/schema_loader.go deleted file mode 100644 index 0059b99..0000000 --- a/vendor/github.com/go-openapi/spec/schema_loader.go +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "log" - "net/url" - "reflect" - "strings" - - "github.com/go-openapi/swag" -) - -// PathLoader is a function to use when loading remote refs. -// -// This is a package level default. It may be overridden or bypassed by -// specifying the loader in ExpandOptions. -// -// NOTE: if you are using the go-openapi/loads package, it will override -// this value with its own default (a loader to retrieve YAML documents as -// well as JSON ones). -var PathLoader = func(pth string) (json.RawMessage, error) { - data, err := swag.LoadFromFileOrHTTP(pth) - if err != nil { - return nil, err - } - return json.RawMessage(data), nil -} - -// resolverContext allows to share a context during spec processing. -// At the moment, it just holds the index of circular references found. -type resolverContext struct { - // circulars holds all visited circular references, to shortcircuit $ref resolution. - // - // This structure is privately instantiated and needs not be locked against - // concurrent access, unless we chose to implement a parallel spec walking. - circulars map[string]bool - basePath string - loadDoc func(string) (json.RawMessage, error) - rootID string -} - -func newResolverContext(options *ExpandOptions) *resolverContext { - expandOptions := optionsOrDefault(options) - - // path loader may be overridden by options - var loader func(string) (json.RawMessage, error) - if expandOptions.PathLoader == nil { - loader = PathLoader - } else { - loader = expandOptions.PathLoader - } - - return &resolverContext{ - circulars: make(map[string]bool), - basePath: expandOptions.RelativeBase, // keep the root base path in context - loadDoc: loader, - } -} - -type schemaLoader struct { - root interface{} - options *ExpandOptions - cache ResolutionCache - context *resolverContext -} - -func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) *schemaLoader { - if ref.IsRoot() || ref.HasFragmentOnly { - return r - } - - baseRef := MustCreateRef(basePath) - currentRef := normalizeRef(&ref, basePath) - if strings.HasPrefix(currentRef.String(), baseRef.String()) { - return r - } - - // set a new root against which to resolve - rootURL := currentRef.GetURL() - rootURL.Fragment = "" - root, _ := r.cache.Get(rootURL.String()) - - // shallow copy of resolver options to set a new RelativeBase when - // traversing multiple documents - newOptions := r.options - newOptions.RelativeBase = rootURL.String() - - return defaultSchemaLoader(root, newOptions, r.cache, r.context) -} - -func (r *schemaLoader) updateBasePath(transitive *schemaLoader, basePath string) string { - if transitive != r { - if transitive.options != nil && transitive.options.RelativeBase != "" { - return normalizeBase(transitive.options.RelativeBase) - } - } - - return basePath -} - -func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error { - tgt := reflect.ValueOf(target) - if tgt.Kind() != reflect.Ptr { - return ErrResolveRefNeedsAPointer - } - - if ref.GetURL() == nil { - return nil - } - - var ( - res interface{} - data interface{} - err error - ) - - // Resolve against the root if it isn't nil, and if ref is pointing at the root, or has a fragment only which means - // it is pointing somewhere in the root. - root := r.root - if (ref.IsRoot() || ref.HasFragmentOnly) && root == nil && basePath != "" { - if baseRef, erb := NewRef(basePath); erb == nil { - root, _, _, _ = r.load(baseRef.GetURL()) - } - } - - if (ref.IsRoot() || ref.HasFragmentOnly) && root != nil { - data = root - } else { - baseRef := normalizeRef(ref, basePath) - data, _, _, err = r.load(baseRef.GetURL()) - if err != nil { - return err - } - } - - res = data - if ref.String() != "" { - res, _, err = ref.GetPointer().Get(data) - if err != nil { - return err - } - } - return swag.DynamicJSONToStruct(res, target) -} - -func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) { - debugLog("loading schema from url: %s", refURL) - toFetch := *refURL - toFetch.Fragment = "" - - var err error - pth := toFetch.String() - normalized := normalizeBase(pth) - debugLog("loading doc from: %s", normalized) - - data, fromCache := r.cache.Get(normalized) - if fromCache { - return data, toFetch, fromCache, nil - } - - b, err := r.context.loadDoc(normalized) - if err != nil { - return nil, url.URL{}, false, err - } - - var doc interface{} - if err := json.Unmarshal(b, &doc); err != nil { - return nil, url.URL{}, false, err - } - r.cache.Set(normalized, doc) - - return doc, toFetch, fromCache, nil -} - -// isCircular detects cycles in sequences of $ref. -// -// It relies on a private context (which needs not be locked). -func (r *schemaLoader) isCircular(ref *Ref, basePath string, parentRefs ...string) (foundCycle bool) { - normalizedRef := normalizeURI(ref.String(), basePath) - if _, ok := r.context.circulars[normalizedRef]; ok { - // circular $ref has been already detected in another explored cycle - foundCycle = true - return - } - foundCycle = swag.ContainsStrings(parentRefs, normalizedRef) // normalized windows url's are lower cased - if foundCycle { - r.context.circulars[normalizedRef] = true - } - return -} - -// Resolve resolves a reference against basePath and stores the result in target. -// -// Resolve is not in charge of following references: it only resolves ref by following its URL. -// -// If the schema the ref is referring to holds nested refs, Resolve doesn't resolve them. -// -// If basePath is an empty string, ref is resolved against the root schema stored in the schemaLoader struct -func (r *schemaLoader) Resolve(ref *Ref, target interface{}, basePath string) error { - return r.resolveRef(ref, target, basePath) -} - -func (r *schemaLoader) deref(input interface{}, parentRefs []string, basePath string) error { - var ref *Ref - switch refable := input.(type) { - case *Schema: - ref = &refable.Ref - case *Parameter: - ref = &refable.Ref - case *Response: - ref = &refable.Ref - case *PathItem: - ref = &refable.Ref - default: - return fmt.Errorf("unsupported type: %T: %w", input, ErrDerefUnsupportedType) - } - - curRef := ref.String() - if curRef == "" { - return nil - } - - normalizedRef := normalizeRef(ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if r.isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) { - return err - } - - if ref.String() == "" || ref.String() == curRef { - // done with rereferencing - return nil - } - - parentRefs = append(parentRefs, normalizedRef.String()) - return r.deref(input, parentRefs, normalizedBasePath) -} - -func (r *schemaLoader) shouldStopOnError(err error) bool { - if err != nil && !r.options.ContinueOnError { - return true - } - - if err != nil { - log.Println(err) - } - - return false -} - -func (r *schemaLoader) setSchemaID(target interface{}, id, basePath string) (string, string) { - debugLog("schema has ID: %s", id) - - // handling the case when id is a folder - // remember that basePath has to point to a file - var refPath string - if strings.HasSuffix(id, "/") { - // ensure this is detected as a file, not a folder - refPath = fmt.Sprintf("%s%s", id, "placeholder.json") - } else { - refPath = id - } - - // updates the current base path - // * important: ID can be a relative path - // * registers target to be fetchable from the new base proposed by this id - newBasePath := normalizeURI(refPath, basePath) - - // store found IDs for possible future reuse in $ref - r.cache.Set(newBasePath, target) - - // the root document has an ID: all $ref relative to that ID may - // be rebased relative to the root document - if basePath == r.context.basePath { - debugLog("root document is a schema with ID: %s (normalized as:%s)", id, newBasePath) - r.context.rootID = newBasePath - } - - return newBasePath, refPath -} - -func defaultSchemaLoader( - root interface{}, - expandOptions *ExpandOptions, - cache ResolutionCache, - context *resolverContext) *schemaLoader { - - if expandOptions == nil { - expandOptions = &ExpandOptions{} - } - - cache = cacheOrDefault(cache) - - if expandOptions.RelativeBase == "" { - // if no relative base is provided, assume the root document - // contains all $ref, or at least, that the relative documents - // may be resolved from the current working directory. - expandOptions.RelativeBase = baseForRoot(root, cache) - } - debugLog("effective expander options: %#v", expandOptions) - - if context == nil { - context = newResolverContext(expandOptions) - } - - return &schemaLoader{ - root: root, - options: expandOptions, - cache: cache, - context: context, - } -} diff --git a/vendor/github.com/go-openapi/spec/security_scheme.go b/vendor/github.com/go-openapi/spec/security_scheme.go deleted file mode 100644 index 9d0bdae..0000000 --- a/vendor/github.com/go-openapi/spec/security_scheme.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - basic = "basic" - apiKey = "apiKey" - oauth2 = "oauth2" - implicit = "implicit" - password = "password" - application = "application" - accessCode = "accessCode" -) - -// BasicAuth creates a basic auth security scheme -func BasicAuth() *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: basic}} -} - -// APIKeyAuth creates an api key auth security scheme -func APIKeyAuth(fieldName, valueSource string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: apiKey, Name: fieldName, In: valueSource}} -} - -// OAuth2Implicit creates an implicit flow oauth2 security scheme -func OAuth2Implicit(authorizationURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: implicit, - AuthorizationURL: authorizationURL, - }} -} - -// OAuth2Password creates a password flow oauth2 security scheme -func OAuth2Password(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: password, - TokenURL: tokenURL, - }} -} - -// OAuth2Application creates an application flow oauth2 security scheme -func OAuth2Application(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: application, - TokenURL: tokenURL, - }} -} - -// OAuth2AccessToken creates an access token flow oauth2 security scheme -func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: accessCode, - AuthorizationURL: authorizationURL, - TokenURL: tokenURL, - }} -} - -// SecuritySchemeProps describes a swagger security scheme in the securityDefinitions section -type SecuritySchemeProps struct { - Description string `json:"description,omitempty"` - Type string `json:"type"` - Name string `json:"name,omitempty"` // api key - In string `json:"in,omitempty"` // api key - Flow string `json:"flow,omitempty"` // oauth2 - AuthorizationURL string `json:"authorizationUrl"` // oauth2 - TokenURL string `json:"tokenUrl,omitempty"` // oauth2 - Scopes map[string]string `json:"scopes,omitempty"` // oauth2 -} - -// AddScope adds a scope to this security scheme -func (s *SecuritySchemeProps) AddScope(scope, description string) { - if s.Scopes == nil { - s.Scopes = make(map[string]string) - } - s.Scopes[scope] = description -} - -// SecurityScheme allows the definition of a security scheme that can be used by the operations. -// Supported schemes are basic authentication, an API key (either as a header or as a query parameter) -// and OAuth2's common flows (implicit, password, application and access code). -// -// For more information: http://goo.gl/8us55a#securitySchemeObject -type SecurityScheme struct { - VendorExtensible - SecuritySchemeProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SecurityScheme) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SecuritySchemeProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (s SecurityScheme) MarshalJSON() ([]byte, error) { - var ( - b1 []byte - err error - ) - - if s.Type == oauth2 && (s.Flow == "implicit" || s.Flow == "accessCode") { - // when oauth2 for implicit or accessCode flows, empty AuthorizationURL is added as empty string - b1, err = json.Marshal(s.SecuritySchemeProps) - } else { - // when not oauth2, empty AuthorizationURL should be omitted - b1, err = json.Marshal(struct { - Description string `json:"description,omitempty"` - Type string `json:"type"` - Name string `json:"name,omitempty"` // api key - In string `json:"in,omitempty"` // api key - Flow string `json:"flow,omitempty"` // oauth2 - AuthorizationURL string `json:"authorizationUrl,omitempty"` // oauth2 - TokenURL string `json:"tokenUrl,omitempty"` // oauth2 - Scopes map[string]string `json:"scopes,omitempty"` // oauth2 - }{ - Description: s.Description, - Type: s.Type, - Name: s.Name, - In: s.In, - Flow: s.Flow, - AuthorizationURL: s.AuthorizationURL, - TokenURL: s.TokenURL, - Scopes: s.Scopes, - }) - } - if err != nil { - return nil, err - } - - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (s *SecurityScheme) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil { - return err - } - return json.Unmarshal(data, &s.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/spec.go b/vendor/github.com/go-openapi/spec/spec.go deleted file mode 100644 index 7d38b6e..0000000 --- a/vendor/github.com/go-openapi/spec/spec.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" -) - -//go:generate curl -L --progress -o ./schemas/v2/schema.json http://swagger.io/v2/schema.json -//go:generate curl -L --progress -o ./schemas/jsonschema-draft-04.json http://json-schema.org/draft-04/schema -//go:generate go-bindata -pkg=spec -prefix=./schemas -ignore=.*\.md ./schemas/... -//go:generate perl -pi -e s,Json,JSON,g bindata.go - -const ( - // SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs - SwaggerSchemaURL = "http://swagger.io/v2/schema.json#" - // JSONSchemaURL the url for the json schema schema - JSONSchemaURL = "http://json-schema.org/draft-04/schema#" -) - -// MustLoadJSONSchemaDraft04 panics when Swagger20Schema returns an error -func MustLoadJSONSchemaDraft04() *Schema { - d, e := JSONSchemaDraft04() - if e != nil { - panic(e) - } - return d -} - -// JSONSchemaDraft04 loads the json schema document for json shema draft04 -func JSONSchemaDraft04() (*Schema, error) { - b, err := Asset("jsonschema-draft-04.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} - -// MustLoadSwagger20Schema panics when Swagger20Schema returns an error -func MustLoadSwagger20Schema() *Schema { - d, e := Swagger20Schema() - if e != nil { - panic(e) - } - return d -} - -// Swagger20Schema loads the swagger 2.0 schema from the embedded assets -func Swagger20Schema() (*Schema, error) { - - b, err := Asset("v2/schema.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} diff --git a/vendor/github.com/go-openapi/spec/swagger.go b/vendor/github.com/go-openapi/spec/swagger.go deleted file mode 100644 index 44722ff..0000000 --- a/vendor/github.com/go-openapi/spec/swagger.go +++ /dev/null @@ -1,448 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "fmt" - "strconv" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// Swagger this is the root document object for the API specification. -// It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) -// together into one document. -// -// For more information: http://goo.gl/8us55a#swagger-object- -type Swagger struct { - VendorExtensible - SwaggerProps -} - -// JSONLookup look up a value by the json property name -func (s Swagger) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(s.SwaggerProps, token) - return r, err -} - -// MarshalJSON marshals this swagger structure to json -func (s Swagger) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SwaggerProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON unmarshals a swagger spec from json -func (s *Swagger) UnmarshalJSON(data []byte) error { - var sw Swagger - if err := json.Unmarshal(data, &sw.SwaggerProps); err != nil { - return err - } - if err := json.Unmarshal(data, &sw.VendorExtensible); err != nil { - return err - } - *s = sw - return nil -} - -// GobEncode provides a safe gob encoder for Swagger, including extensions -func (s Swagger) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw := struct { - Props SwaggerProps - Ext VendorExtensible - }{ - Props: s.SwaggerProps, - Ext: s.VendorExtensible, - } - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Swagger, including extensions -func (s *Swagger) GobDecode(b []byte) error { - var raw struct { - Props SwaggerProps - Ext VendorExtensible - } - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - s.SwaggerProps = raw.Props - s.VendorExtensible = raw.Ext - return nil -} - -// SwaggerProps captures the top-level properties of an Api specification -// -// NOTE: validation rules -// - the scheme, when present must be from [http, https, ws, wss] -// - BasePath must start with a leading "/" -// - Paths is required -type SwaggerProps struct { - ID string `json:"id,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` - Swagger string `json:"swagger,omitempty"` - Info *Info `json:"info,omitempty"` - Host string `json:"host,omitempty"` - BasePath string `json:"basePath,omitempty"` - Paths *Paths `json:"paths"` - Definitions Definitions `json:"definitions,omitempty"` - Parameters map[string]Parameter `json:"parameters,omitempty"` - Responses map[string]Response `json:"responses,omitempty"` - SecurityDefinitions SecurityDefinitions `json:"securityDefinitions,omitempty"` - Security []map[string][]string `json:"security,omitempty"` - Tags []Tag `json:"tags,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` -} - -type swaggerPropsAlias SwaggerProps - -type gobSwaggerPropsAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *swaggerPropsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for SwaggerProps, including empty security requirements -func (o SwaggerProps) GobEncode() ([]byte, error) { - raw := gobSwaggerPropsAlias{ - Alias: (*swaggerPropsAlias)(&o), - } - - var b bytes.Buffer - if o.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(o.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(o.Security)) - for _, req := range o.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for SwaggerProps, including empty security requirements -func (o *SwaggerProps) GobDecode(b []byte) error { - var raw gobSwaggerPropsAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *o = *(*SwaggerProps)(raw.Alias) - return nil -} - -// Dependencies represent a dependencies property -type Dependencies map[string]SchemaOrStringArray - -// SchemaOrBool represents a schema or boolean value, is biased towards true for the boolean property -type SchemaOrBool struct { - Allows bool - Schema *Schema -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) { - if token == "allows" { - return s.Allows, nil - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -var jsTrue = []byte("true") -var jsFalse = []byte("false") - -// MarshalJSON convert this object to JSON -func (s SchemaOrBool) MarshalJSON() ([]byte, error) { - if s.Schema != nil { - return json.Marshal(s.Schema) - } - - if s.Schema == nil && !s.Allows { - return jsFalse, nil - } - return jsTrue, nil -} - -// UnmarshalJSON converts this bool or schema object from a JSON structure -func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { - var nw SchemaOrBool - if len(data) >= 4 { - if data[0] == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e') - } - *s = nw - return nil -} - -// SchemaOrStringArray represents a schema or a string array -type SchemaOrStringArray struct { - Schema *Schema - Property []string -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) { - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -// MarshalJSON converts this schema object or array into JSON structure -func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { - if len(s.Property) > 0 { - return json.Marshal(s.Property) - } - if s.Schema != nil { - return json.Marshal(s.Schema) - } - return []byte("null"), nil -} - -// UnmarshalJSON converts this schema object or array from a JSON structure -func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - var nw SchemaOrStringArray - if first == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Property); err != nil { - return err - } - } - *s = nw - return nil -} - -// Definitions contains the models explicitly defined in this spec -// An object to hold data types that can be consumed and produced by operations. -// These data types can be primitives, arrays or models. -// -// For more information: http://goo.gl/8us55a#definitionsObject -type Definitions map[string]Schema - -// SecurityDefinitions a declaration of the security schemes available to be used in the specification. -// This does not enforce the security schemes on the operations and only serves to provide -// the relevant details for each scheme. -// -// For more information: http://goo.gl/8us55a#securityDefinitionsObject -type SecurityDefinitions map[string]*SecurityScheme - -// StringOrArray represents a value that can either be a string -// or an array of strings. Mainly here for serialization purposes -type StringOrArray []string - -// Contains returns true when the value is contained in the slice -func (s StringOrArray) Contains(value string) bool { - for _, str := range s { - if str == value { - return true - } - } - return false -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) { - if _, err := strconv.Atoi(token); err == nil { - r, _, err := jsonpointer.GetForToken(s.Schemas, token) - return r, err - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -// UnmarshalJSON unmarshals this string or array object from a JSON array or JSON string -func (s *StringOrArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - - if first == '[' { - var parsed []string - if err := json.Unmarshal(data, &parsed); err != nil { - return err - } - *s = StringOrArray(parsed) - return nil - } - - var single interface{} - if err := json.Unmarshal(data, &single); err != nil { - return err - } - if single == nil { - return nil - } - switch v := single.(type) { - case string: - *s = StringOrArray([]string{v}) - return nil - default: - return fmt.Errorf("only string or array is allowed, not %T", single) - } -} - -// MarshalJSON converts this string or array to a JSON array or JSON string -func (s StringOrArray) MarshalJSON() ([]byte, error) { - if len(s) == 1 { - return json.Marshal([]string(s)[0]) - } - return json.Marshal([]string(s)) -} - -// SchemaOrArray represents a value that can either be a Schema -// or an array of Schema. Mainly here for serialization purposes -type SchemaOrArray struct { - Schema *Schema - Schemas []Schema -} - -// Len returns the number of schemas in this property -func (s SchemaOrArray) Len() int { - if s.Schema != nil { - return 1 - } - return len(s.Schemas) -} - -// ContainsType returns true when one of the schemas is of the specified type -func (s *SchemaOrArray) ContainsType(name string) bool { - if s.Schema != nil { - return s.Schema.Type != nil && s.Schema.Type.Contains(name) - } - return false -} - -// MarshalJSON converts this schema object or array into JSON structure -func (s SchemaOrArray) MarshalJSON() ([]byte, error) { - if len(s.Schemas) > 0 { - return json.Marshal(s.Schemas) - } - return json.Marshal(s.Schema) -} - -// UnmarshalJSON converts this schema object or array from a JSON structure -func (s *SchemaOrArray) UnmarshalJSON(data []byte) error { - var nw SchemaOrArray - var first byte - if len(data) > 1 { - first = data[0] - } - if first == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Schemas); err != nil { - return err - } - } - *s = nw - return nil -} - -// vim:set ft=go noet sts=2 sw=2 ts=2: diff --git a/vendor/github.com/go-openapi/spec/tag.go b/vendor/github.com/go-openapi/spec/tag.go deleted file mode 100644 index faa3d3d..0000000 --- a/vendor/github.com/go-openapi/spec/tag.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// TagProps describe a tag entry in the top level tags section of a swagger spec -type TagProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` -} - -// NewTag creates a new tag -func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag { - return Tag{TagProps: TagProps{Description: description, Name: name, ExternalDocs: externalDocs}} -} - -// Tag allows adding meta data to a single tag that is used by the -// [Operation Object](http://goo.gl/8us55a#operationObject). -// It is not mandatory to have a Tag Object per tag used there. -// -// For more information: http://goo.gl/8us55a#tagObject -type Tag struct { - VendorExtensible - TagProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (t Tag) JSONLookup(token string) (interface{}, error) { - if ex, ok := t.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(t.TagProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (t Tag) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(t.TagProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(t.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (t *Tag) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &t.TagProps); err != nil { - return err - } - return json.Unmarshal(data, &t.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/validations.go b/vendor/github.com/go-openapi/spec/validations.go deleted file mode 100644 index 6360a8e..0000000 --- a/vendor/github.com/go-openapi/spec/validations.go +++ /dev/null @@ -1,215 +0,0 @@ -package spec - -// CommonValidations describe common JSON-schema validations -type CommonValidations struct { - Maximum *float64 `json:"maximum,omitempty"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` - Minimum *float64 `json:"minimum,omitempty"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - Pattern string `json:"pattern,omitempty"` - MaxItems *int64 `json:"maxItems,omitempty"` - MinItems *int64 `json:"minItems,omitempty"` - UniqueItems bool `json:"uniqueItems,omitempty"` - MultipleOf *float64 `json:"multipleOf,omitempty"` - Enum []interface{} `json:"enum,omitempty"` -} - -// SetValidations defines all validations for a simple schema. -// -// NOTE: the input is the larger set of validations available for schemas. -// For simple schemas, MinProperties and MaxProperties are ignored. -func (v *CommonValidations) SetValidations(val SchemaValidations) { - v.Maximum = val.Maximum - v.ExclusiveMaximum = val.ExclusiveMaximum - v.Minimum = val.Minimum - v.ExclusiveMinimum = val.ExclusiveMinimum - v.MaxLength = val.MaxLength - v.MinLength = val.MinLength - v.Pattern = val.Pattern - v.MaxItems = val.MaxItems - v.MinItems = val.MinItems - v.UniqueItems = val.UniqueItems - v.MultipleOf = val.MultipleOf - v.Enum = val.Enum -} - -type clearedValidation struct { - Validation string - Value interface{} -} - -type clearedValidations []clearedValidation - -func (c clearedValidations) apply(cbs []func(string, interface{})) { - for _, cb := range cbs { - for _, cleared := range c { - cb(cleared.Validation, cleared.Value) - } - } -} - -// ClearNumberValidations clears all number validations. -// -// Some callbacks may be set by the caller to capture changed values. -func (v *CommonValidations) ClearNumberValidations(cbs ...func(string, interface{})) { - done := make(clearedValidations, 0, 5) - defer func() { - done.apply(cbs) - }() - - if v.Minimum != nil { - done = append(done, clearedValidation{Validation: "minimum", Value: v.Minimum}) - v.Minimum = nil - } - if v.Maximum != nil { - done = append(done, clearedValidation{Validation: "maximum", Value: v.Maximum}) - v.Maximum = nil - } - if v.ExclusiveMaximum { - done = append(done, clearedValidation{Validation: "exclusiveMaximum", Value: v.ExclusiveMaximum}) - v.ExclusiveMaximum = false - } - if v.ExclusiveMinimum { - done = append(done, clearedValidation{Validation: "exclusiveMinimum", Value: v.ExclusiveMinimum}) - v.ExclusiveMinimum = false - } - if v.MultipleOf != nil { - done = append(done, clearedValidation{Validation: "multipleOf", Value: v.MultipleOf}) - v.MultipleOf = nil - } -} - -// ClearStringValidations clears all string validations. -// -// Some callbacks may be set by the caller to capture changed values. -func (v *CommonValidations) ClearStringValidations(cbs ...func(string, interface{})) { - done := make(clearedValidations, 0, 3) - defer func() { - done.apply(cbs) - }() - - if v.Pattern != "" { - done = append(done, clearedValidation{Validation: "pattern", Value: v.Pattern}) - v.Pattern = "" - } - if v.MinLength != nil { - done = append(done, clearedValidation{Validation: "minLength", Value: v.MinLength}) - v.MinLength = nil - } - if v.MaxLength != nil { - done = append(done, clearedValidation{Validation: "maxLength", Value: v.MaxLength}) - v.MaxLength = nil - } -} - -// ClearArrayValidations clears all array validations. -// -// Some callbacks may be set by the caller to capture changed values. -func (v *CommonValidations) ClearArrayValidations(cbs ...func(string, interface{})) { - done := make(clearedValidations, 0, 3) - defer func() { - done.apply(cbs) - }() - - if v.MaxItems != nil { - done = append(done, clearedValidation{Validation: "maxItems", Value: v.MaxItems}) - v.MaxItems = nil - } - if v.MinItems != nil { - done = append(done, clearedValidation{Validation: "minItems", Value: v.MinItems}) - v.MinItems = nil - } - if v.UniqueItems { - done = append(done, clearedValidation{Validation: "uniqueItems", Value: v.UniqueItems}) - v.UniqueItems = false - } -} - -// Validations returns a clone of the validations for a simple schema. -// -// NOTE: in the context of simple schema objects, MinProperties, MaxProperties -// and PatternProperties remain unset. -func (v CommonValidations) Validations() SchemaValidations { - return SchemaValidations{ - CommonValidations: v, - } -} - -// HasNumberValidations indicates if the validations are for numbers or integers -func (v CommonValidations) HasNumberValidations() bool { - return v.Maximum != nil || v.Minimum != nil || v.MultipleOf != nil -} - -// HasStringValidations indicates if the validations are for strings -func (v CommonValidations) HasStringValidations() bool { - return v.MaxLength != nil || v.MinLength != nil || v.Pattern != "" -} - -// HasArrayValidations indicates if the validations are for arrays -func (v CommonValidations) HasArrayValidations() bool { - return v.MaxItems != nil || v.MinItems != nil || v.UniqueItems -} - -// HasEnum indicates if the validation includes some enum constraint -func (v CommonValidations) HasEnum() bool { - return len(v.Enum) > 0 -} - -// SchemaValidations describes the validation properties of a schema -// -// NOTE: at this moment, this is not embedded in SchemaProps because this would induce a breaking change -// in the exported members: all initializers using litterals would fail. -type SchemaValidations struct { - CommonValidations - - PatternProperties SchemaProperties `json:"patternProperties,omitempty"` - MaxProperties *int64 `json:"maxProperties,omitempty"` - MinProperties *int64 `json:"minProperties,omitempty"` -} - -// HasObjectValidations indicates if the validations are for objects -func (v SchemaValidations) HasObjectValidations() bool { - return v.MaxProperties != nil || v.MinProperties != nil || v.PatternProperties != nil -} - -// SetValidations for schema validations -func (v *SchemaValidations) SetValidations(val SchemaValidations) { - v.CommonValidations.SetValidations(val) - v.PatternProperties = val.PatternProperties - v.MaxProperties = val.MaxProperties - v.MinProperties = val.MinProperties -} - -// Validations for a schema -func (v SchemaValidations) Validations() SchemaValidations { - val := v.CommonValidations.Validations() - val.PatternProperties = v.PatternProperties - val.MinProperties = v.MinProperties - val.MaxProperties = v.MaxProperties - return val -} - -// ClearObjectValidations returns a clone of the validations with all object validations cleared. -// -// Some callbacks may be set by the caller to capture changed values. -func (v *SchemaValidations) ClearObjectValidations(cbs ...func(string, interface{})) { - done := make(clearedValidations, 0, 3) - defer func() { - done.apply(cbs) - }() - - if v.MaxProperties != nil { - done = append(done, clearedValidation{Validation: "maxProperties", Value: v.MaxProperties}) - v.MaxProperties = nil - } - if v.MinProperties != nil { - done = append(done, clearedValidation{Validation: "minProperties", Value: v.MinProperties}) - v.MinProperties = nil - } - if v.PatternProperties != nil { - done = append(done, clearedValidation{Validation: "patternProperties", Value: v.PatternProperties}) - v.PatternProperties = nil - } -} diff --git a/vendor/github.com/go-openapi/spec/xml_object.go b/vendor/github.com/go-openapi/spec/xml_object.go deleted file mode 100644 index 945a467..0000000 --- a/vendor/github.com/go-openapi/spec/xml_object.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// XMLObject a metadata object that allows for more fine-tuned XML model definitions. -// -// For more information: http://goo.gl/8us55a#xmlObject -type XMLObject struct { - Name string `json:"name,omitempty"` - Namespace string `json:"namespace,omitempty"` - Prefix string `json:"prefix,omitempty"` - Attribute bool `json:"attribute,omitempty"` - Wrapped bool `json:"wrapped,omitempty"` -} - -// WithName sets the xml name for the object -func (x *XMLObject) WithName(name string) *XMLObject { - x.Name = name - return x -} - -// WithNamespace sets the xml namespace for the object -func (x *XMLObject) WithNamespace(namespace string) *XMLObject { - x.Namespace = namespace - return x -} - -// WithPrefix sets the xml prefix for the object -func (x *XMLObject) WithPrefix(prefix string) *XMLObject { - x.Prefix = prefix - return x -} - -// AsAttribute flags this object as xml attribute -func (x *XMLObject) AsAttribute() *XMLObject { - x.Attribute = true - return x -} - -// AsElement flags this object as an xml node -func (x *XMLObject) AsElement() *XMLObject { - x.Attribute = false - return x -} - -// AsWrapped flags this object as wrapped, this is mostly useful for array types -func (x *XMLObject) AsWrapped() *XMLObject { - x.Wrapped = true - return x -} - -// AsUnwrapped flags this object as an xml node -func (x *XMLObject) AsUnwrapped() *XMLObject { - x.Wrapped = false - return x -} diff --git a/vendor/github.com/go-openapi/strfmt/.editorconfig b/vendor/github.com/go-openapi/strfmt/.editorconfig deleted file mode 100644 index 3152da6..0000000 --- a/vendor/github.com/go-openapi/strfmt/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/strfmt/.gitignore b/vendor/github.com/go-openapi/strfmt/.gitignore deleted file mode 100644 index dd91ed6..0000000 --- a/vendor/github.com/go-openapi/strfmt/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets.yml -coverage.out diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml deleted file mode 100644 index 7ffaa32..0000000 --- a/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ /dev/null @@ -1,47 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 31 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 - -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoinits - - gochecknoglobals - - godox - - gocognit - - whitespace - - wsl - - funlen - - wrapcheck - - testpackage - - nlreturn - - gofumpt - - goerr113 - - gci - - gomnd - - godot - - exhaustivestruct - - paralleltest - #- thelper - -issues: - exclude-rules: - - path: bson.go - text: "should be .*ObjectID" - linters: - - golint - - stylecheck - diff --git a/vendor/github.com/go-openapi/strfmt/.travis.yml b/vendor/github.com/go-openapi/strfmt/.travis.yml deleted file mode 100644 index eaee5b6..0000000 --- a/vendor/github.com/go-openapi/strfmt/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -arch: -- amd64 -jobs: - include: - # only run fast tests on ppc64le - - go: 1.x - arch: ppc64le - script: - - gotestsum -f short-verbose -- ./... - - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master - -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: zE5AtIYTpYfQPnTzP+EaQPN7JKtfFAGv6PrJqoIZLOXa8B6zGb6+J1JRNNxWi7faWbyJOxa4FSSsuPsKZMycUK6wlLFIdhDxwqeo7Ew8r6rdZKdfUHQggfNS9wO79ARoNYUDHtmnaBUS+eWSM1YqSc4i99QxyyfuURLOeAaA/q14YbdlTlaw3lrZ0qT92ot1FnVGNOx064zuHtFeUf+jAVRMZ6Q3rvqllwIlPszE6rmHGXBt2VoJxRaBetdwd7FgkcYw9FPXKHhadwC7/75ZAdmxIukhxNMw4Tr5NuPcqNcnbYLenDP7B3lssGVIrP4BRSqekS1d/tqvdvnnFWHMwrNCkSnSc065G5+qWTlXKAemIclgiXXqE2furBNLm05MDdG8fn5epS0UNarkjD+zX336RiqwBlOX4KbF+vPyqcO98CsN0lnd+H6loc9reiTHs37orFFpQ+309av9be2GGsHUsRB9ssIyrewmhAccOmkRtr2dVTZJNFQwa5Kph5TNJuTjnZEwG/xUkEX2YSfwShOsb062JWiflV6PJdnl80pc9Tn7D5sO5Bf9DbijGRJwwP+YiiJtwtr+vsvS+n4sM0b5eqm4UoRo+JJO8ffoJtHS7ItuyRbVQCwEPJ4221WLcf5PquEEDdAPwR+K4Gj8qTXqTDdxOiES1xFUKVgmzhI= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/strfmt/LICENSE b/vendor/github.com/go-openapi/strfmt/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/strfmt/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md deleted file mode 100644 index 0cf89d7..0000000 --- a/vendor/github.com/go-openapi/strfmt/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Strfmt [![Build Status](https://travis-ci.org/go-openapi/strfmt.svg?branch=master)](https://travis-ci.org/go-openapi/strfmt) [![codecov](https://codecov.io/gh/go-openapi/strfmt/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/strfmt) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/strfmt/master/LICENSE) -[![GoDoc](https://godoc.org/github.com/go-openapi/strfmt?status.svg)](http://godoc.org/github.com/go-openapi/strfmt) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/strfmt.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/strfmt)](https://goreportcard.com/report/github.com/go-openapi/strfmt) - -This package exposes a registry of data types to support string formats in the go-openapi toolkit. - -strfmt represents a well known string format such as credit card or email. The go toolkit for OpenAPI specifications knows how to deal with those. - -## Supported data formats -go-openapi/strfmt follows the swagger 2.0 specification with the following formats -defined [here](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types). - -It also provides convenient extensions to go-openapi users. - -- [x] JSON-schema draft 4 formats - - date-time - - email - - hostname - - ipv4 - - ipv6 - - uri -- [x] swagger 2.0 format extensions - - binary - - byte (e.g. base64 encoded string) - - date (e.g. "1970-01-01") - - password -- [x] go-openapi custom format extensions - - bsonobjectid (BSON objectID) - - creditcard - - duration (e.g. "3 weeks", "1ms") - - hexcolor (e.g. "#FFFFFF") - - isbn, isbn10, isbn13 - - mac (e.g "01:02:03:04:05:06") - - rgbcolor (e.g. "rgb(100,100,100)") - - ssn - - uuid, uuid3, uuid4, uuid5 - - cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32") - - ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec)) - -> NOTE: as the name stands for, this package is intended to support string formatting only. -> It does not provide validation for numerical values with swagger format extension for JSON types "number" or -> "integer" (e.g. float, double, int32...). - -## Type conversion - -All types defined here are stringers and may be converted to strings with `.String()`. -Note that most types defined by this package may be converted directly to string like `string(Email{})`. - -`Date` and `DateTime` may be converted directly to `time.Time` like `time.Time(Time{})`. -Similarly, you can convert `Duration` to `time.Duration` as in `time.Duration(Duration{})` - -## Using pointers - -The `conv` subpackage provides helpers to convert the types to and from pointers, just like `go-openapi/swag` does -with primitive types. - -## Format types -Types defined in strfmt expose marshaling and validation capabilities. - -List of defined types: -- Base64 -- CreditCard -- Date -- DateTime -- Duration -- Email -- HexColor -- Hostname -- IPv4 -- IPv6 -- CIDR -- ISBN -- ISBN10 -- ISBN13 -- MAC -- ObjectId -- Password -- RGBColor -- SSN -- URI -- UUID -- UUID3 -- UUID4 -- UUID5 -- [ULID](https://github.com/ulid/spec) diff --git a/vendor/github.com/go-openapi/strfmt/bson.go b/vendor/github.com/go-openapi/strfmt/bson.go deleted file mode 100644 index c149612..0000000 --- a/vendor/github.com/go-openapi/strfmt/bson.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package strfmt - -import ( - "database/sql/driver" - "fmt" - - "go.mongodb.org/mongo-driver/bson" - - "go.mongodb.org/mongo-driver/bson/bsontype" - bsonprim "go.mongodb.org/mongo-driver/bson/primitive" -) - -func init() { - var id ObjectId - // register this format in the default registry - Default.Add("bsonobjectid", &id, IsBSONObjectID) -} - -// IsBSONObjectID returns true when the string is a valid BSON.ObjectId -func IsBSONObjectID(str string) bool { - _, err := bsonprim.ObjectIDFromHex(str) - return err == nil -} - -// ObjectId represents a BSON object ID (alias to go.mongodb.org/mongo-driver/bson/primitive.ObjectID) -// -// swagger:strfmt bsonobjectid -type ObjectId bsonprim.ObjectID - -// NewObjectId creates a ObjectId from a Hex String -func NewObjectId(hex string) ObjectId { - oid, err := bsonprim.ObjectIDFromHex(hex) - if err != nil { - panic(err) - } - return ObjectId(oid) -} - -// MarshalText turns this instance into text -func (id ObjectId) MarshalText() ([]byte, error) { - oid := bsonprim.ObjectID(id) - if oid == bsonprim.NilObjectID { - return nil, nil - } - return []byte(oid.Hex()), nil -} - -// UnmarshalText hydrates this instance from text -func (id *ObjectId) UnmarshalText(data []byte) error { // validation is performed later on - if len(data) == 0 { - *id = ObjectId(bsonprim.NilObjectID) - return nil - } - oidstr := string(data) - oid, err := bsonprim.ObjectIDFromHex(oidstr) - if err != nil { - return err - } - *id = ObjectId(oid) - return nil -} - -// Scan read a value from a database driver -func (id *ObjectId) Scan(raw interface{}) error { - var data []byte - switch v := raw.(type) { - case []byte: - data = v - case string: - data = []byte(v) - default: - return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v", v) - } - - return id.UnmarshalText(data) -} - -// Value converts a value to a database driver value -func (id ObjectId) Value() (driver.Value, error) { - return driver.Value(bsonprim.ObjectID(id).Hex()), nil -} - -func (id ObjectId) String() string { - return bsonprim.ObjectID(id).String() -} - -// MarshalJSON returns the ObjectId as JSON -func (id ObjectId) MarshalJSON() ([]byte, error) { - return bsonprim.ObjectID(id).MarshalJSON() -} - -// UnmarshalJSON sets the ObjectId from JSON -func (id *ObjectId) UnmarshalJSON(data []byte) error { - var obj bsonprim.ObjectID - if err := obj.UnmarshalJSON(data); err != nil { - return err - } - *id = ObjectId(obj) - return nil -} - -// MarshalBSON renders the object id as a BSON document -func (id ObjectId) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": bsonprim.ObjectID(id)}) -} - -// UnmarshalBSON reads the objectId from a BSON document -func (id *ObjectId) UnmarshalBSON(data []byte) error { - var obj struct { - Data bsonprim.ObjectID - } - if err := bson.Unmarshal(data, &obj); err != nil { - return err - } - *id = ObjectId(obj.Data) - return nil -} - -// MarshalBSONValue is an interface implemented by types that can marshal themselves -// into a BSON document represented as bytes. The bytes returned must be a valid -// BSON document if the error is nil. -func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) { - oid := bsonprim.ObjectID(id) - return bsontype.ObjectID, oid[:], nil -} - -// UnmarshalBSONValue is an interface implemented by types that can unmarshal a -// BSON value representation of themselves. The BSON bytes and type can be -// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it -// wishes to retain the data after returning. -func (id *ObjectId) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error { - var oid bsonprim.ObjectID - copy(oid[:], data) - *id = ObjectId(oid) - return nil -} - -// DeepCopyInto copies the receiver and writes its value into out. -func (id *ObjectId) DeepCopyInto(out *ObjectId) { - *out = *id -} - -// DeepCopy copies the receiver into a new ObjectId. -func (id *ObjectId) DeepCopy() *ObjectId { - if id == nil { - return nil - } - out := new(ObjectId) - id.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/go-openapi/strfmt/date.go b/vendor/github.com/go-openapi/strfmt/date.go deleted file mode 100644 index f0b3109..0000000 --- a/vendor/github.com/go-openapi/strfmt/date.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package strfmt - -import ( - "database/sql/driver" - "encoding/json" - "errors" - "fmt" - "time" - - "go.mongodb.org/mongo-driver/bson" -) - -func init() { - d := Date{} - // register this format in the default registry - Default.Add("date", &d, IsDate) -} - -// IsDate returns true when the string is a valid date -func IsDate(str string) bool { - _, err := time.Parse(RFC3339FullDate, str) - return err == nil -} - -const ( - // RFC3339FullDate represents a full-date as specified by RFC3339 - // See: http://goo.gl/xXOvVd - RFC3339FullDate = "2006-01-02" -) - -// Date represents a date from the API -// -// swagger:strfmt date -type Date time.Time - -// String converts this date into a string -func (d Date) String() string { - return time.Time(d).Format(RFC3339FullDate) -} - -// UnmarshalText parses a text representation into a date type -func (d *Date) UnmarshalText(text []byte) error { - if len(text) == 0 { - return nil - } - dd, err := time.Parse(RFC3339FullDate, string(text)) - if err != nil { - return err - } - *d = Date(dd) - return nil -} - -// MarshalText serializes this date type to string -func (d Date) MarshalText() ([]byte, error) { - return []byte(d.String()), nil -} - -// Scan scans a Date value from database driver type. -func (d *Date) Scan(raw interface{}) error { - switch v := raw.(type) { - case []byte: - return d.UnmarshalText(v) - case string: - return d.UnmarshalText([]byte(v)) - case time.Time: - *d = Date(v) - return nil - case nil: - *d = Date{} - return nil - default: - return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v", v) - } -} - -// Value converts Date to a primitive value ready to written to a database. -func (d Date) Value() (driver.Value, error) { - return driver.Value(d.String()), nil -} - -// MarshalJSON returns the Date as JSON -func (d Date) MarshalJSON() ([]byte, error) { - return json.Marshal(time.Time(d).Format(RFC3339FullDate)) -} - -// UnmarshalJSON sets the Date from JSON -func (d *Date) UnmarshalJSON(data []byte) error { - if string(data) == jsonNull { - return nil - } - var strdate string - if err := json.Unmarshal(data, &strdate); err != nil { - return err - } - tt, err := time.Parse(RFC3339FullDate, strdate) - if err != nil { - return err - } - *d = Date(tt) - return nil -} - -func (d Date) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": d.String()}) -} - -func (d *Date) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if data, ok := m["data"].(string); ok { - rd, err := time.Parse(RFC3339FullDate, data) - if err != nil { - return err - } - *d = Date(rd) - return nil - } - - return errors.New("couldn't unmarshal bson bytes value as Date") -} - -// DeepCopyInto copies the receiver and writes its value into out. -func (d *Date) DeepCopyInto(out *Date) { - *out = *d -} - -// DeepCopy copies the receiver into a new Date. -func (d *Date) DeepCopy() *Date { - if d == nil { - return nil - } - out := new(Date) - d.DeepCopyInto(out) - return out -} - -// GobEncode implements the gob.GobEncoder interface. -func (d Date) GobEncode() ([]byte, error) { - return d.MarshalBinary() -} - -// GobDecode implements the gob.GobDecoder interface. -func (d *Date) GobDecode(data []byte) error { - return d.UnmarshalBinary(data) -} - -// MarshalBinary implements the encoding.BinaryMarshaler interface. -func (d Date) MarshalBinary() ([]byte, error) { - return time.Time(d).MarshalBinary() -} - -// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. -func (d *Date) UnmarshalBinary(data []byte) error { - var original time.Time - - err := original.UnmarshalBinary(data) - if err != nil { - return err - } - - *d = Date(original) - - return nil -} - -// Equal checks if two Date instances are equal -func (d Date) Equal(d2 Date) bool { - return time.Time(d).Equal(time.Time(d2)) -} diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go deleted file mode 100644 index a89a4de..0000000 --- a/vendor/github.com/go-openapi/strfmt/default.go +++ /dev/null @@ -1,2035 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package strfmt - -import ( - "database/sql/driver" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "net/mail" - "regexp" - "strings" - - "github.com/asaskevich/govalidator" - "go.mongodb.org/mongo-driver/bson" -) - -const ( - // HostnamePattern http://json-schema.org/latest/json-schema-validation.html#anchor114 - // A string instance is valid against this attribute if it is a valid - // representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - // http://tools.ietf.org/html/rfc1034#section-3.5 - // ::= any one of the ten digits 0 through 9 - // var digit = /[0-9]/; - // ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case - // var letter = /[a-zA-Z]/; - // ::= | - // var letDig = /[0-9a-zA-Z]/; - // ::= | "-" - // var letDigHyp = /[-0-9a-zA-Z]/; - // ::= | - // var ldhStr = /[-0-9a-zA-Z]+/; - //